/* Generated by Cython 0.29.22 */

#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_22"
#define CYTHON_HEX_VERSION 0x001D16F0
#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__apply_makeboxes;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_convert;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_do_init;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6__svg_bezier;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_path;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_heads;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_make_draw_svg;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_draw;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_make_draw_asy;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_15_draw;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_arrows;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_17_segments;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20_make_draw_svg;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_draw;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_make_draw_asy;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23_draw;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_24_arrows;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25__flatten;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26___init__;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_27_convert;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_create_style;

/* "mathics/builtin/graphics.py":297
 *     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__apply_makeboxes {
  PyObject_HEAD
  PyObject *__pyx_v_convert;
  PyObject *__pyx_v_evaluation;
  PyObject *__pyx_v_self;
};


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


/* "mathics/builtin/graphics.py":319
 *                 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_2_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_convert *__pyx_outer_scope;
  PyObject *__pyx_v_atom;
};


/* "mathics/builtin/graphics.py":336
 *                     else:
 *                         n_leaves = (
 *                             Expression(SymbolN, leaf).evaluate(evaluation)             # <<<<<<<<<<<<<<
 *                             for leaf in content.leaves
 *                         )
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_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":572
 * 
 * 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_4_do_init {
  PyObject_HEAD
  PyObject *__pyx_v_points;
};


/* "mathics/builtin/graphics.py":578
 *             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_5_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_do_init *__pyx_outer_scope;
  PyObject *__pyx_v_leaf;
};


/* "mathics/builtin/graphics.py":657
 * 
 * 
 * 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_6__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":669
 *     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_7_path {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6__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":675
 *             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_8_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_path *__pyx_outer_scope;
  PyObject *__pyx_v_xy;
};


/* "mathics/builtin/graphics.py":843
 *             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_9_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":848
 *         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_10_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_heads *__pyx_outer_scope;
  PyObject *__pyx_v_x;
};


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


/* "mathics/builtin/graphics.py":897
 * 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_12_draw {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_make_draw_svg *__pyx_outer_scope;
  PyObject *__pyx_v_genexpr;
  PyObject *__pyx_v_points;
};


/* "mathics/builtin/graphics.py":899
 *         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_13_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_draw *__pyx_outer_scope;
  PyObject *__pyx_v_xy;
};


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


/* "mathics/builtin/graphics.py":905
 * 
 *     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_15_draw {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_make_draw_asy *__pyx_outer_scope;
  PyObject *__pyx_v_points;
  PyObject *__pyx_9genexpr11__pyx_v_xy;
};


/* "mathics/builtin/graphics.py":912
 *         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_16_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":913
 * 
 *     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_17_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":928
 *         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_18_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_arrows *__pyx_outer_scope;
  PyObject *__pyx_v_segment;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
};


/* "mathics/builtin/graphics.py":930
 *         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_19_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_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":984
 *         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_20_make_draw_svg {
  PyObject_HEAD
  PyObject *__pyx_v_self;
  PyObject *__pyx_v_style;
};


/* "mathics/builtin/graphics.py":985
 * 
 *     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_21_draw {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20_make_draw_svg *__pyx_outer_scope;
  PyObject *__pyx_v_points;
  PyObject *__pyx_v_s;
};


/* "mathics/builtin/graphics.py":991
 *         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_22_make_draw_asy {
  PyObject_HEAD
  PyObject *__pyx_v_pen;
  PyObject *__pyx_v_self;
};


/* "mathics/builtin/graphics.py":992
 * 
 *     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_23_draw {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_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":998
 *         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_24_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":1158
 * 
 * 
 * def _flatten(leaves):             # <<<<<<<<<<<<<<
 *     for leaf in leaves:
 *         if leaf.get_head_name() == "System`List":
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25__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":1172
 * 
 * class _GraphicsElements(object):
 *     def __init__(self, content, evaluation):             # <<<<<<<<<<<<<<
 *         self.evaluation = evaluation
 *         self.elements = []
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26___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":1205
 *             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_27_convert {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26___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":1245
 *         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_28_create_style {
  PyObject_HEAD
  PyObject *__pyx_v_convert;
  PyObject *__pyx_v_style;
};


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_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

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

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

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

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

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

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

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

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

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

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

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

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

/* 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__apply_makeboxes = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_1_convert = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr = 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_do_init = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_5_genexpr = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_6__svg_bezier = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_7_path = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_8_genexpr = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_9_heads = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_10_genexpr = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_11_make_draw_svg = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_12_draw = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_13_genexpr = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_14_make_draw_asy = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_15_draw = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_16_arrows = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_17_segments = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_18_genexpr = 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_make_draw_svg = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_21_draw = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_22_make_draw_asy = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_23_draw = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_24_arrows = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_25__flatten = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_26___init__ = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_27_convert = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_28_create_style = 0;
static PyObject *__pyx_9genexpr21__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_NotImplementedError;
static PyObject *__pyx_builtin_super;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_sum;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_zip;
static PyObject *__pyx_builtin_ValueError;
static const char __pyx_k_c[] = "c";
static const char __pyx_k_d[] = "d";
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_s[] = "s";
static const char __pyx_k_t[] = "t";
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__3[] = "; ";
static const char __pyx_k_cp[] = "cp";
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_mt[] = "mt";
static const char __pyx_k_ox[] = "ox";
static const char __pyx_k_oy[] = "oy";
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_sx[] = "sx";
static const char __pyx_k_sy[] = "sy";
static const char __pyx_k_t0[] = "t0";
static const char __pyx_k_t2[] = "t2";
static const char __pyx_k_t3[] = "t3";
static const char __pyx_k_tl[] = "tl";
static const char __pyx_k_tx[] = "tx";
static const char __pyx_k_ty[] = "ty";
static const char __pyx_k_x0[] = "x0";
static const char __pyx_k_x1[] = "x1";
static const char __pyx_k_xy[] = "xy";
static const char __pyx_k_Box[] = "Box";
static const char __pyx_k_Hue[] = "Hue";
static const char __pyx_k_LQC[] = "LQC";
static const char __pyx_k__10[] = " ";
static const char __pyx_k__16[] = "--";
static const char __pyx_k__22[] = "\"/>";
static const char __pyx_k__25[] = ", ";
static const char __pyx_k__26[] = ");";
static const char __pyx_k__47[] = "{}";
static const char __pyx_k__60[] = "_";
static const char __pyx_k_add[] = "add";
static const char __pyx_k_asy[] = "asy";
static const char __pyx_k_css[] = "css";
static const char __pyx_k_cut[] = "cut";
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_ext[] = "ext";
static const char __pyx_k_f_f[] = "%f,%f";
static const char __pyx_k_get[] = "get";
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_pos[] = "pos";
static const char __pyx_k_pre[] = "pre";
static const char __pyx_k_s_2[] = ", % s);";
static const char __pyx_k_seg[] = "seg";
static const char __pyx_k_sum[] = "sum";
static const char __pyx_k_svg[] = "svg";
static const char __pyx_k_zip[] = "zip";
static const char __pyx_k_Axes[] = "Axes";
static const char __pyx_k_Disk[] = "Disk";
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_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_args[] = "args";
static const char __pyx_k_code[] = "code";
static const char __pyx_k_copy[] = "copy";
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_head[] = "head";
static const char __pyx_k_init[] = "init";
static const char __pyx_k_item[] = "item";
static const char __pyx_k_keys[] = "keys";
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_math[] = "math";
static const char __pyx_k_name[] = "name";
static const char __pyx_k_norm[] = "_norm";
static const char __pyx_k_opts[] = "opts";
static const char __pyx_k_path[] = "path";
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_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_Arrow[] = "Arrow";
static const char __pyx_k_Color[] = "_Color";
static const char __pyx_k_False[] = "False";
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_apply[] = "apply";
static const char __pyx_k_arrow[] = "arrow";
static const char __pyx_k_atoms[] = "atoms";
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_floor[] = "floor";
static const char __pyx_k_forms[] = "forms";
static const char __pyx_k_heads[] = "heads";
static const char __pyx_k_inset[] = "inset";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_klass[] = "klass";
static const char __pyx_k_lines[] = "lines";
static const char __pyx_k_neg_y[] = "neg_y";
static const char __pyx_k_point[] = "point";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_rules[] = "rules";
static const char __pyx_k_shape[] = "shape";
static const char __pyx_k_specs[] = "specs";
static const char __pyx_k_style[] = "style";
static const char __pyx_k_super[] = "super";
static const char __pyx_k_throw[] = "throw";
static const char __pyx_k_total[] = "total";
static const char __pyx_k_union[] = "union";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_Circle[] = "Circle";
static const char __pyx_k_Coords[] = "Coords";
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_Sphere[] = "Sphere";
static const char __pyx_k_Symbol[] = "Symbol";
static const char __pyx_k_System[] = "System`";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_arrows[] = "arrows";
static const char __pyx_k_border[] = "border";
static const char __pyx_k_coords[] = "coords";
static const char __pyx_k_create[] = "create";
static const char __pyx_k_draw_2[] = "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_import[] = "__import__";
static const char __pyx_k_init_2[] = "__init__";
static const char __pyx_k_lambda[] = "<lambda>";
static const char __pyx_k_leaves[] = "leaves";
static const char __pyx_k_length[] = "length";
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_result[] = "result";
static const char __pyx_k_styles[] = "styles";
static const char __pyx_k_to_css[] = "to_css";
static const char __pyx_k_update[] = "update";
static const char __pyx_k_Builtin[] = "Builtin";
static const char __pyx_k_GLOBALS[] = "GLOBALS";
static const char __pyx_k_Integer[] = "Integer";
static const char __pyx_k_Polygon[] = "Polygon";
static const char __pyx_k_SymbolN[] = "SymbolN";
static const char __pyx_k_builtin[] = "builtin";
static const char __pyx_k_color_s[] = "color: %s";
static const char __pyx_k_content[] = "content";
static const char __pyx_k_convert[] = "convert";
static const char __pyx_k_do_init[] = "do_init";
static const char __pyx_k_element[] = "element";
static const char __pyx_k_extents[] = "extents";
static const char __pyx_k_flatten[] = "_flatten";
static const char __pyx_k_genexpr[] = "genexpr";
static const char __pyx_k_opacity[] = "opacity";
static const char __pyx_k_options[] = "options";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_py_name[] = "py_name";
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_version[] = "__version__";
static const char __pyx_k_Circle_2[] = "Circle[]";
static const char __pyx_k_Cylinder[] = "Cylinder";
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_LABColor[] = "LABColor";
static const char __pyx_k_LCHColor[] = "LCHColor";
static const char __pyx_k_LUVColor[] = "LUVColor";
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_StyleBox[] = "StyleBox";
static const char __pyx_k_XYZColor[] = "XYZColor";
static const char __pyx_k_builtins[] = "builtins";
static const char __pyx_k_elements[] = "elements";
static const char __pyx_k_evaluate[] = "evaluate";
static const char __pyx_k_get_name[] = "get_name";
static const char __pyx_k_graphics[] = "graphics";
static const char __pyx_k_has_form[] = "has_form";
static const char __pyx_k_leaves_2[] = "_leaves";
static const char __pyx_k_n_leaves[] = "n_leaves";
static const char __pyx_k_new_item[] = "new_item";
static const char __pyx_k_qualname[] = "__qualname__";
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_to_float[] = "_to_float";
static const char __pyx_k_Automatic[] = "Automatic";
static const char __pyx_k_AxesStyle[] = "AxesStyle";
static const char __pyx_k_CMYKColor[] = "CMYKColor";
static const char __pyx_k_Directive[] = "Directive";
static const char __pyx_k_FontColor[] = "FontColor";
static const char __pyx_k_GrayLevel[] = "GrayLevel";
static const char __pyx_k_ImageSize[] = "ImageSize";
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_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_format_fn[] = "format_fn";
static const char __pyx_k_get_atoms[] = "get_atoms";
static const char __pyx_k_get_class[] = "get_class";
static const char __pyx_k_get_style[] = "get_style";
static const char __pyx_k_head_name[] = "head_name";
static const char __pyx_k_leaf_name[] = "leaf_name";
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_size_spec[] = "size_spec";
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_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_Graphics3D[] = "Graphics3D";
static const char __pyx_k_LabelStyle[] = "LabelStyle";
static const char __pyx_k_Show_apply[] = "Show.apply";
static const char __pyx_k_SymbolList[] = "SymbolList";
static const char __pyx_k_TicksStyle[] = "TicksStyle";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_arrow_size[] = "_arrow_size";
static const char __pyx_k_asy_bezier[] = "asy_bezier";
static const char __pyx_k_attributes[] = "attributes";
static const char __pyx_k_box_suffix[] = "box_suffix";
static const char __pyx_k_components[] = "components";
static const char __pyx_k_create_css[] = "create_css";
static const char __pyx_k_edge_color[] = "edge_color";
static const char __pyx_k_edge_style[] = "edge_style";
static const char __pyx_k_evaluation[] = "evaluation";
static const char __pyx_k_face_color[] = "face_color";
static const char __pyx_k_face_style[] = "face_style";
static const char __pyx_k_font_color[] = "font_color";
static const char __pyx_k_get_option[] = "get_option";
static const char __pyx_k_is_numeric[] = "is_numeric";
static const char __pyx_k_max_degree[] = "max_degree";
static const char __pyx_k_new_leaves[] = "new_leaves";
static const char __pyx_k_set_option[] = "set_option";
static const char __pyx_k_svg_bezier[] = "_svg_bezier";
static const char __pyx_k_view_width[] = "view_width";
static const char __pyx_k_AspectRatio[] = "AspectRatio";
static const char __pyx_k_BezierCurve[] = "_BezierCurve";
static const char __pyx_k_FilledCurve[] = "FilledCurve";
static const char __pyx_k_GraphicsBox[] = "GraphicsBox";
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_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_allow_forms[] = "allow_forms";
static const char __pyx_k_definitions[] = "definitions";
static const char __pyx_k_get_options[] = "get_options";
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_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_OptionSyntax[] = "$OptionSyntax";
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_create_style[] = "create_style";
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_fill_opacity[] = "fill_opacity";
static const char __pyx_k_graphics_box[] = "graphics_box";
static const char __pyx_k_pixel_height[] = "pixel_height";
static const char __pyx_k_stroke_width[] = "stroke_width";
static const char __pyx_k_total_extent[] = "total_extent";
static const char __pyx_k_BezierCurve_2[] = "BezierCurve";
static const char __pyx_k_Coords___init[] = "Coords.__init__";
static const char __pyx_k_Graphics3DBox[] = "Graphics3DBox";
static const char __pyx_k_ReadProtected[] = "ReadProtected";
static const char __pyx_k_Rectangle_0_0[] = "Rectangle[{0, 0}]";
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_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_thickness[] = "get_thickness";
static const char __pyx_k_include_heads[] = "include_heads";
static const char __pyx_k_lookup_method[] = "lookup_method";
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_spline_degree[] = "spline_degree";
static const char __pyx_k_style_options[] = "style_options";
static const char __pyx_k_RegularPolygon[] = "RegularPolygon";
static const char __pyx_k_consider_forms[] = "consider_forms";
static const char __pyx_k_fill_opacity_s[] = "fill-opacity: %s";
static const char __pyx_k_get_line_width[] = "get_line_width";
static const char __pyx_k_round_to_float[] = "round_to_float";
static const char __pyx_k_stroke_opacity[] = "stroke_opacity";
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_Arrowheads_init[] = "Arrowheads.init";
static const char __pyx_k_GraphicsElement[] = "_GraphicsElement";
static const char __pyx_k_Polyline_extent[] = "_Polyline.extent";
static const char __pyx_k_Style_get_style[] = "Style.get_style";
static const char __pyx_k_SymbolMakeBoxes[] = "SymbolMakeBoxes";
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_apply_makeboxes[] = "apply_makeboxes";
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_defined_options[] = "defined_options";
static const char __pyx_k_get_style_class[] = "get_style_class";
static const char __pyx_k_mathics_version[] = "mathics.version";
static const char __pyx_k_polyline_points[] = "<polyline points=\"";
static const char __pyx_k_Arrowheads_heads[] = "Arrowheads.heads";
static const char __pyx_k_CoordinatesError[] = "CoordinatesError";
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_PlotRangePadding[] = "PlotRangePadding";
static const char __pyx_k_Polyline_do_init[] = "_Polyline.do_init";
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_ImageSize[] = "System`ImageSize";
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_get_string_value[] = "get_string_value";
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_AbsoluteThickness[] = "AbsoluteThickness";
static const char __pyx_k_BoxConstructError[] = "BoxConstructError";
static const char __pyx_k_bezier_derivative[] = "_bezier_derivative";
static const char __pyx_k_get_absolute_size[] = "get_absolute_size";
static const char __pyx_k_BezierCurve___init[] = "_BezierCurve.__init__";
static const char __pyx_k_BezierCurve_arrows[] = "_BezierCurve.arrows";
static const char __pyx_k_GraphicsElements_2[] = "_GraphicsElements";
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_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_translate_absolute[] = "translate_absolute";
static const char __pyx_k_translate_relative[] = "translate_relative";
static const char __pyx_k_AbsoluteThickness_2[] = "AbsoluteThickness[2]";
static const char __pyx_k_NotImplementedError[] = "NotImplementedError";
static const char __pyx_k_System_VertexColors[] = "System`VertexColors";
static const char __pyx_k_system_symbols_dict[] = "system_symbols_dict";
static const char __pyx_k_DEFAULT_POINT_FACTOR[] = "DEFAULT_POINT_FACTOR";
static const char __pyx_k_ImageSizeMultipliers[] = "ImageSizeMultipliers";
static const char __pyx_k_Style_get_line_width[] = "Style.get_line_width";
static const char __pyx_k_mathics_builtin_base[] = "mathics.builtin.base";
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_is_completely_visible[] = "is_completely_visible";
static const char __pyx_k_Arrowheads__arrow_size[] = "Arrowheads._arrow_size";
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_mathics_core_formatter[] = "mathics.core.formatter";
static const char __pyx_k_mathics_format_asy_fns[] = "mathics.format.asy_fns";
static const char __pyx_k_svg_bezier_locals_path[] = "_svg_bezier.<locals>.path";
static const char __pyx_k_GraphicsElements___init[] = "_GraphicsElements.__init__";
static const char __pyx_k_GraphicsElements_extent[] = "GraphicsElements.extent";
static const char __pyx_k_Thickness_get_thickness[] = "Thickness.get_thickness";
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_Graphics_apply_makeboxes[] = "Graphics.apply_makeboxes";
static const char __pyx_k_mathics_builtin_graphics[] = "mathics.builtin.graphics";
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_GraphicsElements___init_2[] = "GraphicsElements.__init__";
static const char __pyx_k_GraphicsElements_set_size[] = "GraphicsElements.set_size";
static const char __pyx_k_GraphicsElements_translate[] = "GraphicsElements.translate";
static const char __pyx_k_Line_arrows_locals_genexpr[] = "_Line.arrows.<locals>.genexpr";
static const char __pyx_k_Line_arrows_locals_segments[] = "_Line.arrows.<locals>.segments";
static const char __pyx_k_PointSize_get_absolute_size[] = "PointSize.get_absolute_size";
static const char __pyx_k_mathics_builtin_graphics_py[] = "mathics/builtin/graphics.py";
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_mathics_builtin_box_graphics[] = "mathics.builtin.box.graphics";
static const char __pyx_k_GraphicsElements_create_style[] = "_GraphicsElements.create_style";
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_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    Points are rendered if possible as circular regions. Their diameters can be specified using 'PointSize'.\n\n    Points can be specified as {$x$, $y$}:\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    or as {$x$, $y$, $z$}:\n\n    >> Graphics3D[{Orange, PointSize[0.05], Point[Table[{Sin[t], Cos[t], 0}, {t, 0, 2 Pi, Pi / 15.}]]}]\n     = -Graphics3D-\n\n    ";
static const char __pyx_k_dl_dt_Show_graphics_options_dd[] = "\n    <dl>\n    <dt>'Show[$graphics$, $options$]'\n        <dd>shows a list of graphics with the specified options added.\n    </dl>\n\n    >> Show[{Plot[x, {x, 0, 10}], ListPlot[{1,2,3}]}]\n     = ...\n    ";
static const char __pyx_k_mathics_builtin_box_graphics3d[] = "mathics.builtin.box.graphics3d";
static const char __pyx_k_AbsoluteThickness_get_thickness[] = "AbsoluteThickness.get_thickness";
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_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_Polyline_do_init_locals_genexpr[] = "_Polyline.do_init.<locals>.genexpr";
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\n      <dt>'Arrow[{$p1$, $p2$}, $s$]'\n      <dd>represents a line with arrow that keeps a distance of $s$ from $p1$ and $p2$.\n\n      <dt>'Arrow[{$point_1$, $point_2$}, {$s1$, $s2$}]'\n      <dd>represents a line with arrow that keeps a distance of $s1$ from $p1$ and a distance of $s2$ from $p2$.\n\n      <dt>'Arrow[{$point_1$, $point_2$}, {$s1$, $s2$}]'\n      <dd>represents a line with arrow that keeps a distance of $s1$ from $p1$ 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    Arrows can also be drawn in 3D by giving poing in three dimensions:\n\n    >> Graphics3D[Arrow[{{1, 1, -1}, {2, 2, 0}, {3, 3, -1}, {4, 4, 0}}]]\n     = -Graphics3D-\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_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\n      <dt>'Circle[{$cx$, $cy$}, {$rx$, $ry$}]'\n      <dd>draws an ellipse.\n\n      <dt>'Circle[{$cx$, $cy$}]'\n      <dd>chooses radius 1.\n\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\n    Target practice:\n    >> Graphics[Circle[], Axes-> True]\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\n      <li>TicksStyle\n      <li>AxesStyle\n      <li>LabelStyle\n      <li>AspectRatio\n      <li>PlotRange\n      <li>PlotRangePadding\n      <li>ImageSize\n      <li>Background\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_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_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    'PointSize' can be used for both two- and three-dimensional graphics. The initial default pointsize is 0.008 for two-dimensional graphics and 0.01 for three-dimensional graphics.\n\n    >> Table[Graphics[{PointSize[r], Point[{0, 0}]}], {r, {0.02, 0.05, 0.1, 0.3}}]\n     = {-Graphics-, -Graphics-, -Graphics-, -Graphics-}\n\n    >> Table[Graphics3D[{PointSize[r], Point[{0, 0, 0}]}], {r, {0.05, 0.1, 0.8}}]\n    = {-Graphics3D-, -Graphics3D-, -Graphics3D-}\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\n      <dt>'Polygon[{{$p_11$, $p_12$, ...}, {$p_21$, $p_22$, ...}, ...}]'\n      <dd>represents a number of filled polygon primitives.\n    </dl>\n\n    A Right Triangle:\n    >> Graphics[Polygon[{{1,0},{0,0},{0,1}}]]\n    = -Graphics-\n\n    Notice that there is a line connecting from the last point to the first one.\n\n    A point is an element of the polygon if a ray from the point in any direction in the plane crosses the boundary line segments an odd number of times.\n    >> Graphics[Polygon[{{150,0},{121,90},{198,35},{102,35},{179,90}}]]\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_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_svg_bezier_locals_path_locals_g[] = "_svg_bezier.<locals>.path.<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_cannot_compute_bezier_curve_of_o[] = "cannot compute bezier curve of order %d";
static const char __pyx_k_mathics_builtin_colors_color_dir[] = "mathics.builtin.colors.color_directives";
static const char __pyx_k_mathics_builtin_drawing_graphics[] = "mathics.builtin.drawing.graphics3d";
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_mathics_builtin_drawing_graphics_2[] = "mathics.builtin.drawing.graphics_internals";
static PyObject *__pyx_kp_u_5g_5g;
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_s_Arrow;
static PyObject *__pyx_n_u_Arrow;
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_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_BezierCurve;
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_u_Box;
static PyObject *__pyx_n_s_BoxConstructError;
static PyObject *__pyx_n_s_Builtin;
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_kp_u_Circle_0_0;
static PyObject *__pyx_kp_u_Circle_2;
static PyObject *__pyx_n_s_Color;
static PyObject *__pyx_n_s_ColorError;
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_u_Cylinder;
static PyObject *__pyx_n_s_DEFAULT_POINT_FACTOR;
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_kp_u_Disk_0_0;
static PyObject *__pyx_kp_u_Disk_2;
static PyObject *__pyx_n_s_EdgeForm;
static PyObject *__pyx_n_s_Expression;
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_FontColor;
static PyObject *__pyx_n_u_FontColor;
static PyObject *__pyx_n_s_GLOBALS;
static PyObject *__pyx_n_s_GRAPHICS_OPTIONS;
static PyObject *__pyx_n_s_GRAPHICS_SYMBOLS;
static PyObject *__pyx_n_s_Graphics;
static PyObject *__pyx_n_s_Graphics3D;
static PyObject *__pyx_n_s_Graphics3DBox;
static PyObject *__pyx_n_s_GraphicsBox;
static PyObject *__pyx_n_s_GraphicsElement;
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_translate;
static PyObject *__pyx_n_s_GraphicsElements_translate_absol;
static PyObject *__pyx_n_s_GraphicsElements_translate_relat;
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_GrayLevel;
static PyObject *__pyx_n_u_GrayLevel;
static PyObject *__pyx_n_s_Hue;
static PyObject *__pyx_n_u_Hue;
static PyObject *__pyx_n_u_Ignore;
static PyObject *__pyx_n_u_ImageSize;
static PyObject *__pyx_n_u_ImageSizeMultipliers;
static PyObject *__pyx_n_s_Inset;
static PyObject *__pyx_n_u_Inset;
static PyObject *__pyx_n_s_Integer;
static PyObject *__pyx_n_s_LABColor;
static PyObject *__pyx_n_u_LABColor;
static PyObject *__pyx_n_s_LCHColor;
static PyObject *__pyx_n_u_LCHColor;
static PyObject *__pyx_n_u_LQC;
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_Line;
static PyObject *__pyx_n_u_Line;
static PyObject *__pyx_n_s_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_kp_u_M_f_f;
static PyObject *__pyx_n_s_Medium;
static PyObject *__pyx_kp_u_None;
static PyObject *__pyx_n_s_NotImplementedError;
static PyObject *__pyx_n_s_Offset;
static PyObject *__pyx_n_u_Offset;
static PyObject *__pyx_kp_u_OptionSyntax;
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_PointSize;
static PyObject *__pyx_n_u_PointSize;
static PyObject *__pyx_n_s_PointSize_get_absolute_size;
static PyObject *__pyx_n_s_Polygon;
static PyObject *__pyx_n_u_Polygon;
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_RGBColor;
static PyObject *__pyx_n_u_RGBColor;
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_kp_u_Rectangle_0_0;
static PyObject *__pyx_kp_u_Rectangle_2;
static PyObject *__pyx_n_s_RegularPolygon;
static PyObject *__pyx_n_u_RegularPolygon;
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_s_Style;
static PyObject *__pyx_n_u_Style;
static PyObject *__pyx_n_u_StyleBox;
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_n_s_SymbolList;
static PyObject *__pyx_n_s_SymbolMakeBoxes;
static PyObject *__pyx_n_s_SymbolN;
static PyObject *__pyx_kp_u_System;
static PyObject *__pyx_kp_u_System_Automatic;
static PyObject *__pyx_kp_u_System_EdgeForm;
static PyObject *__pyx_kp_u_System_FaceForm;
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_Large;
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_Rule;
static PyObject *__pyx_kp_u_System_Small;
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_Tiny;
static PyObject *__pyx_kp_u_System_VertexColors;
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_s_ValueError;
static PyObject *__pyx_n_s_XYZColor;
static PyObject *__pyx_n_u_XYZColor;
static PyObject *__pyx_kp_u__10;
static PyObject *__pyx_kp_u__16;
static PyObject *__pyx_kp_u__22;
static PyObject *__pyx_kp_u__25;
static PyObject *__pyx_kp_u__26;
static PyObject *__pyx_kp_u__3;
static PyObject *__pyx_kp_u__47;
static PyObject *__pyx_n_s__60;
static PyObject *__pyx_n_s_add;
static PyObject *__pyx_n_s_allow_forms;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_apply;
static PyObject *__pyx_n_s_apply_makeboxes;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_n_s_arrow;
static PyObject *__pyx_n_s_arrow_size;
static PyObject *__pyx_n_s_arrows;
static PyObject *__pyx_n_u_asy;
static PyObject *__pyx_n_s_asy_bezier;
static PyObject *__pyx_n_s_atoms;
static PyObject *__pyx_n_s_attributes;
static PyObject *__pyx_n_s_bezier_derivative;
static PyObject *__pyx_n_s_bezier_evaluate;
static PyObject *__pyx_n_s_border;
static PyObject *__pyx_n_s_box_suffix;
static PyObject *__pyx_n_s_builtin;
static PyObject *__pyx_n_s_builtins;
static PyObject *__pyx_n_s_c;
static PyObject *__pyx_n_s_calc_dimensions;
static PyObject *__pyx_kp_u_cannot_compute_bezier_curve_of_o;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_clone;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_code;
static PyObject *__pyx_n_s_color;
static PyObject *__pyx_kp_u_color_s;
static PyObject *__pyx_n_s_completely_visible_only;
static PyObject *__pyx_n_s_components;
static PyObject *__pyx_n_s_consider_forms;
static PyObject *__pyx_n_s_content;
static PyObject *__pyx_n_s_convert;
static PyObject *__pyx_n_s_coords;
static PyObject *__pyx_n_s_copy;
static PyObject *__pyx_n_s_cp;
static PyObject *__pyx_n_s_create;
static PyObject *__pyx_n_s_create_as_style;
static PyObject *__pyx_n_s_create_css;
static PyObject *__pyx_n_s_create_style;
static PyObject *__pyx_n_s_css;
static PyObject *__pyx_n_s_custom_arrow;
static PyObject *__pyx_n_s_cut;
static PyObject *__pyx_n_s_d;
static PyObject *__pyx_n_s_data;
static PyObject *__pyx_n_s_data_and_options;
static PyObject *__pyx_n_s_dcp;
static PyObject *__pyx_n_s_default_arrow;
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_dir;
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_Circle_cx_cy_r_dd_draws_a;
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_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_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_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_n_s_do_init;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_draw;
static PyObject *__pyx_kp_u_draw_2;
static PyObject *__pyx_n_s_dx;
static PyObject *__pyx_n_s_dy;
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_element;
static PyObject *__pyx_n_s_element_class;
static PyObject *__pyx_n_s_element_heads;
static PyObject *__pyx_n_s_elements;
static PyObject *__pyx_n_s_enumerate;
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_expr;
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_ey;
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_none;
static PyObject *__pyx_n_s_fill_opacity;
static PyObject *__pyx_kp_u_fill_opacity_s;
static PyObject *__pyx_kp_u_fill_s;
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_n_s_format;
static PyObject *__pyx_n_s_format_fn;
static PyObject *__pyx_n_s_forms;
static PyObject *__pyx_n_s_genexpr;
static PyObject *__pyx_n_s_get;
static PyObject *__pyx_n_s_get_absolute_size;
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_line_width;
static PyObject *__pyx_n_s_get_name;
static PyObject *__pyx_n_s_get_option;
static PyObject *__pyx_n_s_get_options;
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_n_s_graphics;
static PyObject *__pyx_n_s_graphics_box;
static PyObject *__pyx_n_s_h;
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_heads;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_include_heads;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_init_2;
static PyObject *__pyx_n_s_inset;
static PyObject *__pyx_n_s_is_completely_visible;
static PyObject *__pyx_n_s_is_numeric;
static PyObject *__pyx_n_s_item;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_s_k;
static PyObject *__pyx_n_s_keys;
static PyObject *__pyx_n_s_klass;
static PyObject *__pyx_n_s_l;
static PyObject *__pyx_n_s_lambda;
static PyObject *__pyx_n_s_leaf;
static PyObject *__pyx_n_s_leaf_name;
static PyObject *__pyx_n_s_leaves;
static PyObject *__pyx_n_s_leaves_2;
static PyObject *__pyx_n_s_length;
static PyObject *__pyx_n_s_line;
static PyObject *__pyx_n_s_lines;
static PyObject *__pyx_n_s_lookup_method;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_make_draw_asy;
static PyObject *__pyx_n_s_make_draw_svg;
static PyObject *__pyx_n_s_math;
static PyObject *__pyx_n_s_mathics_builtin_base;
static PyObject *__pyx_n_s_mathics_builtin_box_graphics;
static PyObject *__pyx_n_s_mathics_builtin_box_graphics3d;
static PyObject *__pyx_n_s_mathics_builtin_colors_color_dir;
static PyObject *__pyx_n_s_mathics_builtin_drawing_graphics;
static PyObject *__pyx_n_s_mathics_builtin_drawing_graphics_2;
static PyObject *__pyx_n_s_mathics_builtin_graphics;
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_formatter;
static PyObject *__pyx_n_s_mathics_format_asy_fns;
static PyObject *__pyx_n_s_mathics_version;
static PyObject *__pyx_n_s_max_degree;
static PyObject *__pyx_n_s_metaclass;
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_parts;
static PyObject *__pyx_n_s_n;
static PyObject *__pyx_n_s_n_leaves;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_s_name_head;
static PyObject *__pyx_n_s_neg_y;
static PyObject *__pyx_n_s_new_item;
static PyObject *__pyx_n_s_new_leaves;
static PyObject *__pyx_n_s_new_style;
static PyObject *__pyx_n_s_norm;
static PyObject *__pyx_n_s_object;
static PyObject *__pyx_n_s_opacity;
static PyObject *__pyx_kp_u_opacity_s;
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_opts;
static PyObject *__pyx_n_s_ox;
static PyObject *__pyx_n_s_oy;
static PyObject *__pyx_n_s_p;
static PyObject *__pyx_n_s_path;
static PyObject *__pyx_kp_u_path_d;
static PyObject *__pyx_n_s_pen;
static PyObject *__pyx_n_s_pixel_height;
static PyObject *__pyx_n_s_pixel_width;
static PyObject *__pyx_n_s_point;
static PyObject *__pyx_n_s_points;
static PyObject *__pyx_kp_u_polyline_points;
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_px;
static PyObject *__pyx_n_s_py;
static PyObject *__pyx_n_s_py_name;
static PyObject *__pyx_n_s_q;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_qx;
static PyObject *__pyx_n_s_qy;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_restructure;
static PyObject *__pyx_n_s_result;
static PyObject *__pyx_n_s_round_to_float;
static PyObject *__pyx_n_s_rules;
static PyObject *__pyx_n_s_s;
static PyObject *__pyx_kp_u_s_2;
static PyObject *__pyx_n_s_seg;
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_shape;
static PyObject *__pyx_n_s_size;
static PyObject *__pyx_n_s_size_spec;
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_kp_u_stroke_none;
static PyObject *__pyx_n_s_stroke_opacity;
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_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_sum;
static PyObject *__pyx_n_s_super;
static PyObject *__pyx_n_u_svg;
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_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_t2;
static PyObject *__pyx_n_s_t3;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_n_s_tl;
static PyObject *__pyx_n_s_to_css;
static PyObject *__pyx_n_s_to_float;
static PyObject *__pyx_n_s_total;
static PyObject *__pyx_n_s_total_extent;
static PyObject *__pyx_n_s_translate;
static PyObject *__pyx_n_s_translate_absolute;
static PyObject *__pyx_n_s_translate_relative;
static PyObject *__pyx_n_s_tx;
static PyObject *__pyx_n_s_ty;
static PyObject *__pyx_n_s_union;
static PyObject *__pyx_n_s_update;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_version;
static PyObject *__pyx_n_s_view_width;
static PyObject *__pyx_n_s_w;
static PyObject *__pyx_n_s_x;
static PyObject *__pyx_n_s_x0;
static PyObject *__pyx_n_s_x1;
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_ymax;
static PyObject *__pyx_n_s_ymin;
static PyObject *__pyx_n_s_zip;
static PyObject *__pyx_lambda_funcdef_7mathics_7builtin_8graphics_lambda8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_coords(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_2cut(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_4create_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_opacity); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_6_to_float(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8_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_10_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_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_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_absolute_size(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_12_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_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_15_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_17_bezier_derivative(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_19_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_21total_extent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_extents); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_23_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_25_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_10set_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_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct__apply_makeboxes(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_1_convert(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr(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_do_init(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_5_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_6__svg_bezier(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_7_path(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_8_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_9_heads(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_10_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_11_make_draw_svg(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_12_draw(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_13_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_14_make_draw_asy(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_15_draw(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_16_arrows(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_17_segments(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_18_genexpr(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_make_draw_svg(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_21_draw(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_22_make_draw_asy(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_23_draw(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_24_arrows(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_25__flatten(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_26___init__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_27_convert(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_28_create_style(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_float_0_0;
static PyObject *__pyx_float_0_5;
static PyObject *__pyx_float_1_0;
static PyObject *__pyx_float_0_04;
static PyObject *__pyx_float_0_005;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_5;
static PyObject *__pyx_int_9;
static PyObject *__pyx_int_18;
static PyObject *__pyx_int_400;
static PyObject *__pyx_int_100000000;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_int_neg_3;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_slice__5;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_slice__30;
static PyObject *__pyx_slice__33;
static PyObject *__pyx_slice__34;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__20;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__31;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__41;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__43;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__46;
static PyObject *__pyx_tuple__48;
static PyObject *__pyx_tuple__50;
static PyObject *__pyx_tuple__51;
static PyObject *__pyx_tuple__53;
static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__56;
static PyObject *__pyx_tuple__58;
static PyObject *__pyx_tuple__61;
static PyObject *__pyx_tuple__63;
static PyObject *__pyx_tuple__64;
static PyObject *__pyx_tuple__66;
static PyObject *__pyx_tuple__68;
static PyObject *__pyx_tuple__70;
static PyObject *__pyx_tuple__72;
static PyObject *__pyx_tuple__74;
static PyObject *__pyx_tuple__76;
static PyObject *__pyx_tuple__77;
static PyObject *__pyx_tuple__79;
static PyObject *__pyx_tuple__81;
static PyObject *__pyx_tuple__83;
static PyObject *__pyx_tuple__85;
static PyObject *__pyx_tuple__87;
static PyObject *__pyx_tuple__88;
static PyObject *__pyx_tuple__90;
static PyObject *__pyx_tuple__91;
static PyObject *__pyx_tuple__93;
static PyObject *__pyx_tuple__94;
static PyObject *__pyx_tuple__96;
static PyObject *__pyx_tuple__98;
static PyObject *__pyx_codeobj__7;
static PyObject *__pyx_codeobj__9;
static PyObject *__pyx_tuple__100;
static PyObject *__pyx_tuple__101;
static PyObject *__pyx_tuple__103;
static PyObject *__pyx_tuple__105;
static PyObject *__pyx_tuple__107;
static PyObject *__pyx_tuple__108;
static PyObject *__pyx_tuple__110;
static PyObject *__pyx_tuple__112;
static PyObject *__pyx_tuple__113;
static PyObject *__pyx_tuple__115;
static PyObject *__pyx_tuple__117;
static PyObject *__pyx_tuple__118;
static PyObject *__pyx_tuple__120;
static PyObject *__pyx_tuple__121;
static PyObject *__pyx_tuple__123;
static PyObject *__pyx_tuple__124;
static PyObject *__pyx_tuple__126;
static PyObject *__pyx_tuple__128;
static PyObject *__pyx_tuple__129;
static PyObject *__pyx_tuple__131;
static PyObject *__pyx_tuple__133;
static PyObject *__pyx_tuple__135;
static PyObject *__pyx_tuple__137;
static PyObject *__pyx_tuple__138;
static PyObject *__pyx_tuple__140;
static PyObject *__pyx_tuple__142;
static PyObject *__pyx_tuple__143;
static PyObject *__pyx_tuple__144;
static PyObject *__pyx_tuple__145;
static PyObject *__pyx_tuple__147;
static PyObject *__pyx_tuple__149;
static PyObject *__pyx_tuple__151;
static PyObject *__pyx_tuple__153;
static PyObject *__pyx_tuple__154;
static PyObject *__pyx_tuple__156;
static PyObject *__pyx_tuple__158;
static PyObject *__pyx_tuple__160;
static PyObject *__pyx_tuple__162;
static PyObject *__pyx_tuple__163;
static PyObject *__pyx_tuple__165;
static PyObject *__pyx_tuple__166;
static PyObject *__pyx_codeobj__12;
static PyObject *__pyx_codeobj__13;
static PyObject *__pyx_codeobj__15;
static PyObject *__pyx_codeobj__18;
static PyObject *__pyx_codeobj__19;
static PyObject *__pyx_codeobj__21;
static PyObject *__pyx_codeobj__24;
static PyObject *__pyx_codeobj__28;
static PyObject *__pyx_codeobj__29;
static PyObject *__pyx_codeobj__32;
static PyObject *__pyx_codeobj__36;
static PyObject *__pyx_codeobj__38;
static PyObject *__pyx_codeobj__40;
static PyObject *__pyx_codeobj__44;
static PyObject *__pyx_codeobj__49;
static PyObject *__pyx_codeobj__52;
static PyObject *__pyx_codeobj__55;
static PyObject *__pyx_codeobj__57;
static PyObject *__pyx_codeobj__59;
static PyObject *__pyx_codeobj__62;
static PyObject *__pyx_codeobj__65;
static PyObject *__pyx_codeobj__67;
static PyObject *__pyx_codeobj__69;
static PyObject *__pyx_codeobj__71;
static PyObject *__pyx_codeobj__73;
static PyObject *__pyx_codeobj__75;
static PyObject *__pyx_codeobj__78;
static PyObject *__pyx_codeobj__80;
static PyObject *__pyx_codeobj__82;
static PyObject *__pyx_codeobj__84;
static PyObject *__pyx_codeobj__86;
static PyObject *__pyx_codeobj__89;
static PyObject *__pyx_codeobj__92;
static PyObject *__pyx_codeobj__95;
static PyObject *__pyx_codeobj__97;
static PyObject *__pyx_codeobj__99;
static PyObject *__pyx_codeobj__102;
static PyObject *__pyx_codeobj__104;
static PyObject *__pyx_codeobj__106;
static PyObject *__pyx_codeobj__109;
static PyObject *__pyx_codeobj__111;
static PyObject *__pyx_codeobj__114;
static PyObject *__pyx_codeobj__116;
static PyObject *__pyx_codeobj__119;
static PyObject *__pyx_codeobj__122;
static PyObject *__pyx_codeobj__125;
static PyObject *__pyx_codeobj__127;
static PyObject *__pyx_codeobj__130;
static PyObject *__pyx_codeobj__132;
static PyObject *__pyx_codeobj__134;
static PyObject *__pyx_codeobj__136;
static PyObject *__pyx_codeobj__139;
static PyObject *__pyx_codeobj__141;
static PyObject *__pyx_codeobj__146;
static PyObject *__pyx_codeobj__148;
static PyObject *__pyx_codeobj__150;
static PyObject *__pyx_codeobj__152;
static PyObject *__pyx_codeobj__155;
static PyObject *__pyx_codeobj__157;
static PyObject *__pyx_codeobj__159;
static PyObject *__pyx_codeobj__161;
static PyObject *__pyx_codeobj__164;
/* Late includes */

/* "mathics/builtin/graphics.py":1413
 * 
 * style_options = system_symbols_dict(
 *     {"FontColor": _style, "ImageSizeMultipliers": (lambda *x: x[1])}             # <<<<<<<<<<<<<<
 * )
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_28lambda8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_28lambda8 = {"lambda8", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_28lambda8, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_28lambda8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda8 (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "lambda8", 0))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_x = __pyx_args;
  __pyx_r = __pyx_lambda_funcdef_7mathics_7builtin_8graphics_lambda8(__pyx_self, __pyx_v_x);

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

static PyObject *__pyx_lambda_funcdef_7mathics_7builtin_8graphics_lambda8(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("lambda8", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1413, __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.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":75
 * 
 * 
 * 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_1coords(PyObject *__pyx_self, PyObject *__pyx_v_value); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_1coords = {"coords", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_1coords, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_1coords(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_coords(__pyx_self, ((PyObject *)__pyx_v_value));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_coords(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":76
 * 
 * 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, 76, __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, 76, __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, 76, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":77
 * 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, 77, __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, 77, __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, 77, __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, 77, __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, 77, __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, 77, __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, 77, __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, 77, __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":78
 *     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":79
 *         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, 79, __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, 79, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":78
 *     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":80
 *         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, 80, __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":76
 * 
 * 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":81
 *             raise CoordinatesError
 *         return (x, y)
 *     raise CoordinatesError             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CoordinatesError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __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, 81, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":75
 * 
 * 
 * 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":85
 * 
 * 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, 85, __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, 85, __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, 85, __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":86
 * 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, 86, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":87
 *     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, 87, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":88
 *         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, 88, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":89
 *         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":90
 *         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, 90, __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, 90, __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, 90, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "mathics/builtin/graphics.py":91
 *         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, 91, __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, 91, __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, 91, __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, 91, __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, 91, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "mathics/builtin/graphics.py":92
 *             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, 92, __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, 92, __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":93
 *                 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, 93, __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, 93, __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, 93, __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, 93, __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, 93, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "mathics/builtin/graphics.py":92
 *             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":95
 *                     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, 95, __pyx_L1_error)
      }
      __pyx_L5:;

      /* "mathics/builtin/graphics.py":90
 *         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":97
 *                     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, 97, __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, 97, __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, 97, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_L4:;

    /* "mathics/builtin/graphics.py":89
 *         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":85
 * 
 * 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":99
 *                 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":100
 * 
 *     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, 100, __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, 100, __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, 100, __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, 100, __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":101
 *     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, 101, __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, 101, __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, 101, __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, 101, __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, 101, __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, 101, __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, 101, __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":102
 *         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, 102, __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":103
 *         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, 103, __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, 103, __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, 103, __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, 103, __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":104
 *         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, 104, __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, 104, __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, 104, __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, 104, __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, 104, __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, 104, __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, 104, __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":102
 *         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":105
 *             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":99
 *                 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":107
 *         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, 107, __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, 107, __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, 107, __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, 107, __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":108
 * 
 *     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, 108, __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, 108, __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, 108, __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, 108, __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, 108, __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, 108, __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, 108, __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":109
 *     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, 109, __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, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __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, 109, __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, 109, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 109, __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, 109, __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, 109, __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":107
 *         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":112
 * 
 * 
 * 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_3cut(PyObject *__pyx_self, PyObject *__pyx_v_value); /*proto*/
static char __pyx_doc_7mathics_7builtin_8graphics_2cut[] = "Cut values in graphics primitives (not displayed otherwise in SVG)";
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_3cut = {"cut", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_3cut, METH_O, __pyx_doc_7mathics_7builtin_8graphics_2cut};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_3cut(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_2cut(__pyx_self, ((PyObject *)__pyx_v_value));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_2cut(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":114
 * 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":115
 *     "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, 115, __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, 115, __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, 115, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":116
 *     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, 116, __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":115
 *     "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":117
 *     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, 117, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 117, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":118
 *         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":117
 *     if value < -border:
 *         value = -border
 *     elif value > border:             # <<<<<<<<<<<<<<
 *         value = border
 *     return value
 */
  }
  __pyx_L3:;

  /* "mathics/builtin/graphics.py":119
 *     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":112
 * 
 * 
 * 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":122
 * 
 * 
 * def create_css(             # <<<<<<<<<<<<<<
 *     edge_color=None, face_color=None, stroke_width=None, font_color=None, opacity=1.0
 * ):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5create_css(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_5create_css = {"create_css", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_5create_css, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5create_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;
  PyObject *__pyx_v_opacity = 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,&__pyx_n_s_opacity,0};
    PyObject* values[5] = {0,0,0,0,0};

    /* "mathics/builtin/graphics.py":123
 * 
 * def create_css(
 *     edge_color=None, face_color=None, stroke_width=None, font_color=None, opacity=1.0             # <<<<<<<<<<<<<<
 * ):
 *     css = []
 */
    values[0] = ((PyObject *)((PyObject *)Py_None));
    values[1] = ((PyObject *)((PyObject *)Py_None));
    values[2] = ((PyObject *)((PyObject *)Py_None));
    values[3] = ((PyObject *)((PyObject *)Py_None));
    values[4] = ((PyObject *)((PyObject*)__pyx_float_1_0));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_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--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_opacity);
          if (value) { values[4] = 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, 122, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_edge_color = values[0];
    __pyx_v_face_color = values[1];
    __pyx_v_stroke_width = values[2];
    __pyx_v_font_color = values[3];
    __pyx_v_opacity = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create_css", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 122, __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_4create_css(__pyx_self, __pyx_v_edge_color, __pyx_v_face_color, __pyx_v_stroke_width, __pyx_v_font_color, __pyx_v_opacity);

  /* "mathics/builtin/graphics.py":122
 * 
 * 
 * def create_css(             # <<<<<<<<<<<<<<
 *     edge_color=None, face_color=None, stroke_width=None, font_color=None, opacity=1.0
 * ):
 */

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_4create_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_opacity) {
  PyObject *__pyx_v_css = NULL;
  PyObject *__pyx_v_color = NULL;
  PyObject *__pyx_v_stroke_opacity = NULL;
  PyObject *__pyx_v_fill_opacity = NULL;
  CYTHON_UNUSED PyObject *__pyx_v__ = 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":125
 *     edge_color=None, face_color=None, stroke_width=None, font_color=None, opacity=1.0
 * ):
 *     css = []             # <<<<<<<<<<<<<<
 *     if edge_color is not None:
 *         color, stroke_opacity = edge_color.to_css()
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_css = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":126
 * ):
 *     css = []
 *     if edge_color is not None:             # <<<<<<<<<<<<<<
 *         color, stroke_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":127
 *     css = []
 *     if edge_color is not None:
 *         color, stroke_opacity = edge_color.to_css()             # <<<<<<<<<<<<<<
 *         css.append("stroke: %s" % color)
 *         css.append("stroke-opacity: %s" % stroke_opacity)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_edge_color, __pyx_n_s_to_css); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __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, 127, __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, 127, __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, 127, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 127, __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, 127, __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, 127, __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, 127, __pyx_L1_error)
      __pyx_L5_unpacking_done:;
    }
    __pyx_v_color = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_v_stroke_opacity = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":128
 *     if edge_color is not None:
 *         color, stroke_opacity = edge_color.to_css()
 *         css.append("stroke: %s" % color)             # <<<<<<<<<<<<<<
 *         css.append("stroke-opacity: %s" % stroke_opacity)
 *     else:
 */
    __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_stroke_s, __pyx_v_color); 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":129
 *         color, stroke_opacity = edge_color.to_css()
 *         css.append("stroke: %s" % color)
 *         css.append("stroke-opacity: %s" % stroke_opacity)             # <<<<<<<<<<<<<<
 *     else:
 *         css.append("stroke: none")
 */
    __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_stroke_opacity_s, __pyx_v_stroke_opacity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __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, 129, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":126
 * ):
 *     css = []
 *     if edge_color is not None:             # <<<<<<<<<<<<<<
 *         color, stroke_opacity = edge_color.to_css()
 *         css.append("stroke: %s" % color)
 */
    goto __pyx_L3;
  }

  /* "mathics/builtin/graphics.py":131
 *         css.append("stroke-opacity: %s" % stroke_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, 131, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "mathics/builtin/graphics.py":132
 *     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":133
 *         css.append("stroke: none")
 *     if stroke_width is not None:
 *         css.append("stroke-width: %fpx" % stroke_width)             # <<<<<<<<<<<<<<
 *     if face_color is not None:
 *         color, fill_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, 133, __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, 133, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":132
 *     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":134
 *     if stroke_width is not None:
 *         css.append("stroke-width: %fpx" % stroke_width)
 *     if face_color is not None:             # <<<<<<<<<<<<<<
 *         color, fill_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":135
 *         css.append("stroke-width: %fpx" % stroke_width)
 *     if face_color is not None:
 *         color, fill_opacity = face_color.to_css()             # <<<<<<<<<<<<<<
 *         css.append("fill: %s" % color)
 *         css.append("fill-opacity: %s" % fill_opacity)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_face_color, __pyx_n_s_to_css); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 135, __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, 135, __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, 135, __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, 135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 135, __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, 135, __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, 135, __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, 135, __pyx_L1_error)
      __pyx_L9_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_color, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_v_fill_opacity = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":136
 *     if face_color is not None:
 *         color, fill_opacity = face_color.to_css()
 *         css.append("fill: %s" % color)             # <<<<<<<<<<<<<<
 *         css.append("fill-opacity: %s" % fill_opacity)
 *     else:
 */
    __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_fill_s, __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __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, 136, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":137
 *         color, fill_opacity = face_color.to_css()
 *         css.append("fill: %s" % color)
 *         css.append("fill-opacity: %s" % fill_opacity)             # <<<<<<<<<<<<<<
 *     else:
 *         css.append("fill: none")
 */
    __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_fill_opacity_s, __pyx_v_fill_opacity); 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":134
 *     if stroke_width is not None:
 *         css.append("stroke-width: %fpx" % stroke_width)
 *     if face_color is not None:             # <<<<<<<<<<<<<<
 *         color, fill_opacity = face_color.to_css()
 *         css.append("fill: %s" % color)
 */
    goto __pyx_L7;
  }

  /* "mathics/builtin/graphics.py":139
 *         css.append("fill-opacity: %s" % fill_opacity)
 *     else:
 *         css.append("fill: none")             # <<<<<<<<<<<<<<
 *     if font_color is not None:
 *         color, _ = 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, 139, __pyx_L1_error)
  }
  __pyx_L7:;

  /* "mathics/builtin/graphics.py":140
 *     else:
 *         css.append("fill: none")
 *     if font_color is not None:             # <<<<<<<<<<<<<<
 *         color, _ = 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":141
 *         css.append("fill: none")
 *     if font_color is not None:
 *         color, _ = font_color.to_css()             # <<<<<<<<<<<<<<
 *         css.append("color: %s" % color)
 *     css.append("opacity: %s" % opacity)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_font_color, __pyx_n_s_to_css); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 141, __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, 141, __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, 141, __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, 141, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __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, 141, __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, 141, __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, 141, __pyx_L1_error)
      __pyx_L12_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_color, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_v__ = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":142
 *     if font_color is not None:
 *         color, _ = font_color.to_css()
 *         css.append("color: %s" % color)             # <<<<<<<<<<<<<<
 *     css.append("opacity: %s" % opacity)
 *     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, 142, __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, 142, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

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

  /* "mathics/builtin/graphics.py":143
 *         color, _ = font_color.to_css()
 *         css.append("color: %s" % color)
 *     css.append("opacity: %s" % opacity)             # <<<<<<<<<<<<<<
 *     return "; ".join(css)
 * 
 */
  __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_opacity_s, __pyx_v_opacity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __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, 143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":144
 *         css.append("color: %s" % color)
 *     css.append("opacity: %s" % opacity)
 *     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, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":122
 * 
 * 
 * def create_css(             # <<<<<<<<<<<<<<
 *     edge_color=None, face_color=None, stroke_width=None, font_color=None, opacity=1.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.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_stroke_opacity);
  __Pyx_XDECREF(__pyx_v_fill_opacity);
  __Pyx_XDECREF(__pyx_v__);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_7_to_float(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_7_to_float = {"_to_float", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_7_to_float, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_7_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_6_to_float(__pyx_self, ((PyObject *)__pyx_v_x));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_6_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":148
 * 
 * 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, 148, __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, 148, __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":149
 * 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":150
 *     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, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 150, __pyx_L1_error)

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

  /* "mathics/builtin/graphics.py":151
 *     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":147
 * 
 * 
 * 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":154
 * 
 * 
 * def _data_and_options(leaves, defined_options):             # <<<<<<<<<<<<<<
 *     data = []
 *     options = defined_options.copy()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_9_data_and_options(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_9_data_and_options = {"_data_and_options", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_9_data_and_options, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_9_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, 154, __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, 154, __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, 154, __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_8_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_8_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":155
 * 
 * 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, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_data = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":156
 * 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, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_options = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":157
 *     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, 157, __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, 157, __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, 157, __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, 157, __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, 157, __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, 157, __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, 157, __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":158
 *     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, 158, __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, 158, __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, 158, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_7) {

      /* "mathics/builtin/graphics.py":159
 *     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, 159, __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, 159, __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":160
 *         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, 160, __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, 160, __pyx_L1_error)

        /* "mathics/builtin/graphics.py":159
 *     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":161
 *             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, 161, __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, 161, __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, 161, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 161, __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, 161, __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, 161, __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, 161, __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":162
 *                 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, 162, __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, 162, __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":163
 *             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, 163, __pyx_L1_error)
      if (__pyx_t_7) {

        /* "mathics/builtin/graphics.py":164
 *             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, 164, __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, 164, __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":163
 *             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":165
 *             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, 165, __pyx_L1_error)
      if (likely(__pyx_t_7)) {

        /* "mathics/builtin/graphics.py":166
 *                 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, 166, __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, 166, __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, 166, __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":165
 *             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":168
 *                 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, 168, __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, 168, __pyx_L1_error)
      }
      __pyx_L9:;

      /* "mathics/builtin/graphics.py":169
 *             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, 169, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":158
 *     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":171
 *             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, 171, __pyx_L1_error)
    }
    __pyx_L5:;

    /* "mathics/builtin/graphics.py":157
 *     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":172
 *         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, 172, __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":154
 * 
 * 
 * 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":175
 * 
 * 
 * def _extract_graphics(graphics, format, evaluation):             # <<<<<<<<<<<<<<
 *     graphics_box = Expression(SymbolMakeBoxes, graphics).evaluate(evaluation)
 *     # builtin = GraphicsBox(expression=False)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11_extract_graphics(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_11_extract_graphics = {"_extract_graphics", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_11_extract_graphics, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11_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, 175, __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, 175, __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, 175, __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, 175, __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_10_extract_graphics(__pyx_self, __pyx_v_graphics, __pyx_v_format, __pyx_v_evaluation);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_10_extract_graphics(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_format, PyObject *__pyx_v_evaluation) {
  PyObject *__pyx_v_graphics_box = NULL;
  PyObject *__pyx_v_elements = 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_format_fn = 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;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_extract_graphics", 0);

  /* "mathics/builtin/graphics.py":176
 * 
 * def _extract_graphics(graphics, format, evaluation):
 *     graphics_box = Expression(SymbolMakeBoxes, graphics).evaluate(evaluation)             # <<<<<<<<<<<<<<
 *     # builtin = GraphicsBox(expression=False)
 *     elements, calc_dimensions = graphics_box._prepare_elements(
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Expression); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SymbolMakeBoxes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 176, __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_graphics};
    __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, 176, __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_graphics};
    __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, 176, __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, 176, __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_graphics);
    __Pyx_GIVEREF(__pyx_v_graphics);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_graphics);
    __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, 176, __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_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_evaluate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 176, __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, 176, __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":178
 *     graphics_box = Expression(SymbolMakeBoxes, graphics).evaluate(evaluation)
 *     # builtin = GraphicsBox(expression=False)
 *     elements, calc_dimensions = graphics_box._prepare_elements(             # <<<<<<<<<<<<<<
 *         graphics_box.leaves, {"evaluation": evaluation}, neg_y=True
 *     )
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_graphics_box, __pyx_n_s_prepare_elements); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "mathics/builtin/graphics.py":179
 *     # builtin = GraphicsBox(expression=False)
 *     elements, calc_dimensions = graphics_box._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, 179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_evaluation, __pyx_v_evaluation) < 0) __PYX_ERR(0, 179, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":178
 *     graphics_box = Expression(SymbolMakeBoxes, graphics).evaluate(evaluation)
 *     # builtin = GraphicsBox(expression=False)
 *     elements, calc_dimensions = graphics_box._prepare_elements(             # <<<<<<<<<<<<<<
 *         graphics_box.leaves, {"evaluation": evaluation}, neg_y=True
 *     )
 */
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 178, __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_2);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
  __pyx_t_3 = 0;
  __pyx_t_2 = 0;

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

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

  /* "mathics/builtin/graphics.py":181
 *         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_7 = __pyx_v_calc_dimensions; __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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, 181, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 3); 
      __pyx_t_5 = 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_7 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 3); 
      __pyx_t_5 = 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_7);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    __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_7,&__pyx_t_2,&__pyx_t_1,&__pyx_t_4,&__pyx_t_5,&__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, 181, __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_7,&__pyx_t_2,&__pyx_t_1,&__pyx_t_4,&__pyx_t_5,&__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, 181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = Py_TYPE(__pyx_t_12)->tp_iternext;
    for (index=0; index < 8; index++) {
      PyObject* item = __pyx_t_8(__pyx_t_12); if (unlikely(!item)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_12), 8) < 0) __PYX_ERR(0, 181, __pyx_L1_error)
    __pyx_t_8 = 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_8 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 181, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_xmin = __pyx_t_7;
  __pyx_t_7 = 0;
  __pyx_v_xmax = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_ymin = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_ymax = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v__ = __pyx_t_5;
  __pyx_t_5 = 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":190
 *     # coordinate space.
 * 
 *     ex = elements.extent_width             # <<<<<<<<<<<<<<
 *     ey = elements.extent_height
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_elements, __pyx_n_s_extent_width); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_ex = __pyx_t_3;
  __pyx_t_3 = 0;

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

  /* "mathics/builtin/graphics.py":193
 *     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, 193, __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, 193, __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":194
 * 
 *     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, 194, __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, 194, __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":196
 *     sy = (ymax - ymin) / ey
 * 
 *     ox = -elements.xmin * sx + xmin             # <<<<<<<<<<<<<<
 *     oy = -elements.ymin * sy + ymin
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_elements, __pyx_n_s_xmin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 196, __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, 196, __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, 196, __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":197
 * 
 *     ox = -elements.xmin * sx + xmin
 *     oy = -elements.ymin * sy + ymin             # <<<<<<<<<<<<<<
 * 
 *     # generate code for svg or asy.
 */
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_elements, __pyx_n_s_ymin); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_3 = PyNumber_Negative(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __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, 197, __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, 197, __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":201
 *     # generate code for svg or asy.
 * 
 *     if format in ("asy", "svg"):             # <<<<<<<<<<<<<<
 *         format_fn = lookup_method(elements, format)
 *         code = format_fn(elements)
 */
  __Pyx_INCREF(__pyx_v_format);
  __pyx_t_3 = __pyx_v_format;
  __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_asy, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 201, __pyx_L1_error)
  if (!__pyx_t_14) {
  } else {
    __pyx_t_13 = __pyx_t_14;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_svg, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 201, __pyx_L1_error)
  __pyx_t_13 = __pyx_t_14;
  __pyx_L8_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_14 = (__pyx_t_13 != 0);
  if (likely(__pyx_t_14)) {

    /* "mathics/builtin/graphics.py":202
 * 
 *     if format in ("asy", "svg"):
 *         format_fn = lookup_method(elements, format)             # <<<<<<<<<<<<<<
 *         code = format_fn(elements)
 *     else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_lookup_method); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 202, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_10 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(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_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_11)) {
      PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_elements, __pyx_v_format};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
      PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_elements, __pyx_v_format};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 202, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_10) {
        __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); __pyx_t_10 = NULL;
      }
      __Pyx_INCREF(__pyx_v_elements);
      __Pyx_GIVEREF(__pyx_v_elements);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_6, __pyx_v_elements);
      __Pyx_INCREF(__pyx_v_format);
      __Pyx_GIVEREF(__pyx_v_format);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_6, __pyx_v_format);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_v_format_fn = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":203
 *     if format in ("asy", "svg"):
 *         format_fn = lookup_method(elements, format)
 *         code = format_fn(elements)             # <<<<<<<<<<<<<<
 *     else:
 *         raise NotImplementedError
 */
    __Pyx_INCREF(__pyx_v_format_fn);
    __pyx_t_11 = __pyx_v_format_fn; __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_11, function);
      }
    }
    __pyx_t_3 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_9, __pyx_v_elements) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_v_elements);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __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":201
 *     # generate code for svg or asy.
 * 
 *     if format in ("asy", "svg"):             # <<<<<<<<<<<<<<
 *         format_fn = lookup_method(elements, format)
 *         code = format_fn(elements)
 */
    goto __pyx_L7;
  }

  /* "mathics/builtin/graphics.py":205
 *         code = format_fn(elements)
 *     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, 205, __pyx_L1_error)
  }
  __pyx_L7:;

  /* "mathics/builtin/graphics.py":207
 *         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, 207, __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":175
 * 
 * 
 * def _extract_graphics(graphics, format, evaluation):             # <<<<<<<<<<<<<<
 *     graphics_box = Expression(SymbolMakeBoxes, 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_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("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_elements);
  __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_format_fn);
  __Pyx_XDECREF(__pyx_v_code);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":223
 *     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, 223, __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, 223, __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, 223, __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, 223, __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, 223, __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;
  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;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  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":226
 *         """Show[graphics_, OptionsPattern[%(name)s]]"""
 * 
 *         for option in options:             # <<<<<<<<<<<<<<
 *             if option not in ("System`ImageSize",):
 *                 options[option] = Expression(SymbolN, options[option]).evaluate(
 */
  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, 226, __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, 226, __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, 226, __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, 226, __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, 226, __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, 226, __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, 226, __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":227
 * 
 *         for option in options:
 *             if option not in ("System`ImageSize",):             # <<<<<<<<<<<<<<
 *                 options[option] = Expression(SymbolN, 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, 227, __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":228
 *         for option in options:
 *             if option not in ("System`ImageSize",):
 *                 options[option] = Expression(SymbolN, options[option]).evaluate(             # <<<<<<<<<<<<<<
 *                     evaluation
 *                 )
 */
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Expression); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_SymbolN); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_v_options, __pyx_v_option); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = NULL;
      __pyx_t_12 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_12 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_8)) {
        PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_9, __pyx_t_10};
        __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 228, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
        PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_9, __pyx_t_10};
        __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 228, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      } else
      #endif
      {
        __pyx_t_13 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 228, __pyx_L1_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_GIVEREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_12, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_12, __pyx_t_10);
        __pyx_t_9 = 0;
        __pyx_t_10 = 0;
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_13, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 228, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 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, 228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "mathics/builtin/graphics.py":229
 *             if option not in ("System`ImageSize",):
 *                 options[option] = Expression(SymbolN, options[option]).evaluate(
 *                     evaluation             # <<<<<<<<<<<<<<
 *                 )
 * 
 */
      __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, 228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "mathics/builtin/graphics.py":228
 *         for option in options:
 *             if option not in ("System`ImageSize",):
 *                 options[option] = Expression(SymbolN, options[option]).evaluate(             # <<<<<<<<<<<<<<
 *                     evaluation
 *                 )
 */
      if (unlikely(PyObject_SetItem(__pyx_v_options, __pyx_v_option, __pyx_t_4) < 0)) __PYX_ERR(0, 228, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

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

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

  /* "mathics/builtin/graphics.py":233
 * 
 *         # 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, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_new_leaves = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":234
 *         # The below could probably be done with graphics.filter..
 *         new_leaves = []
 *         options_set = set(options.keys())             # <<<<<<<<<<<<<<
 *         for leaf in graphics.leaves:
 *             leaf_name = leaf.get_head_name()
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s_keys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __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, 234, __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, 234, __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":235
 *         new_leaves = []
 *         options_set = set(options.keys())
 *         for leaf in graphics.leaves:             # <<<<<<<<<<<<<<
 *             leaf_name = leaf.get_head_name()
 *             if leaf_name == "System`Rule" and str(leaf.leaves[0]) in options_set:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_graphics, __pyx_n_s_leaves); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 235, __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, 235, __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, 235, __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, 235, __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, 235, __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, 235, __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, 235, __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, 235, __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":236
 *         options_set = set(options.keys())
 *         for leaf in graphics.leaves:
 *             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, 236, __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, 236, __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":237
 *         for leaf in graphics.leaves:
 *             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, 237, __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, 237, __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, 237, __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, 237, __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, 237, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_14 = (__pyx_t_5 != 0);
    __pyx_t_6 = __pyx_t_14;
    __pyx_L9_bool_binop_done:;
    if (__pyx_t_6) {

      /* "mathics/builtin/graphics.py":238
 *             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":237
 *         for leaf in graphics.leaves:
 *             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":239
 *             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_15 = __Pyx_PyObject_Append(__pyx_v_new_leaves, __pyx_v_leaf); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 239, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":235
 *         new_leaves = []
 *         options_set = set(options.keys())
 *         for leaf in graphics.leaves:             # <<<<<<<<<<<<<<
 *             leaf_name = leaf.get_head_name()
 *             if leaf_name == "System`Rule" and str(leaf.leaves[0]) in options_set:
 */
    __pyx_L6_continue:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":241
 *             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, 241, __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, 241, __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, 241, __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":242
 * 
 *         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, 242, __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, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = NULL;
  __pyx_t_12 = 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_12 = 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_12, 3+__pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __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_12, 3+__pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __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_13 = PyTuple_New(3+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    if (__pyx_t_7) {
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_7); __pyx_t_7 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_12, __pyx_t_8);
    __Pyx_INCREF(__pyx_v_new_leaves);
    __Pyx_GIVEREF(__pyx_v_new_leaves);
    PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_12, __pyx_v_new_leaves);
    __Pyx_INCREF(__pyx_v_evaluation);
    __Pyx_GIVEREF(__pyx_v_evaluation);
    PyTuple_SET_ITEM(__pyx_t_13, 2+__pyx_t_12, __pyx_v_evaluation);
    __pyx_t_8 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 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":244
 *         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":223
 *     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_11);
  __Pyx_XDECREF(__pyx_t_13);
  __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_leaf_name);
  __Pyx_XDECREF(__pyx_v_graphics);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":297
 *     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, 297, __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, 297, __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, 297, __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, 297, __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, 297, __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":301
 *         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_2generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":319
 *                 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_2_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2_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_1_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_2generator5, 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, 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.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_2generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  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, 319, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":320
 *                     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, 320, __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, 320, __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, 320, __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, 320, __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, 320, __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, 320, __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, 320, __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, 320, __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":318
 *                 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, 318, __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, 318, __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":319
 *                 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, 319, __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, 319, __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, 319, __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, 319, __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":317
 *                     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":319
 *                 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":320
 *                     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":317
 *                     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":319
 *                 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":320
 *                     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":319
 *                 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_5generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":336
 *                     else:
 *                         n_leaves = (
 *                             Expression(SymbolN, 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_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, 336, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_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_5generator6, 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, 336, __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_5generator6(__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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_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, 336, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":337
 *                         n_leaves = (
 *                             Expression(SymbolN, 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, 337, __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, 337, __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, 337, __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, 337, __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, 337, __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, 337, __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, 337, __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, 337, __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, 337, __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":336
 *                     else:
 *                         n_leaves = (
 *                             Expression(SymbolN, 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, 336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_SymbolN); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_9 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_7, __pyx_cur_scope->__pyx_v_leaf};
      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_5);
      __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[3] = {__pyx_t_8, __pyx_t_7, __pyx_cur_scope->__pyx_v_leaf};
      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    {
      __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 336, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_7);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_leaf);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_leaf);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_cur_scope->__pyx_v_leaf);
      __pyx_t_7 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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, 336, __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, 336, __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, 336, __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, 336, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":337
 *                         n_leaves = (
 *                             Expression(SymbolN, 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":336
 *                     else:
 *                         n_leaves = (
 *                             Expression(SymbolN, 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_8);
  __Pyx_XDECREF(__pyx_t_10);
  __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":301
 *         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_1_convert *__pyx_cur_scope;
  PyObject *__pyx_v_head = NULL;
  PyObject *__pyx_v_inset = NULL;
  PyObject *__pyx_v_opts = NULL;
  PyObject *__pyx_v_n_leaves = NULL;
  PyObject *__pyx_7genexpr__pyx_v_item = NULL;
  PyObject *__pyx_8genexpr1__pyx_v_item = NULL;
  PyObject *__pyx_8genexpr3__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;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  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_1_convert *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_1_convert(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_1_convert, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_convert *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 301, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct__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":302
 * 
 *         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, 302, __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, 302, __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":304
 *             head = content.get_head_name()
 * 
 *             if head == "System`List":             # <<<<<<<<<<<<<<
 *                 return Expression(
 *                     SymbolList, *[convert(item) for item in content.leaves]
 */
  __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, 304, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "mathics/builtin/graphics.py":305
 * 
 *             if head == "System`List":
 *                 return Expression(             # <<<<<<<<<<<<<<
 *                     SymbolList, *[convert(item) for item in content.leaves]
 *                 )
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Expression); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "mathics/builtin/graphics.py":306
 *             if head == "System`List":
 *                 return Expression(
 *                     SymbolList, *[convert(item) for item in content.leaves]             # <<<<<<<<<<<<<<
 *                 )
 *             elif head == "System`Style":
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SymbolList); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "mathics/builtin/graphics.py":305
 * 
 *             if head == "System`List":
 *                 return Expression(             # <<<<<<<<<<<<<<
 *                     SymbolList, *[convert(item) for item in content.leaves]
 *                 )
 */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __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;
    { /* enter inner scope */

      /* "mathics/builtin/graphics.py":306
 *             if head == "System`List":
 *                 return Expression(
 *                     SymbolList, *[convert(item) for item in content.leaves]             # <<<<<<<<<<<<<<
 *                 )
 *             elif head == "System`Style":
 */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_content, __pyx_n_s_leaves); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __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, 306, __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, 306, __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, 306, __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, 306, __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, 306, __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, 306, __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, 306, __pyx_L6_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_5);
        }
        __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_item, __pyx_t_5);
        __pyx_t_5 = 0;
        if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_convert)) { __Pyx_RaiseClosureNameError("convert"); __PYX_ERR(0, 306, __pyx_L6_error) }
        __pyx_t_5 = __pyx_pf_7mathics_7builtin_8graphics_8Graphics_15apply_makeboxes_convert(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_convert, __pyx_7genexpr__pyx_v_item); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 306, __pyx_L6_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_item); __pyx_7genexpr__pyx_v_item = 0;
      goto __pyx_L9_exit_scope;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_item); __pyx_7genexpr__pyx_v_item = 0;
      goto __pyx_L1_error;
      __pyx_L9_exit_scope:;
    } /* exit inner scope */

    /* "mathics/builtin/graphics.py":305
 * 
 *             if head == "System`List":
 *                 return Expression(             # <<<<<<<<<<<<<<
 *                     SymbolList, *[convert(item) for item in content.leaves]
 *                 )
 */
    __pyx_t_6 = PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 305, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 305, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

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

  /* "mathics/builtin/graphics.py":308
 *                     SymbolList, *[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, 308, __pyx_L1_error)
  if (__pyx_t_4) {

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

      /* "mathics/builtin/graphics.py":310
 *             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, 310, __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, 310, __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_7 = 0;
        __pyx_t_8 = NULL;
      } else {
        __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 310, __pyx_L12_error)
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            if (__pyx_t_7 >= 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_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 310, __pyx_L12_error)
            #else
            __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_1);
            #endif
          } else {
            if (__pyx_t_7 >= 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_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 310, __pyx_L12_error)
            #else
            __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_1);
            #endif
          }
        } else {
          __pyx_t_1 = __pyx_t_8(__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, 310, __pyx_L12_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr1__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, 310, __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_8genexpr1__pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_1);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 310, __pyx_L12_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_item); __pyx_8genexpr1__pyx_v_item = 0;
      goto __pyx_L15_exit_scope;
      __pyx_L12_error:;
      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_item); __pyx_8genexpr1__pyx_v_item = 0;
      goto __pyx_L1_error;
      __pyx_L15_exit_scope:;
    } /* exit inner scope */

    /* "mathics/builtin/graphics.py":309
 *                 )
 *             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, 309, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Add(__pyx_tuple__4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 309, __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_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 309, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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":308
 *                     SymbolList, *[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":313
 *                 )
 * 
 *             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, 313, __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, 313, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_9 = (__pyx_t_4 != 0);
  if (__pyx_t_9) {

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

      /* "mathics/builtin/graphics.py":315
 *             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":314
 * 
 *             if head in element_heads:
 *                 if head == "System`Text":             # <<<<<<<<<<<<<<
 *                     head = "System`Inset"
 *                 atoms = content.get_atoms(include_heads=False)
 */
    }

    /* "mathics/builtin/graphics.py":316
 *                 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, 316, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __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, 316, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 316, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_cur_scope->__pyx_v_atoms = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "mathics/builtin/graphics.py":319
 *                 if any(
 *                     not isinstance(atom, (Integer, Real))
 *                     and not atom.get_name() in GRAPHICS_SYMBOLS             # <<<<<<<<<<<<<<
 *                     for atom in atoms
 *                 ):
 */
    __pyx_t_6 = __pyx_pf_7mathics_7builtin_8graphics_8Graphics_15apply_makeboxes_7convert_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 319, __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, 319, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 319, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":317
 *                     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_9) {

      /* "mathics/builtin/graphics.py":322
 *                     for atom in atoms
 *                 ):
 *                     if head == "System`Inset":             # <<<<<<<<<<<<<<
 *                         inset = content.leaves[0]
 *                         if inset.get_head_name() == "System`Graphics":
 */
      __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_head, __pyx_kp_u_System_Inset, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 322, __pyx_L1_error)
      if (__pyx_t_9) {

        /* "mathics/builtin/graphics.py":323
 *                 ):
 *                     if head == "System`Inset":
 *                         inset = content.leaves[0]             # <<<<<<<<<<<<<<
 *                         if inset.get_head_name() == "System`Graphics":
 *                             opts = {}
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_content, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 323, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_v_inset = __pyx_t_6;
        __pyx_t_6 = 0;

        /* "mathics/builtin/graphics.py":324
 *                     if head == "System`Inset":
 *                         inset = content.leaves[0]
 *                         if inset.get_head_name() == "System`Graphics":             # <<<<<<<<<<<<<<
 *                             opts = {}
 *                             # opts = dict(opt._leaves[0].name:opt_leaves[1]   for opt in  inset._leaves[1:])
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_inset, __pyx_n_s_get_head_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __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_6 = (__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_6)) __PYX_ERR(0, 324, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_kp_u_System_Graphics, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 324, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_9) {

          /* "mathics/builtin/graphics.py":325
 *                         inset = content.leaves[0]
 *                         if inset.get_head_name() == "System`Graphics":
 *                             opts = {}             # <<<<<<<<<<<<<<
 *                             # opts = dict(opt._leaves[0].name:opt_leaves[1]   for opt in  inset._leaves[1:])
 *                             inset = self.apply_makeboxes(
 */
          __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 325, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_v_opts = ((PyObject*)__pyx_t_6);
          __pyx_t_6 = 0;

          /* "mathics/builtin/graphics.py":327
 *                             opts = {}
 *                             # opts = dict(opt._leaves[0].name:opt_leaves[1]   for opt in  inset._leaves[1:])
 *                             inset = self.apply_makeboxes(             # <<<<<<<<<<<<<<
 *                                 inset._leaves[0], evaluation, opts
 *                             )
 */
          if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 327, __pyx_L1_error) }
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_apply_makeboxes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);

          /* "mathics/builtin/graphics.py":328
 *                             # opts = dict(opt._leaves[0].name:opt_leaves[1]   for opt in  inset._leaves[1:])
 *                             inset = self.apply_makeboxes(
 *                                 inset._leaves[0], evaluation, opts             # <<<<<<<<<<<<<<
 *                             )
 *                         n_leaves = [inset] + [
 */
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_inset, __pyx_n_s_leaves_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 328, __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, 328, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_evaluation)) { __Pyx_RaiseClosureNameError("evaluation"); __PYX_ERR(0, 328, __pyx_L1_error) }
          __pyx_t_3 = NULL;
          __pyx_t_10 = 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_10 = 1;
            }
          }
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_2)) {
            PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_t_1, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_evaluation, __pyx_v_opts};
            __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 327, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
            PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_t_1, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_evaluation, __pyx_v_opts};
            __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 327, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          } else
          #endif
          {
            __pyx_t_5 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 327, __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_GIVEREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_10, __pyx_t_1);
            __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_evaluation);
            __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_evaluation);
            PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_10, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_evaluation);
            __Pyx_INCREF(__pyx_v_opts);
            __Pyx_GIVEREF(__pyx_v_opts);
            PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_10, __pyx_v_opts);
            __pyx_t_1 = 0;
            __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 327, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF_SET(__pyx_v_inset, __pyx_t_6);
          __pyx_t_6 = 0;

          /* "mathics/builtin/graphics.py":324
 *                     if head == "System`Inset":
 *                         inset = content.leaves[0]
 *                         if inset.get_head_name() == "System`Graphics":             # <<<<<<<<<<<<<<
 *                             opts = {}
 *                             # opts = dict(opt._leaves[0].name:opt_leaves[1]   for opt in  inset._leaves[1:])
 */
        }

        /* "mathics/builtin/graphics.py":330
 *                                 inset._leaves[0], evaluation, opts
 *                             )
 *                         n_leaves = [inset] + [             # <<<<<<<<<<<<<<
 *                             Expression(SymbolN, leaf).evaluate(evaluation)
 *                             for leaf in content.leaves[1:]
 */
        __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 330, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_v_inset);
        __Pyx_GIVEREF(__pyx_v_inset);
        PyList_SET_ITEM(__pyx_t_6, 0, __pyx_v_inset);
        { /* enter inner scope */
          __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L23_error)
          __Pyx_GOTREF(__pyx_t_2);

          /* "mathics/builtin/graphics.py":332
 *                         n_leaves = [inset] + [
 *                             Expression(SymbolN, leaf).evaluate(evaluation)
 *                             for leaf in content.leaves[1:]             # <<<<<<<<<<<<<<
 *                         ]
 *                     else:
 */
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_content, __pyx_n_s_leaves); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L23_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_5, 1, 0, NULL, NULL, &__pyx_slice__5, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L23_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          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_7 = 0;
            __pyx_t_8 = NULL;
          } else {
            __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L23_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __pyx_L23_error)
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 332, __pyx_L23_error)
                #else
                __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L23_error)
                __Pyx_GOTREF(__pyx_t_1);
                #endif
              } else {
                if (__pyx_t_7 >= 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_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 332, __pyx_L23_error)
                #else
                __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L23_error)
                __Pyx_GOTREF(__pyx_t_1);
                #endif
              }
            } else {
              __pyx_t_1 = __pyx_t_8(__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, 332, __pyx_L23_error)
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_1);
            }
            __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_leaf, __pyx_t_1);
            __pyx_t_1 = 0;

            /* "mathics/builtin/graphics.py":331
 *                             )
 *                         n_leaves = [inset] + [
 *                             Expression(SymbolN, leaf).evaluate(evaluation)             # <<<<<<<<<<<<<<
 *                             for leaf in content.leaves[1:]
 *                         ]
 */
            __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_Expression); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 331, __pyx_L23_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_SymbolN); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 331, __pyx_L23_error)
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_13 = NULL;
            __pyx_t_10 = 0;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
              __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_11);
              if (likely(__pyx_t_13)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
                __Pyx_INCREF(__pyx_t_13);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_11, function);
                __pyx_t_10 = 1;
              }
            }
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_11)) {
              PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_12, __pyx_8genexpr3__pyx_v_leaf};
              __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L23_error)
              __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
              PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_12, __pyx_8genexpr3__pyx_v_leaf};
              __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L23_error)
              __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            } else
            #endif
            {
              __pyx_t_14 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 331, __pyx_L23_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_GIVEREF(__pyx_t_12);
              PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_10, __pyx_t_12);
              __Pyx_INCREF(__pyx_8genexpr3__pyx_v_leaf);
              __Pyx_GIVEREF(__pyx_8genexpr3__pyx_v_leaf);
              PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_10, __pyx_8genexpr3__pyx_v_leaf);
              __pyx_t_12 = 0;
              __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            }
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_evaluate); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 331, __pyx_L23_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_evaluation)) { __Pyx_RaiseClosureNameError("evaluation"); __PYX_ERR(0, 331, __pyx_L23_error) }
            __pyx_t_3 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
              __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_11);
              if (likely(__pyx_t_3)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
                __Pyx_INCREF(__pyx_t_3);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_11, function);
              }
            }
            __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_3, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_evaluation) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_evaluation);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L23_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 330, __pyx_L23_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

            /* "mathics/builtin/graphics.py":332
 *                         n_leaves = [inset] + [
 *                             Expression(SymbolN, leaf).evaluate(evaluation)
 *                             for leaf in content.leaves[1:]             # <<<<<<<<<<<<<<
 *                         ]
 *                     else:
 */
          }
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_leaf); __pyx_8genexpr3__pyx_v_leaf = 0;
          goto __pyx_L26_exit_scope;
          __pyx_L23_error:;
          __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_leaf); __pyx_8genexpr3__pyx_v_leaf = 0;
          goto __pyx_L1_error;
          __pyx_L26_exit_scope:;
        } /* exit inner scope */

        /* "mathics/builtin/graphics.py":330
 *                                 inset._leaves[0], evaluation, opts
 *                             )
 *                         n_leaves = [inset] + [             # <<<<<<<<<<<<<<
 *                             Expression(SymbolN, leaf).evaluate(evaluation)
 *                             for leaf in content.leaves[1:]
 */
        __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 330, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_v_n_leaves = __pyx_t_5;
        __pyx_t_5 = 0;

        /* "mathics/builtin/graphics.py":322
 *                     for atom in atoms
 *                 ):
 *                     if head == "System`Inset":             # <<<<<<<<<<<<<<
 *                         inset = content.leaves[0]
 *                         if inset.get_head_name() == "System`Graphics":
 */
        goto __pyx_L19;
      }

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

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

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

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

  /* "mathics/builtin/graphics.py":342
 *                     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":301
 *         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_6);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __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_inset);
  __Pyx_XDECREF(__pyx_v_opts);
  __Pyx_XDECREF(__pyx_v_n_leaves);
  __Pyx_XDECREF(__pyx_7genexpr__pyx_v_item);
  __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_item);
  __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_leaf);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":297
 *     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__apply_makeboxes *__pyx_cur_scope;
  PyObject *__pyx_v_option = NULL;
  PyObject *__pyx_v_GraphicsBox = NULL;
  PyObject *__pyx_v_Graphics3DBox = NULL;
  PyObject *__pyx_v_Graphics3D = 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;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = 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__apply_makeboxes *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct__apply_makeboxes(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct__apply_makeboxes, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct__apply_makeboxes *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 297, __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":301
 *         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__7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __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":344
 *             return content
 * 
 *         for option in options:             # <<<<<<<<<<<<<<
 *             if option not in ("System`ImageSize",):
 *                 options[option] = Expression(SymbolN, options[option]).evaluate(
 */
  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, 344, __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, 344, __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, 344, __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, 344, __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, 344, __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, 344, __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, 344, __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":345
 * 
 *         for option in options:
 *             if option not in ("System`ImageSize",):             # <<<<<<<<<<<<<<
 *                 options[option] = Expression(SymbolN, 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, 345, __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":346
 *         for option in options:
 *             if option not in ("System`ImageSize",):
 *                 options[option] = Expression(SymbolN, options[option]).evaluate(             # <<<<<<<<<<<<<<
 *                     evaluation
 *                 )
 */
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Expression); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 346, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_SymbolN); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 346, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_v_options, __pyx_v_option); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 346, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = NULL;
      __pyx_t_12 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_12 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_8)) {
        PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_9, __pyx_t_10};
        __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 346, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
        PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_9, __pyx_t_10};
        __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 346, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      } else
      #endif
      {
        __pyx_t_13 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 346, __pyx_L1_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_GIVEREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_12, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_12, __pyx_t_10);
        __pyx_t_9 = 0;
        __pyx_t_10 = 0;
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_13, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 346, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 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, 346, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "mathics/builtin/graphics.py":347
 *             if option not in ("System`ImageSize",):
 *                 options[option] = Expression(SymbolN, options[option]).evaluate(
 *                     evaluation             # <<<<<<<<<<<<<<
 *                 )
 * 
 */
      __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, 346, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "mathics/builtin/graphics.py":346
 *         for option in options:
 *             if option not in ("System`ImageSize",):
 *                 options[option] = Expression(SymbolN, options[option]).evaluate(             # <<<<<<<<<<<<<<
 *                     evaluation
 *                 )
 */
      if (unlikely(PyObject_SetItem(__pyx_v_options, __pyx_v_option, __pyx_t_4) < 0)) __PYX_ERR(0, 346, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

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

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

  /* "mathics/builtin/graphics.py":350
 *                 )
 * 
 *         from mathics.builtin.box.graphics import GraphicsBox             # <<<<<<<<<<<<<<
 *         from mathics.builtin.box.graphics3d import Graphics3DBox
 *         from mathics.builtin.drawing.graphics3d import Graphics3D
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_GraphicsBox);
  __Pyx_GIVEREF(__pyx_n_s_GraphicsBox);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_GraphicsBox);
  __pyx_t_4 = __Pyx_Import(__pyx_n_s_mathics_builtin_box_graphics, __pyx_t_1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_GraphicsBox); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_GraphicsBox = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":351
 * 
 *         from mathics.builtin.box.graphics import GraphicsBox
 *         from mathics.builtin.box.graphics3d import Graphics3DBox             # <<<<<<<<<<<<<<
 *         from mathics.builtin.drawing.graphics3d import Graphics3D
 * 
 */
  __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_n_s_Graphics3DBox);
  __Pyx_GIVEREF(__pyx_n_s_Graphics3DBox);
  PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_Graphics3DBox);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_mathics_builtin_box_graphics3d, __pyx_t_4, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Graphics3DBox); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_v_Graphics3DBox = __pyx_t_4;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":352
 *         from mathics.builtin.box.graphics import GraphicsBox
 *         from mathics.builtin.box.graphics3d import Graphics3DBox
 *         from mathics.builtin.drawing.graphics3d import Graphics3D             # <<<<<<<<<<<<<<
 * 
 *         if type(self) is Graphics:
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_Graphics3D);
  __Pyx_GIVEREF(__pyx_n_s_Graphics3D);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Graphics3D);
  __pyx_t_4 = __Pyx_Import(__pyx_n_s_mathics_builtin_drawing_graphics, __pyx_t_1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_Graphics3D); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_Graphics3D = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":354
 *         from mathics.builtin.drawing.graphics3d import Graphics3D
 * 
 *         if type(self) is Graphics:             # <<<<<<<<<<<<<<
 *             return GraphicsBox(
 *                 convert(content), evaluation=evaluation, *options_to_rules(options)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Graphics); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = (((PyObject *)Py_TYPE(__pyx_cur_scope->__pyx_v_self)) == __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  if (__pyx_t_5) {

    /* "mathics/builtin/graphics.py":355
 * 
 *         if type(self) is Graphics:
 *             return GraphicsBox(             # <<<<<<<<<<<<<<
 *                 convert(content), evaluation=evaluation, *options_to_rules(options)
 *             )
 */
    __Pyx_XDECREF(__pyx_r);

    /* "mathics/builtin/graphics.py":356
 *         if type(self) is Graphics:
 *             return GraphicsBox(
 *                 convert(content), evaluation=evaluation, *options_to_rules(options)             # <<<<<<<<<<<<<<
 *             )
 *         elif type(self) is Graphics3D:
 */
    __pyx_t_4 = __pyx_pf_7mathics_7builtin_8graphics_8Graphics_15apply_makeboxes_convert(__pyx_cur_scope->__pyx_v_convert, __pyx_v_content); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "mathics/builtin/graphics.py":355
 * 
 *         if type(self) is Graphics:
 *             return GraphicsBox(             # <<<<<<<<<<<<<<
 *                 convert(content), evaluation=evaluation, *options_to_rules(options)
 *             )
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":356
 *         if type(self) is Graphics:
 *             return GraphicsBox(
 *                 convert(content), evaluation=evaluation, *options_to_rules(options)             # <<<<<<<<<<<<<<
 *             )
 *         elif type(self) is Graphics3D:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_options_to_rules); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = NULL;
    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_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_v_options) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_options);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "mathics/builtin/graphics.py":355
 * 
 *         if type(self) is Graphics:
 *             return GraphicsBox(             # <<<<<<<<<<<<<<
 *                 convert(content), evaluation=evaluation, *options_to_rules(options)
 *             )
 */
    __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 355, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 355, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "mathics/builtin/graphics.py":356
 *         if type(self) is Graphics:
 *             return GraphicsBox(
 *                 convert(content), evaluation=evaluation, *options_to_rules(options)             # <<<<<<<<<<<<<<
 *             )
 *         elif type(self) is Graphics3D:
 */
    __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_evaluation, __pyx_cur_scope->__pyx_v_evaluation) < 0) __PYX_ERR(0, 356, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":355
 * 
 *         if type(self) is Graphics:
 *             return GraphicsBox(             # <<<<<<<<<<<<<<
 *                 convert(content), evaluation=evaluation, *options_to_rules(options)
 *             )
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_GraphicsBox, __pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __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_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":354
 *         from mathics.builtin.drawing.graphics3d import Graphics3D
 * 
 *         if type(self) is Graphics:             # <<<<<<<<<<<<<<
 *             return GraphicsBox(
 *                 convert(content), evaluation=evaluation, *options_to_rules(options)
 */
  }

  /* "mathics/builtin/graphics.py":358
 *                 convert(content), evaluation=evaluation, *options_to_rules(options)
 *             )
 *         elif type(self) is Graphics3D:             # <<<<<<<<<<<<<<
 *             return Graphics3DBox(
 *                 convert(content), evaluation=evaluation, *options_to_rules(options)
 */
  __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_cur_scope->__pyx_v_self)) == __pyx_v_Graphics3D);
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {

    /* "mathics/builtin/graphics.py":359
 *             )
 *         elif type(self) is Graphics3D:
 *             return Graphics3DBox(             # <<<<<<<<<<<<<<
 *                 convert(content), evaluation=evaluation, *options_to_rules(options)
 *             )
 */
    __Pyx_XDECREF(__pyx_r);

    /* "mathics/builtin/graphics.py":360
 *         elif type(self) is Graphics3D:
 *             return Graphics3DBox(
 *                 convert(content), evaluation=evaluation, *options_to_rules(options)             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __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, 360, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "mathics/builtin/graphics.py":359
 *             )
 *         elif type(self) is Graphics3D:
 *             return Graphics3DBox(             # <<<<<<<<<<<<<<
 *                 convert(content), evaluation=evaluation, *options_to_rules(options)
 *             )
 */
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 359, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":360
 *         elif type(self) is Graphics3D:
 *             return Graphics3DBox(
 *                 convert(content), evaluation=evaluation, *options_to_rules(options)             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_options_to_rules); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 360, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_v_options) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_options);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":359
 *             )
 *         elif type(self) is Graphics3D:
 *             return Graphics3DBox(             # <<<<<<<<<<<<<<
 *                 convert(content), evaluation=evaluation, *options_to_rules(options)
 *             )
 */
    __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 359, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Add(__pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":360
 *         elif type(self) is Graphics3D:
 *             return Graphics3DBox(
 *                 convert(content), evaluation=evaluation, *options_to_rules(options)             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 360, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_evaluation, __pyx_cur_scope->__pyx_v_evaluation) < 0) __PYX_ERR(0, 360, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":359
 *             )
 *         elif type(self) is Graphics3D:
 *             return Graphics3DBox(             # <<<<<<<<<<<<<<
 *                 convert(content), evaluation=evaluation, *options_to_rules(options)
 *             )
 */
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_v_Graphics3DBox, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 359, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":358
 *                 convert(content), evaluation=evaluation, *options_to_rules(options)
 *             )
 *         elif type(self) is Graphics3D:             # <<<<<<<<<<<<<<
 *             return Graphics3DBox(
 *                 convert(content), evaluation=evaluation, *options_to_rules(options)
 */
  }

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

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_13);
  __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_GraphicsBox);
  __Pyx_XDECREF(__pyx_v_Graphics3DBox);
  __Pyx_XDECREF(__pyx_v_Graphics3D);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":365
 * 
 * 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, 365, __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, 365, __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, 365, __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":366
 * 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, 366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 366, __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, 366, __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, 366, __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, 366, __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, 366, __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, 366, __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, 366, __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":367
 *     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":368
 *         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, 368, __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, 368, __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, 368, __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, 368, __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, 368, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":367
 *     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":369
 *         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":370
 *             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, 370, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":369
 *         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":372
 *             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, 372, __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, 372, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "mathics/builtin/graphics.py":373
 *         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, 373, __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, 373, __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, 373, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(__pyx_t_6)) {

    /* "mathics/builtin/graphics.py":374
 *             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, 374, __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, 374, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":373
 *         else:
 *             raise BoxConstructError
 *         if self.value < 0:             # <<<<<<<<<<<<<<
 *             raise BoxConstructError
 * 
 */
  }

  /* "mathics/builtin/graphics.py":365
 * 
 * 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":393
 *     """
 * 
 *     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":394
 * 
 *     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, 394, __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, 394, __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, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 394, __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, 394, __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, 394, __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":393
 *     """
 * 
 *     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":409
 *     """
 * 
 *     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":410
 * 
 *     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, 410, __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, 410, __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, 410, __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, 410, __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":409
 *     """
 * 
 *     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":450
 *     """
 * 
 *     def get_absolute_size(self):             # <<<<<<<<<<<<<<
 *         if self.graphics.view_width is None:
 *             self.graphics.view_width = 400
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_9PointSize_1get_absolute_size(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_9PointSize_1get_absolute_size = {"get_absolute_size", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_9PointSize_1get_absolute_size, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_9PointSize_1get_absolute_size(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_absolute_size (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_9PointSize_get_absolute_size(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_9PointSize_get_absolute_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;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_absolute_size", 0);

  /* "mathics/builtin/graphics.py":451
 * 
 *     def get_absolute_size(self):
 *         if self.graphics.view_width is None:             # <<<<<<<<<<<<<<
 *             self.graphics.view_width = 400
 *         if self.value is None:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_graphics); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __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, 451, __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":452
 *     def get_absolute_size(self):
 *         if self.graphics.view_width is None:
 *             self.graphics.view_width = 400             # <<<<<<<<<<<<<<
 *         if self.value is None:
 *             self.value = DEFAULT_POINT_FACTOR
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_graphics); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_2, __pyx_n_s_view_width, __pyx_int_400) < 0) __PYX_ERR(0, 452, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":451
 * 
 *     def get_absolute_size(self):
 *         if self.graphics.view_width is None:             # <<<<<<<<<<<<<<
 *             self.graphics.view_width = 400
 *         if self.value is None:
 */
  }

  /* "mathics/builtin/graphics.py":453
 *         if self.graphics.view_width is None:
 *             self.graphics.view_width = 400
 *         if self.value is None:             # <<<<<<<<<<<<<<
 *             self.value = DEFAULT_POINT_FACTOR
 *         return self.graphics.view_width * self.value
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = (__pyx_t_2 == Py_None);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":454
 *             self.graphics.view_width = 400
 *         if self.value is None:
 *             self.value = DEFAULT_POINT_FACTOR             # <<<<<<<<<<<<<<
 *         return self.graphics.view_width * self.value
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DEFAULT_POINT_FACTOR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_value, __pyx_t_2) < 0) __PYX_ERR(0, 454, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":453
 *         if self.graphics.view_width is None:
 *             self.graphics.view_width = 400
 *         if self.value is None:             # <<<<<<<<<<<<<<
 *             self.value = DEFAULT_POINT_FACTOR
 *         return self.graphics.view_width * self.value
 */
  }

  /* "mathics/builtin/graphics.py":455
 *         if self.value is None:
 *             self.value = DEFAULT_POINT_FACTOR
 *         return self.graphics.view_width * 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, 455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_view_width); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __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_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 455, __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":450
 *     """
 * 
 *     def get_absolute_size(self):             # <<<<<<<<<<<<<<
 *         if self.graphics.view_width is None:
 *             self.graphics.view_width = 400
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("mathics.builtin.graphics.PointSize.get_absolute_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":572
 * 
 * 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, 572, __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, 572, __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, 572, __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, 572, __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_2generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":578
 *             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_5_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_5_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_5_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 578, __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_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_2generator7, 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, 578, __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_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_5_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_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, 578, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_points)) { __Pyx_RaiseClosureNameError("points"); __PYX_ERR(0, 578, __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, 578, __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, 578, __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, 578, __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, 578, __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, 578, __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, 578, __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, 578, __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, 578, __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, 578, __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, 578, __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, 578, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 578, __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, 578, __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":572
 * 
 * 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_4_do_init *__pyx_cur_scope;
  PyObject *__pyx_v_leaves = NULL;
  PyObject *__pyx_v_lines = NULL;
  PyObject *__pyx_v_leaf = NULL;
  PyObject *__pyx_8genexpr6__pyx_v_line = NULL;
  PyObject *__pyx_8genexpr7__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;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  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_4_do_init *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_4_do_init(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_4_do_init, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_do_init *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 572, __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":573
 * 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, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __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, 573, __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":574
 *     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, 574, __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, 574, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":573
 * class _Polyline(_GraphicsElement):
 *     def do_init(self, graphics, points):
 *         if not points.has_form("List", None):             # <<<<<<<<<<<<<<
 *             raise BoxConstructError
 *         if (
 */
  }

  /* "mathics/builtin/graphics.py":576
 *             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, 576, __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, 576, __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":577
 *         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, 577, __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, 577, __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, 577, __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__8, NULL); 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_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 577, __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":578
 *             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, 578, __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, 578, __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, 578, __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":575
 *         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":580
 *             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, 580, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_leaves = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":581
 *         ):
 *             leaves = points.leaves
 *             self.multi_parts = True             # <<<<<<<<<<<<<<
 *         else:
 *             leaves = [Expression(SymbolList, *points.leaves)]
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_multi_parts, Py_True) < 0) __PYX_ERR(0, 581, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":575
 *         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":583
 *             self.multi_parts = True
 *         else:
 *             leaves = [Expression(SymbolList, *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, 583, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SymbolList); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 583, __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_cur_scope->__pyx_v_points, __pyx_n_s_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 583, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 583, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_6);
    PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_v_leaves = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":584
 *         else:
 *             leaves = [Expression(SymbolList, *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, 584, __pyx_L1_error)
  }
  __pyx_L4:;

  /* "mathics/builtin/graphics.py":585
 *             leaves = [Expression(SymbolList, *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, 585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_lines = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":586
 *             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_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 586, __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, 586, __pyx_L1_error)
  }
  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, 586, __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, 586, __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, 586, __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, 586, __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, 586, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_XDECREF_SET(__pyx_v_leaf, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "mathics/builtin/graphics.py":587
 *         lines = []
 *         for leaf in leaves:
 *             if leaf.has_form("List", None):             # <<<<<<<<<<<<<<
 *                 lines.append(leaf.leaves)
 *             else:
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_leaf, __pyx_n_s_has_form); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 587, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (likely(__pyx_t_4)) {

      /* "mathics/builtin/graphics.py":588
 *         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, 588, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_lines, __pyx_t_2); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 588, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "mathics/builtin/graphics.py":587
 *         lines = []
 *         for leaf in leaves:
 *             if leaf.has_form("List", None):             # <<<<<<<<<<<<<<
 *                 lines.append(leaf.leaves)
 *             else:
 */
      goto __pyx_L10;
    }

    /* "mathics/builtin/graphics.py":590
 *                 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, 590, __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, 590, __pyx_L1_error)
    }
    __pyx_L10:;

    /* "mathics/builtin/graphics.py":586
 *             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":591
 *             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, 591, __pyx_L13_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "mathics/builtin/graphics.py":592
 *                 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_7 = 0;
    for (;;) {
      if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 592, __pyx_L13_error)
      #else
      __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 592, __pyx_L13_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_XDECREF_SET(__pyx_8genexpr6__pyx_v_line, __pyx_t_6);
      __pyx_t_6 = 0;
      { /* enter inner scope */
        __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 592, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (likely(PyList_CheckExact(__pyx_8genexpr6__pyx_v_line)) || PyTuple_CheckExact(__pyx_8genexpr6__pyx_v_line)) {
          __pyx_t_5 = __pyx_8genexpr6__pyx_v_line; __Pyx_INCREF(__pyx_t_5); __pyx_t_10 = 0;
          __pyx_t_8 = NULL;
        } else {
          __pyx_t_10 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_8genexpr6__pyx_v_line); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 592, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 592, __pyx_L18_error)
        }
        for (;;) {
          if (likely(!__pyx_t_8)) {
            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_11 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_11); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 592, __pyx_L18_error)
              #else
              __pyx_t_11 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 592, __pyx_L18_error)
              __Pyx_GOTREF(__pyx_t_11);
              #endif
            } else {
              if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_11); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 592, __pyx_L18_error)
              #else
              __pyx_t_11 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 592, __pyx_L18_error)
              __Pyx_GOTREF(__pyx_t_11);
              #endif
            }
          } else {
            __pyx_t_11 = __pyx_t_8(__pyx_t_5);
            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, 592, __pyx_L18_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_11);
          }
          __Pyx_XDECREF_SET(__pyx_8genexpr7__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, 592, __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_8genexpr7__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, 592, __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_8genexpr7__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, 592, __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, 592, __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_8genexpr7__pyx_v_point);
            __Pyx_GIVEREF(__pyx_8genexpr7__pyx_v_point);
            PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_14, __pyx_8genexpr7__pyx_v_point);
            __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_15, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 592, __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_6, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 592, __pyx_L18_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_point); __pyx_8genexpr7__pyx_v_point = 0;
        goto __pyx_L21_exit_scope;
        __pyx_L18_error:;
        __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_point); __pyx_8genexpr7__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_6))) __PYX_ERR(0, 591, __pyx_L13_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_line); __pyx_8genexpr6__pyx_v_line = 0;
    goto __pyx_L22_exit_scope;
    __pyx_L13_error:;
    __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_line); __pyx_8genexpr6__pyx_v_line = 0;
    goto __pyx_L1_error;
    __pyx_L22_exit_scope:;
  } /* exit inner scope */

  /* "mathics/builtin/graphics.py":591
 *             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, 591, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":572
 * 
 * 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_6);
  __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_8genexpr6__pyx_v_line);
  __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_point);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":595
 *         ]
 * 
 *     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":596
 * 
 *     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, 596, __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, 596, __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, 596, __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, 596, __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, 596, __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":597
 *     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, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_result = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":598
 *         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, 598, __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, 598, __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, 598, __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, 598, __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, 598, __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, 598, __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, 598, __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, 598, __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":599
 *         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, 599, __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, 599, __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, 599, __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, 599, __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, 599, __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, 599, __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, 599, __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":600
 *         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, 600, __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, 600, __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, 600, __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, 600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 600, __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, 600, __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, 600, __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, 600, __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":602
 *                 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, 602, __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, 602, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 602, __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":601
 *             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, 601, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "mathics/builtin/graphics.py":602
 *                 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, 602, __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, 602, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __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":601
 *             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, 601, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "mathics/builtin/graphics.py":602
 *                 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, 602, __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, 602, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 602, __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":601
 *             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, 601, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "mathics/builtin/graphics.py":602
 *                 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, 602, __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, 602, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __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":601
 *             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, 601, __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":599
 *         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":598
 *         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":604
 *                     [(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":595
 *         ]
 * 
 *     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;
}
static PyObject *__pyx_gb_7mathics_7builtin_8graphics_14generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":657
 * 
 * 
 * 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_13_svg_bezier(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_13_svg_bezier = {"_svg_bezier", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_13_svg_bezier, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13_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_12_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_12_svg_bezier(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_segments) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6__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_6__svg_bezier *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_6__svg_bezier(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_6__svg_bezier, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6__svg_bezier *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 657, __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_14generator, __pyx_codeobj__9, (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, 657, __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_2generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":669
 *     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, 669, __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, 669, __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, 669, __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_2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":675
 *             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_8_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_8_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_8_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 675, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_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_2generator9, 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, 675, __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_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_8_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_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, 675, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_p)) { __Pyx_RaiseClosureNameError("p"); __PYX_ERR(0, 675, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_n)) { __Pyx_RaiseClosureNameError("n"); __PYX_ERR(0, 675, __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, 675, __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, 675, __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, 675, __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, 675, __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, 675, __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, 675, __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, 675, __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, 675, __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, 675, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 675, __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":669
 *     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_7_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_7_path *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_7_path(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_7_path, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_path *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 669, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6__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_2generator8, 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, 669, __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_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_7_path *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_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, 669, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":670
 * 
 *     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, 670, __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, 670, __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, 670, __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, 670, __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, 670, __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, 670, __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, 670, __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":671
 *     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, 671, __pyx_L1_error)
    if (!__pyx_t_6) break;

    /* "mathics/builtin/graphics.py":672
 *         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, 672, __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, 672, __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, 672, __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, 672, __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, 672, __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":673
 *         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, 673, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 673, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(__pyx_t_6)) {

      /* "mathics/builtin/graphics.py":674
 *             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, 674, __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, 674, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":673
 *         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":675
 *             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, 675, __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, 675, __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, 675, __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, 675, __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, 675, __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__10, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __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, 675, __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, 675, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":676
 *                 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, 676, __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":669
 *     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":657
 * 
 * 
 * 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_14generator(__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__svg_bezier *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6__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, 657, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":661
 *     # 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, 661, __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, 661, __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, 661, __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":662
 * 
 *     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, 662, __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":664
 *         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":665
 * 
 *     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":664
 *         segments = segments[1:]
 * 
 *     if not segments:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  }

  /* "mathics/builtin/graphics.py":667
 *         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":669
 *     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__12)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 669, __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":678
 *             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, 678, __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, 678, __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, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 678, __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, 678, __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, 678, __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, 678, __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":679
 * 
 *     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, 679, __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, 679, __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, 679, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":681
 *     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__5, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 681, __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, 681, __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, 681, __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, 681, __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, 681, __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, 681, __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, 681, __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, 681, __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, 681, __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":682
 * 
 *     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, 682, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":681
 *     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":684
 *         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, 684, __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, 684, __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, 684, __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, 684, __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, 684, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 684, __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, 684, __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, 684, __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, 684, __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":685
 * 
 *     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, 685, __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, 685, __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, 685, __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, 685, __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, 685, __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, 685, __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, 685, __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, 685, __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":686
 *     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, 686, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":685
 * 
 *     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":684
 *         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":657
 * 
 * 
 * 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;
}

/* "mathics/builtin/graphics.py":830
 *     }
 * 
 *     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, 830, __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, 830, __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, 830, __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":831
 * 
 *     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, 831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 831, __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, 831, __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, 831, __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, 831, __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, 831, __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, 831, __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, 831, __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":832
 *     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, 832, __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, 832, __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":833
 *         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, 833, __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, 833, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":832
 *     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":834
 *         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, 834, __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, 834, __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, 834, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":830
 *     }
 * 
 *     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":836
 *         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, 836, __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, 836, __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, 836, __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, 836, __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":837
 * 
 *     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, 837, __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, 837, __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":838
 *     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, 838, __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, 838, __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, 838, __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, 838, __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, 838, __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, 838, __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, 838, __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, 838, __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":839
 *         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, 839, __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, 839, __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, 839, __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, 839, __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, 839, __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":837
 * 
 *     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":841
 *             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, 841, __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, 841, __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, 841, __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":836
 *         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_6generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":843
 *             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, 843, __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, 843, __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, 843, __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, 843, __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, 843, __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_2generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":848
 *         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_10_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_10_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_10_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_10_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 848, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_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_2generator10, 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, 848, __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_2generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_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, 848, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_leaves)) { __Pyx_RaiseClosureNameError("leaves"); __PYX_ERR(0, 848, __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, 848, __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, 848, __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, 848, __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, 848, __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, 848, __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, 848, __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, 848, __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, 848, __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, 848, __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, 848, __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":843
 *             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_9_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_9_heads *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_9_heads(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_9_heads, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_heads *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 843, __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_6generator1, __pyx_codeobj__13, (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, 843, __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_6generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_heads *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_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, 843, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":846
 *         # 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, 846, __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, 846, __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, 846, __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, 846, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "mathics/builtin/graphics.py":847
 * 
 *         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, 847, __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, 847, __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":848
 *         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, 848, __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, 848, __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, 848, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_4) {

      /* "mathics/builtin/graphics.py":849
 *             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, 849, __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, 849, __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, 849, __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, 849, __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, 849, __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, 849, __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, 849, __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":850
 *             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, 850, __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":851
 *                 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, 851, __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":852
 *                     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, 852, __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, 852, __pyx_L1_error)

          /* "mathics/builtin/graphics.py":851
 *                 for head in leaves:
 *                     spec = head.leaves
 *                     if len(spec) not in (2, 3):             # <<<<<<<<<<<<<<
 *                         raise BoxConstructError
 *                     size_spec = spec[0]
 */
        }

        /* "mathics/builtin/graphics.py":853
 *                     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, 853, __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":855
 *                     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, 855, __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, 855, __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":856
 *                     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, 856, __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, 856, __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, 856, __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":854
 *                         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":858
 *                         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, 858, __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, 858, __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":854
 *                         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":859
 *                     ):
 *                         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, 859, __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, 859, __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, 859, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (likely(__pyx_t_8)) {

          /* "mathics/builtin/graphics.py":860
 *                         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, 860, __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, 860, __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, 860, __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, 860, __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, 860, __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":859
 *                     ):
 *                         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":862
 *                         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, 862, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_Raise(__pyx_t_2, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __PYX_ERR(0, 862, __pyx_L1_error)
        }
        __pyx_L11:;

        /* "mathics/builtin/graphics.py":864
 *                         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, 864, __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, 864, __pyx_L1_error)
        __pyx_t_8 = __pyx_t_9;
        __pyx_L15_bool_binop_done:;
        if (__pyx_t_8) {

          /* "mathics/builtin/graphics.py":865
 * 
 *                     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, 865, __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":866
 *                     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, 866, __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, 866, __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, 866, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(__pyx_t_8)) {

            /* "mathics/builtin/graphics.py":867
 *                         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, 867, __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, 867, __pyx_L1_error)

            /* "mathics/builtin/graphics.py":866
 *                     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":868
 *                         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, 868, __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":864
 *                         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":870
 *                         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":872
 *                         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, 872, __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, 872, __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, 872, __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, 872, __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":873
 * 
 *                     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, 873, __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, 873, __pyx_L1_error)

          /* "mathics/builtin/graphics.py":872
 *                         arrow = default_arrow
 * 
 *                     if not isinstance(spec[1], (Real, Rational, Integer)):             # <<<<<<<<<<<<<<
 *                         raise BoxConstructError
 * 
 */
        }

        /* "mathics/builtin/graphics.py":875
 *                         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, 875, __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, 875, __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, 875, __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, 875, __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, 875, __pyx_L1_error)

        /* "mathics/builtin/graphics.py":849
 *             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":848
 *         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":877
 *                     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, 877, __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":878
 *             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, 878, __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, 878, __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, 878, __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, 878, __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, 878, __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, 878, __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, 878, __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, 878, __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":879
 *                 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, 879, __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, 879, __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, 879, __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, 879, __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, 879, __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, 879, __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, 879, __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, 879, __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, 879, __pyx_L1_error)

        /* "mathics/builtin/graphics.py":878
 *             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":846
 *         # 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":881
 *                     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, 881, __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, 881, __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, 881, __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, 881, __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, 881, __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, 881, __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, 881, __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, 881, __pyx_L1_error)
  }
  __pyx_L4:;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":843
 *             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":884
 * 
 * 
 * def _norm(p, q):             # <<<<<<<<<<<<<<
 *     px, py = p
 *     qx, qy = q
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_16_norm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_16_norm = {"_norm", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_16_norm, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_16_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, 884, __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, 884, __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, 884, __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_15_norm(__pyx_self, __pyx_v_p, __pyx_v_q);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_15_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":885
 * 
 * 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, 885, __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, 885, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 885, __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, 885, __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, 885, __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, 885, __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":886
 * 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, 886, __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, 886, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 886, __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, 886, __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, 886, __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, 886, __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":888
 *     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, 888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_dx = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":889
 * 
 *     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, 889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_dy = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":891
 *     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, 891, __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, 891, __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, 891, __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, 891, __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, 891, __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":892
 * 
 *     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, 892, __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":884
 * 
 * 
 * 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":896
 * 
 * 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, 896, __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, 896, __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, 896, __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_2generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":897
 * 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_2generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":899
 *         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_13_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_13_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_13_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_13_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 899, __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_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_2generator12, 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, 899, __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_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_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_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, 899, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_points)) { __Pyx_RaiseClosureNameError("points"); __PYX_ERR(0, 899, __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, 899, __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, 899, __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, 899, __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, 899, __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, 899, __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, 899, __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, 899, __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, 899, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 899, __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":897
 * 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_12_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_12_draw *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_12_draw(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_12_draw, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_draw *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 897, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_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_2generator11, 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, 897, __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_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_12_draw *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_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, 897, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":898
 *     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, 898, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":899
 *         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, 899, __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, 899, __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__10, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __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, 899, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":900
 *             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, 900, __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, 900, __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, 900, __pyx_L1_error)
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":897
 * 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":896
 * 
 * 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_11_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_11_make_draw_svg *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_11_make_draw_svg(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_11_make_draw_svg, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_make_draw_svg *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 896, __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":897
 * 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__15)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_draw = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":902
 *             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":896
 * 
 * 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":904
 *         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, 904, __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, 904, __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, 904, __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_2generator13(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":905
 * 
 *     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_15_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_15_draw *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_15_draw(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_15_draw, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_15_draw *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 905, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_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_2generator13, 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, 905, __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_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_15_draw *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_15_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, 905, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":906
 *     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, 906, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":907
 *         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, 907, __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, 907, __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, 907, __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, 907, __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, 907, __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, 907, __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, 907, __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, 907, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr11__pyx_v_xy);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr11__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_9genexpr11__pyx_v_xy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 907, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 907, __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__16, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 907, __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, 907, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":908
 *             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, 908, __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, 908, __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, 908, __pyx_L1_error)
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":905
 * 
 *     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":904
 *         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_14_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_14_make_draw_asy *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_14_make_draw_asy(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_14_make_draw_asy, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_make_draw_asy *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 904, __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":905
 * 
 *     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__18)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_draw = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":910
 *             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":904
 *         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_6generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":912
 *         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, 912, __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, 912, __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, 912, __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, 912, __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_5generator15(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":928
 *         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_18_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_18_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_18_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_18_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 928, __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_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_5generator15, 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, 928, __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_5generator15(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_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, 928, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_seg)) { __Pyx_RaiseClosureNameError("seg"); __PYX_ERR(0, 928, __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, 928, __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, 928, __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, 928, __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, 928, __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, 928, __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_8generator16(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":930
 *         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_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, 930, __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_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_8generator16, 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, 930, __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_8generator16(__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;
  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, 930, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_heads)) { __Pyx_RaiseClosureNameError("heads"); __PYX_ERR(0, 930, __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, 930, __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, 930, __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, 930, __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, 930, __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, 930, __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, 930, __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, 930, __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, 930, __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, 930, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 930, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 930, __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, 930, __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, 930, __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, 930, __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, 930, __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, 930, __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, 930, __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, 930, __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, 930, __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, 930, __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":912
 *         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_16_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_16_arrows *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_16_arrows(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_16_arrows, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_arrows *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 912, __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_6generator2, __pyx_codeobj__19, (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, 912, __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_2generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":913
 * 
 *     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_17_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_17_segments *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_17_segments(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_17_segments, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_17_segments *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 913, __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_2generator14, 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, 913, __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_2generator14(__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_segments *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_17_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, 913, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":914
 *     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, 914, __pyx_L1_error)
  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_1 - 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 914, __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, 914, __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, 914, __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, 914, __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, 914, __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, 914, __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, 914, __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, 914, __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, 914, __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":915
 *         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, 915, __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, 915, __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, 915, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 915, __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, 915, __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, 915, __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, 915, __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":916
 *             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, 916, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 916, __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, 916, __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, 916, __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, 916, __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, 916, __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, 916, __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, 916, __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, 916, __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, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 916, __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, 916, __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, 916, __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, 916, __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":917
 *                 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, 917, __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, 917, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":914
 *     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":913
 * 
 *     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":912
 *         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_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_16_arrows *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_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, 912, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":913
 * 
 *     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__21)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 913, __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":919
 *                 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, 919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 919, __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":921
 *         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":922
 * 
 *         if not seg:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         i = 0
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = NULL;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":921
 *         seg = list(segments(points))
 * 
 *         if not seg:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  }

  /* "mathics/builtin/graphics.py":924
 *             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":925
 * 
 *         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":926
 *         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, 926, __pyx_L1_error)
  }
  __pyx_t_5 = PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 926, __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":927
 *         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, 927, __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, 927, __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, 927, __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, 927, __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, 927, __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, 927, __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":928
 *         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, 928, __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, 928, __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":930
 *         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, 930, __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, 930, __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, 930, __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, 930, __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, 930, __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, 930, __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, 930, __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, 930, __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, 930, __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, 930, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 930, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 930, __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, 930, __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, 930, __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, 930, __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":931
 * 
 *         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, 931, __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, 931, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (__pyx_t_4) {

      /* "mathics/builtin/graphics.py":932
 *         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":931
 * 
 *         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":934
 *                 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, 934, __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, 934, __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, 934, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_4) {

      /* "mathics/builtin/graphics.py":935
 * 
 *             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, 935, __pyx_L1_error)
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 935, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (!__pyx_t_4) break;

        /* "mathics/builtin/graphics.py":936
 *             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, 936, __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":937
 *                 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, 937, __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":938
 *                     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, 938, __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":939
 *                     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, 939, __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, 939, __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, 939, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_4) {

          /* "mathics/builtin/graphics.py":940
 *                     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, 940, __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":941
 *                     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, 941, __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":942
 *                         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":939
 *                     t0 += dl
 *                     i += 1
 *                     if i == n:             # <<<<<<<<<<<<<<
 *                         px += dx  # move to last segment's end
 *                         py += dy
 */
        }

        /* "mathics/builtin/graphics.py":944
 *                         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, 944, __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, 944, __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, 944, __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, 944, __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, 944, __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, 944, __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":934
 *                 continue
 * 
 *             if i < n:  # not yet past last segment?             # <<<<<<<<<<<<<<
 *                 while t > dl:  # position past current segment?
 *                     t -= dl
 */
    }

    /* "mathics/builtin/graphics.py":946
 *                         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, 946, __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, 946, __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, 946, __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, 946, __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, 946, __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, 946, __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, 946, __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, 946, __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, 946, __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, 946, __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, 946, __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, 946, __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, 946, __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":947
 * 
 *             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, 947, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":946
 *                         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":930
 *         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":912
 *         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":950
 * 
 * 
 * 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_18_bezier_derivative(PyObject *__pyx_self, PyObject *__pyx_v_p); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_18_bezier_derivative = {"_bezier_derivative", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_18_bezier_derivative, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_18_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_17_bezier_derivative(__pyx_self, ((PyObject *)__pyx_v_p));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_17_bezier_derivative(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p) {
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_9genexpr14__pyx_v_w = NULL;
  PyObject *__pyx_9genexpr15__pyx_v_x1 = NULL;
  PyObject *__pyx_9genexpr15__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":952
 * 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, 952, __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, 952, __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, 952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_n = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":953
 *     # 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, 953, __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, 953, __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, 953, __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, 953, __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, 953, __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, 953, __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, 953, __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, 953, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr14__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, 953, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_9genexpr14__pyx_v_w, 1, 0, NULL, NULL, &__pyx_slice__5, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 953, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 953, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_9genexpr14__pyx_v_w);
        __Pyx_GIVEREF(__pyx_9genexpr14__pyx_v_w);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_9genexpr14__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, 953, __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, 953, __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, 953, __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, 953, __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, 953, __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, 953, __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, 953, __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, 953, __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, 953, __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, 953, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 953, __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, 953, __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, 953, __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, 953, __pyx_L10_error)
            __pyx_L14_unpacking_done:;
          }
          __Pyx_XDECREF_SET(__pyx_9genexpr15__pyx_v_x1, __pyx_t_10);
          __pyx_t_10 = 0;
          __Pyx_XDECREF_SET(__pyx_9genexpr15__pyx_v_x0, __pyx_t_11);
          __pyx_t_11 = 0;
          __pyx_t_6 = PyNumber_Subtract(__pyx_9genexpr15__pyx_v_x1, __pyx_9genexpr15__pyx_v_x0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 953, __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, 953, __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, 953, __pyx_L10_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_x0); __pyx_9genexpr15__pyx_v_x0 = 0;
        __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_x1); __pyx_9genexpr15__pyx_v_x1 = 0;
        goto __pyx_L15_exit_scope;
        __pyx_L10_error:;
        __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_x0); __pyx_9genexpr15__pyx_v_x0 = 0;
        __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_x1); __pyx_9genexpr15__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, 953, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_w); __pyx_9genexpr14__pyx_v_w = 0;
    goto __pyx_L16_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_w); __pyx_9genexpr14__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":950
 * 
 * 
 * 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_9genexpr14__pyx_v_w);
  __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_x1);
  __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_x0);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":956
 * 
 * 
 * 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_20_bezier_evaluate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_20_bezier_evaluate = {"_bezier_evaluate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_20_bezier_evaluate, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_20_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, 956, __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, 956, __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, 956, __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_19_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_19_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_9genexpr16__pyx_v_w = NULL;
  PyObject *__pyx_9genexpr17__pyx_v_w = NULL;
  PyObject *__pyx_9genexpr18__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":958
 * 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, 958, __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, 958, __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, 958, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_n = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":959
 *     # 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, 959, __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, 959, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":960
 *     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, 960, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_t2 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":961
 *     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, 961, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_t3 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":962
 *         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, 962, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_mt = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":963
 *         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, 963, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_mt2 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":964
 *         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, 964, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_mt3 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":965
 *         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, 965, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_1);

      /* "mathics/builtin/graphics.py":966
 *         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, 966, __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, 966, __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, 966, __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, 966, __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, 966, __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, 966, __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, 966, __pyx_L6_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_6);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr16__pyx_v_w, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_GetItemInt(__pyx_9genexpr16__pyx_v_w, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 966, __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, 966, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_GetItemInt(__pyx_9genexpr16__pyx_v_w, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 966, __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, 966, __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, 966, __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, 966, __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, 966, __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_9genexpr16__pyx_v_w, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 966, __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, 966, __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, 966, __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, 966, __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, 966, __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_9genexpr16__pyx_v_w, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 966, __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, 966, __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, 966, __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, 965, __pyx_L6_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_w); __pyx_9genexpr16__pyx_v_w = 0;
      goto __pyx_L9_exit_scope;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_w); __pyx_9genexpr16__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":959
 *     # 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":968
 *             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, 968, __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, 968, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":969
 *         ]
 *     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, 969, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_t2 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":970
 *     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, 970, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_mt = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":971
 *         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, 971, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_mt2 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":972
 *         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, 972, __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, 972, __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, 972, __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, 972, __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, 972, __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, 972, __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, 972, __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, 972, __pyx_L12_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_7);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr17__pyx_v_w, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_GetItemInt(__pyx_9genexpr17__pyx_v_w, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 972, __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, 972, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_GetItemInt(__pyx_9genexpr17__pyx_v_w, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 972, __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, 972, __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, 972, __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, 972, __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, 972, __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_9genexpr17__pyx_v_w, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 972, __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, 972, __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, 972, __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, 972, __pyx_L12_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_w); __pyx_9genexpr17__pyx_v_w = 0;
      goto __pyx_L15_exit_scope;
      __pyx_L12_error:;
      __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_w); __pyx_9genexpr17__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":968
 *             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":973
 *         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, 973, __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, 973, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(__pyx_t_3)) {

    /* "mathics/builtin/graphics.py":974
 *         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, 974, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_mt = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":975
 *     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, 975, __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, 975, __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, 975, __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, 975, __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, 975, __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, 975, __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, 975, __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, 975, __pyx_L18_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_8);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr18__pyx_v_w, __pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_GetItemInt(__pyx_9genexpr18__pyx_v_w, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 975, __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, 975, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_GetItemInt(__pyx_9genexpr18__pyx_v_w, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 975, __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, 975, __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, 975, __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, 975, __pyx_L18_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_w); __pyx_9genexpr18__pyx_v_w = 0;
      goto __pyx_L21_exit_scope;
      __pyx_L18_error:;
      __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_w); __pyx_9genexpr18__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":973
 *         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":977
 *         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, 977, __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, 977, __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, 977, __pyx_L1_error)
  }

  /* "mathics/builtin/graphics.py":956
 * 
 * 
 * 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_9genexpr16__pyx_v_w);
  __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_w);
  __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_w);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":981
 * 
 * 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, 981, __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, 981, __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":982
 * 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, 982, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":981
 * 
 * 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":984
 *         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, 984, __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, 984, __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, 984, __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_2generator17(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":985
 * 
 *     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_21_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_21_draw *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_21_draw(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_21_draw, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_draw *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 985, __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_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_2generator17, 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, 985, __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_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_draw *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_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, 985, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":986
 *     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, 986, __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, 986, __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, 986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 986, __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, 986, __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__10, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_s = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":987
 *         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, 987, __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, 987, __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, 987, __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, 987, __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__22);
  __pyx_t_5 += 3;
  __Pyx_GIVEREF(__pyx_kp_u__22);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u__22);
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 987, __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, 987, __pyx_L1_error)
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":985
 * 
 *     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":984
 *         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_20_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_20_make_draw_svg *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_20_make_draw_svg(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_20_make_draw_svg, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20_make_draw_svg *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 984, __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":985
 * 
 *     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__24)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 985, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_draw = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":989
 *             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":984
 *         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":991
 *         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, 991, __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, 991, __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, 991, __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_2generator18(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":992
 * 
 *     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_23_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_23_draw *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_23_draw(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_23_draw, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23_draw *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 992, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_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_2generator18, 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, 992, __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_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_23_draw *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23_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, 992, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":993
 *     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, 993, __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, 993, __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, 993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 993, __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, 993, __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, 993, __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, 993, __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, 993, __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, 993, __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, 993, __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, 993, __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, 993, __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":994
 *         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, 994, __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, 994, __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__25);
    __pyx_t_7 += 2;
    __Pyx_GIVEREF(__pyx_kp_u__25);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__25);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_pen)) { __Pyx_RaiseClosureNameError("pen"); __PYX_ERR(0, 994, __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, 994, __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__26);
    __pyx_t_7 += 2;
    __Pyx_GIVEREF(__pyx_kp_u__26);
    PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__26);
    __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 994, __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, 994, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":993
 *     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":992
 * 
 *     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":991
 *         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_22_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_22_make_draw_asy *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_22_make_draw_asy(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_22_make_draw_asy, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_make_draw_asy *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 991, __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":992
 * 
 *     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__28)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_draw = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":996
 *                 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":991
 *         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_8generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":998
 *         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, 998, __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, 998, __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, 998, __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, 998, __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_24_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_24_arrows *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_24_arrows(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_24_arrows, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_24_arrows *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 998, __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_8generator3, __pyx_codeobj__29, (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, 998, __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_8generator3(__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_arrows *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_24_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, 998, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":999
 * 
 *     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, 999, __pyx_L1_error)
  __pyx_t_2 = ((__pyx_t_1 < 2) != 0);
  if (__pyx_t_2) {

    /* "mathics/builtin/graphics.py":1000
 *     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":999
 * 
 *     def arrows(self, points, heads):  # heads has to be sorted by pos
 *         if len(points) < 2:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  }

  /* "mathics/builtin/graphics.py":1004
 *         # 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, 1004, __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, 1004, __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, 1004, __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":1005
 * 
 *         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, 1005, __pyx_L1_error)
  __pyx_t_2 = ((__pyx_t_1 >= 3) != 0);
  if (__pyx_t_2) {

    /* "mathics/builtin/graphics.py":1006
 *         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, 1006, __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, 1006, __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":1005
 * 
 *         cp = list(zip(*points))
 *         if len(points) >= 3:             # <<<<<<<<<<<<<<
 *             dcp = _bezier_derivative(cp)
 *         else:
 */
    goto __pyx_L5;
  }

  /* "mathics/builtin/graphics.py":1008
 *             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":1010
 *             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, 1010, __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, 1010, __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, 1010, __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, 1010, __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, 1010, __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, 1010, __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, 1010, __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, 1010, __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, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1010, __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, 1010, __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, 1010, __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, 1010, __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":1011
 * 
 *         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, 1011, __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, 1011, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "mathics/builtin/graphics.py":1012
 *         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":1011
 * 
 *         for s, t, draw in heads:
 *             if s == 0.0:  # ignore zero-sized arrows             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    }

    /* "mathics/builtin/graphics.py":1014
 *                 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, 1014, __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, 1014, __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, 1014, __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, 1014, __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, 1014, __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, 1014, __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, 1014, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1014, __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, 1014, __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, 1014, __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, 1014, __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":1016
 *             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, 1016, __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, 1016, __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, 1016, __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, 1016, __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, 1016, __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, 1016, __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, 1016, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1016, __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, 1016, __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, 1016, __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, 1016, __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":1017
 * 
 *             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, 1017, __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, 1017, __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, 1017, __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, 1017, __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, 1017, __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, 1017, __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":1018
 *             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, 1018, __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":1019
 *             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, 1019, __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":1021
 *             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, 1021, __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, 1021, __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, 1021, __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, 1021, __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, 1021, __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, 1021, __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, 1021, __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, 1021, __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, 1021, __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, 1021, __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, 1021, __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":1022
 * 
 *             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, 1022, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":1021
 *             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":1010
 *             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":998
 *         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":1025
 * 
 * 
 * def total_extent(extents):             # <<<<<<<<<<<<<<
 *     xmin = xmax = ymin = ymax = None
 *     for extent in extents:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_22total_extent(PyObject *__pyx_self, PyObject *__pyx_v_extents); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_22total_extent = {"total_extent", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_22total_extent, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_22total_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_21total_extent(__pyx_self, ((PyObject *)__pyx_v_extents));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_21total_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":1026
 * 
 * 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":1027
 * 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, 1027, __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, 1027, __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, 1027, __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, 1027, __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, 1027, __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, 1027, __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, 1027, __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":1028
 *     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, 1028, __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, 1028, __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, 1028, __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, 1028, __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, 1028, __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, 1028, __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, 1028, __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, 1028, __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, 1028, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1028, __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, 1028, __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, 1028, __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, 1028, __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":1029
 *     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, 1029, __pyx_L1_error)
      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 1029, __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":1030
 *         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":1029
 *     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":1031
 *             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, 1031, __pyx_L1_error)
      __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 1031, __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":1032
 *                 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":1031
 *             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":1033
 *             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, 1033, __pyx_L1_error)
      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 1033, __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":1034
 *                 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":1033
 *             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":1035
 *             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, 1035, __pyx_L1_error)
      __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 1035, __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":1036
 *                 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":1035
 *             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":1028
 *     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":1027
 * 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":1037
 *             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, 1037, __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":1025
 * 
 * 
 * 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":1056
 * 
 * 
 * def _style(graphics, item):             # <<<<<<<<<<<<<<
 *     head = item.get_head_name()
 *     if head in style_heads:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_24_style(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_24_style = {"_style", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_24_style, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_24_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, 1056, __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, 1056, __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, 1056, __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_23_style(__pyx_self, __pyx_v_graphics, __pyx_v_item);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_23_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":1057
 * 
 * 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, 1057, __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, 1057, __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":1058
 * 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, 1058, __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, 1058, __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":1059
 *     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, 1059, __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, 1059, __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":1060
 *     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, 1060, __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, 1060, __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, 1060, __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, 1060, __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, 1060, __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":1058
 * 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":1061
 *         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, 1061, __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, 1061, __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":1062
 *         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, 1062, __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, 1062, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":1063
 *     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, 1062, __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, 1063, __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, 1063, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_edge, __pyx_t_3) < 0) __PYX_ERR(0, 1063, __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, 1063, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_face, __pyx_t_3) < 0) __PYX_ERR(0, 1063, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":1062
 *         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, 1062, __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":1065
 *             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, 1065, __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, 1065, __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":1066
 *         )
 *         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, 1066, __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, 1066, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":1065
 *             graphics, edge=head == "System`EdgeForm", face=head == "System`FaceForm"
 *         )
 *         if len(item.leaves) > 1:             # <<<<<<<<<<<<<<
 *             raise BoxConstructError
 *         if item.leaves:
 */
    }

    /* "mathics/builtin/graphics.py":1067
 *         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, 1067, __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, 1067, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_4) {

      /* "mathics/builtin/graphics.py":1068
 *             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, 1068, __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, 1068, __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, 1068, __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__8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1068, __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, 1068, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_4) {

        /* "mathics/builtin/graphics.py":1069
 *         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, 1069, __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, 1069, __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, 1069, __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, 1069, __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, 1069, __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, 1069, __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, 1069, __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, 1069, __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, 1069, __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, 1069, __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":1070
 *             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, 1070, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1070, __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, 1070, __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, 1070, __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, 1070, __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":1069
 *         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":1068
 *             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":1072
 *                     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, 1072, __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, 1072, __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, 1072, __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, 1072, __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, 1072, __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, 1072, __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, 1072, __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":1067
 *         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":1061
 *         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":1074
 *                 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, 1074, __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, 1074, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "mathics/builtin/graphics.py":1075
 *     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":1056
 * 
 * 
 * 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":1079
 * 
 * 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, 1079, __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, 1079, __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, 1079, __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":1080
 * 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, 1080, __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, 1080, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1081
 *     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, 1081, __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, 1081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1082
 *         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, 1082, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1083
 *         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, 1083, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1084
 *         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, 1084, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1085
 *         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, 1085, __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, 1085, __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, 1085, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1079
 * 
 * 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":1087
 *         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, 1087, __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, 1087, __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, 1087, __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":1088
 * 
 *     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, 1088, __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, 1088, __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, 1088, __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, 1088, __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, 1088, __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, 1088, __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, 1088, __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, 1088, __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":1087
 *         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":1090
 *         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, 1090, __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, 1090, __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, 1090, __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, 1090, __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":1091
 * 
 *     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, 1091, __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, 1091, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1090
 *         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":1093
 *         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, 1093, __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, 1093, __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, 1093, __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":1094
 * 
 *     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, 1094, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "mathics/builtin/graphics.py":1095
 *     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, 1095, __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, 1095, __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, 1095, __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, 1095, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":1094
 * 
 *     def extend(self, style, pre=True):
 *         if pre:             # <<<<<<<<<<<<<<
 *             self.styles = style.styles + self.styles
 *         else:
 */
    goto __pyx_L3;
  }

  /* "mathics/builtin/graphics.py":1097
 *             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, 1097, __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, 1097, __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, 1097, __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, 1097, __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":1093
 *         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":1099
 *             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":1100
 * 
 *     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, 1100, __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, 1100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1100, __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, 1100, __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, 1100, __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, 1100, __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, 1100, __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, 1100, __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, 1100, __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":1101
 *     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, 1101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, 0, NULL, NULL, &__pyx_slice__30, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1101, __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, 1101, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1102
 *         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, 1102, __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, 1102, __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, 1102, __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, 1102, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1103
 *         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":1099
 *             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":1105
 *         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":1106
 * 
 *     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, 1106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_components, __pyx_tuple__31) < 0) __PYX_ERR(0, 1106, __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, 1106, __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":1105
 *         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":1108
 *         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":1109
 * 
 *     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, 1109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_components, __pyx_tuple__31) < 0) __PYX_ERR(0, 1109, __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, 1109, __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":1108
 *         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":1111
 *         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":1112
 * 
 *     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, 1111, __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, 1111, __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, 1111, __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":1111
 *         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":1114
 *         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":1115
 *     ):
 *         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":1114
 *         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":1116
 *         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":1117
 *             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, 1117, __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, 1117, __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, 1117, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_2) {

    /* "mathics/builtin/graphics.py":1118
 *         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, 1118, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "mathics/builtin/graphics.py":1119
 *         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, 1119, __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, 1119, __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":1118
 *         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":1121
 *                 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, 1121, __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, 1121, __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":1117
 *             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":1122
 *             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, 1122, __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, 1122, __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, 1122, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "mathics/builtin/graphics.py":1123
 *                 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, 1123, __pyx_L1_error)
    __pyx_t_1 = ((!__pyx_t_2) != 0);
    if (__pyx_t_1) {

      /* "mathics/builtin/graphics.py":1124
 *         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, 1124, __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, 1124, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1124, __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, 1124, __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, 1124, __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, 1124, __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":1123
 *                 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":1122
 *             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":1125
 *             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, 1125, __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, 1125, __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, 1125, __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, 1125, __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, 1125, __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, 1125, __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, 1125, __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, 1125, __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":1126
 *                 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, 1126, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "mathics/builtin/graphics.py":1127
 *         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, 1127, __pyx_L1_error)
      if (__pyx_t_2) {

        /* "mathics/builtin/graphics.py":1128
 *             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":1127
 *         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":1130
 *                     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":1126
 *                 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":1131
 *                 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, 1131, __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, 1131, __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":1132
 *                     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, 1132, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "mathics/builtin/graphics.py":1133
 *             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, 1133, __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, 1133, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_1) {

          /* "mathics/builtin/graphics.py":1134
 *                 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, 1134, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);

          /* "mathics/builtin/graphics.py":1135
 *                     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, 1134, __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, 1135, __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, 1135, __pyx_L1_error)
          if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_consider_forms, Py_False) < 0) __PYX_ERR(0, 1135, __pyx_L1_error)

          /* "mathics/builtin/graphics.py":1134
 *                 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, 1134, __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, 1134, __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, 1134, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1134, __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, 1134, __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, 1134, __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, 1134, __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":1133
 *             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":1137
 *                             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, 1137, __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, 1137, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_1) {

          /* "mathics/builtin/graphics.py":1138
 *                         )
 *                     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, 1138, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);

          /* "mathics/builtin/graphics.py":1139
 *                     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, 1138, __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, 1139, __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, 1139, __pyx_L1_error)
          if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_consider_forms, Py_False) < 0) __PYX_ERR(0, 1139, __pyx_L1_error)

          /* "mathics/builtin/graphics.py":1138
 *                         )
 *                     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, 1138, __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, 1138, __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, 1138, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1138, __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, 1138, __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, 1138, __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, 1138, __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":1137
 *                             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":1132
 *                     edge_style = item
 *             elif isinstance(item, Style):
 *                 if consider_forms:             # <<<<<<<<<<<<<<
 *                     if item.edge:
 *                         edge_style, _ = item.get_style(
 */
      }

      /* "mathics/builtin/graphics.py":1131
 *                 else:
 *                     edge_style = item
 *             elif isinstance(item, Style):             # <<<<<<<<<<<<<<
 *                 if consider_forms:
 *                     if item.edge:
 */
    }
    __pyx_L9:;

    /* "mathics/builtin/graphics.py":1125
 *             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":1142
 *                         )
 * 
 *         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, 1142, __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":1111
 *         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":1144
 *         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, 1144, __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, 1144, __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, 1144, __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":1145
 * 
 *     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, 1145, __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, 1145, __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, 1145, __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, 1145, __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, 1145, __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, 1145, __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":1144
 *         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":1147
 *         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, 1147, __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, 1147, __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":1148
 * 
 *     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, 1148, __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, 1148, __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":1149
 *     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":1148
 * 
 *     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":1150
 *         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, 1150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mathics/builtin/graphics.py":1151
 *             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, 1151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "mathics/builtin/graphics.py":1150
 *         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, 1150, __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":1151
 *             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, 1151, __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, 1151, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_consider_forms, __pyx_v_face_element) < 0) __PYX_ERR(0, 1151, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1150
 *         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, 1150, __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, 1150, __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, 1150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1150, __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, 1150, __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, 1150, __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, 1150, __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":1153
 *             _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":1154
 *         )
 *         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":1153
 *             _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":1155
 *         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, 1155, __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, 1155, __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":1147
 *         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_27generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":1158
 * 
 * 
 * def _flatten(leaves):             # <<<<<<<<<<<<<<
 *     for leaf in leaves:
 *         if leaf.get_head_name() == "System`List":
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_26_flatten(PyObject *__pyx_self, PyObject *__pyx_v_leaves); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_26_flatten = {"_flatten", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_26_flatten, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_26_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_25_flatten(__pyx_self, ((PyObject *)__pyx_v_leaves));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_25_flatten(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_leaves) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25__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_25__flatten *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_25__flatten(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_25__flatten, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25__flatten *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1158, __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_27generator4, __pyx_codeobj__32, (PyObject *) __pyx_cur_scope, __pyx_n_s_flatten, __pyx_n_s_flatten, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 1158, __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_27generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25__flatten *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25__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, 1158, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1159
 * 
 * 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, 1159, __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, 1159, __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, 1159, __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, 1159, __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, 1159, __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, 1159, __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, 1159, __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":1160
 * 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, 1160, __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, 1160, __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, 1160, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_7) {

      /* "mathics/builtin/graphics.py":1161
 *     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, 1161, __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, 1161, __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, 1161, __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, 1161, __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":1162
 *         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, 1162, __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, 1162, __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, 1162, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_7) {

        /* "mathics/builtin/graphics.py":1163
 *             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, 1163, __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, 1163, __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, 1163, __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, 1163, __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, 1163, __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, 1163, __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, 1163, __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, 1163, __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":1164
 *             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, 1164, __pyx_L1_error)

          /* "mathics/builtin/graphics.py":1163
 *             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":1162
 *         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":1166
 *                     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, 1166, __pyx_L1_error)
      }
      __pyx_L7:;

      /* "mathics/builtin/graphics.py":1160
 * 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":1168
 *                 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, 1168, __pyx_L1_error)
    }
    __pyx_L6:;

    /* "mathics/builtin/graphics.py":1159
 * 
 * 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":1158
 * 
 * 
 * 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":1172
 * 
 * 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, 1172, __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, 1172, __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, 1172, __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, 1172, __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":1178
 *         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_26___init__ *__pyx_cur_scope;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26___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_26___init__ *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "mathics/builtin/graphics.py":1179
 * 
 *         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, 1179, __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, 1179, __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, 1179, __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":1180
 *         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":1181
 *             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":1180
 *         def get_options(name):
 *             builtin = builtins.get(name)
 *             if builtin is None:             # <<<<<<<<<<<<<<
 *                 return None
 *             return builtin.options
 */
  }

  /* "mathics/builtin/graphics.py":1182
 *             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, 1182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":1178
 *         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":1184
 *             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, 1184, __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, 1184, __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, 1184, __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":1185
 * 
 *         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, 1185, __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, 1185, __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":1186
 *         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, 1186, __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, 1186, __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, 1186, __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, 1186, __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, 1186, __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, 1186, __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, 1186, __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, 1186, __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, 1186, __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":1187
 *             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, 1187, __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, 1187, __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":1188
 *             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, 1188, __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, 1188, __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":1189
 *                 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, 1189, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":1188
 *             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":1190
 *                 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, 1190, __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, 1190, __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, 1190, __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":1191
 *                     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, 1191, __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, 1191, __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, 1191, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1191, __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, 1191, __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, 1191, __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, 1191, __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":1192
 *                 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, 1192, __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, 1192, __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":1193
 *                     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, 1193, __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, 1193, __pyx_L1_error)

        /* "mathics/builtin/graphics.py":1192
 *                 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":1195
 *                         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, 1195, __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, 1195, __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":1196
 * 
 *                     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, 1196, __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, 1196, __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, 1196, __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, 1196, __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, 1196, __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, 1196, __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":1197
 *                     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":1198
 *                     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, 1198, __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, 1198, __pyx_L1_error)

        /* "mathics/builtin/graphics.py":1197
 *                     name = option.get_name()
 *                     create = style_options.get(name, None)
 *                     if create is None:             # <<<<<<<<<<<<<<
 *                         raise BoxConstructError
 * 
 */
      }

      /* "mathics/builtin/graphics.py":1200
 *                         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, 1200, __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, 1200, __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, 1200, __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, 1200, __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, 1200, __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, 1200, __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, 1200, __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, 1200, __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, 1200, __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, 1200, __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":1190
 *                 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":1202
 *                     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, 1202, __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, 1202, __pyx_L1_error)
    }
    __pyx_L5:;

    /* "mathics/builtin/graphics.py":1186
 *         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":1203
 *                 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":1184
 *             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___6generator19(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":1205
 *             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, 1205, __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, 1205, __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, 1205, __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_27_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_27_convert *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_27_convert(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_27_convert, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_27_convert *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1205, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26___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___6generator19, 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, 1205, __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___6generator19(__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_convert *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_27_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, 1205, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1206
 * 
 *         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, 1206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1206, __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, 1206, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":1207
 *         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, 1207, __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":1206
 * 
 *         def convert(content, style):
 *             if content.has_form("List", None):             # <<<<<<<<<<<<<<
 *                 items = content.leaves
 *             else:
 */
    goto __pyx_L4;
  }

  /* "mathics/builtin/graphics.py":1209
 *                 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, 1209, __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":1210
 *             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, 1210, __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, 1210, __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":1211
 *                 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, 1211, __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, 1211, __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, 1211, __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, 1211, __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, 1211, __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, 1211, __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, 1211, __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":1212
 *             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, 1212, __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, 1212, __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, 1212, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_3) {

      /* "mathics/builtin/graphics.py":1213
 *             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":1212
 *             style = style.clone()
 *             for item in items:
 *                 if item.get_name() == "System`Null":             # <<<<<<<<<<<<<<
 *                     continue
 *                 head = item.get_head_name()
 */
    }

    /* "mathics/builtin/graphics.py":1214
 *                 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, 1214, __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, 1214, __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":1215
 *                     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, 1215, __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, 1215, __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":1216
 *                 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, 1216, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":1215
 *                     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":1217
 *                 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, 1217, __pyx_L1_error)
    if (__pyx_t_8) {

      /* "mathics/builtin/graphics.py":1218
 *                     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, 1218, __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, 1218, __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":1219
 *                 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, 1219, __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, 1219, __pyx_L1_error)

        /* "mathics/builtin/graphics.py":1218
 *                     style.append(item)
 *                 elif head == "System`StyleBox":
 *                     if len(item.leaves) < 1:             # <<<<<<<<<<<<<<
 *                         raise BoxConstructError
 *                     for element in convert(
 */
      }

      /* "mathics/builtin/graphics.py":1221
 *                         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, 1221, __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, 1221, __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, 1221, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_t_1, 1, 0, NULL, NULL, &__pyx_slice__5, 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1221, __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, 1221, __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, 1221, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "mathics/builtin/graphics.py":1220
 *                     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, 1220, __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, 1220, __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, 1220, __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, 1220, __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, 1220, __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, 1220, __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, 1220, __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, 1220, __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, 1220, __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":1223
 *                         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, 1223, __pyx_L1_error)

        /* "mathics/builtin/graphics.py":1220
 *                     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":1217
 *                 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":1224
 *                     ):
 *                         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__33, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __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, 1224, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_8) {

      /* "mathics/builtin/graphics.py":1225
 *                         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, 1225, __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, 1225, __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":1226
 *                 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":1227
 *                     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__34, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1227, __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, 1227, __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, 1227, __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":1228
 *                     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, 1228, __pyx_L1_error)
        if (__pyx_t_3) {

          /* "mathics/builtin/graphics.py":1229
 *                         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, 1229, __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, 1229, __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, 1229, __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, 1229, __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, 1229, __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, 1229, __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, 1229, __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, 1229, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_14 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1229, __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, 1229, __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, 1229, __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, 1229, __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":1230
 *                         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, 1230, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1230, __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, 1230, __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, 1230, __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, 1230, __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":1231
 *                             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, 1231, __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, 1231, __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, 1231, __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, 1231, __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, 1231, __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, 1231, __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, 1231, __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":1228
 *                     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":1233
 *                             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, 1233, __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, 1233, __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, 1233, __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, 1233, __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, 1233, __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, 1233, __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, 1233, __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":1234
 *                         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, 1234, __pyx_L1_error)

        /* "mathics/builtin/graphics.py":1226
 *                 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":1236
 *                         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, 1236, __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, 1236, __pyx_L1_error)
      }
      __pyx_L13:;

      /* "mathics/builtin/graphics.py":1224
 *                     ):
 *                         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":1237
 *                     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, 1237, __pyx_L1_error)
    if (likely(__pyx_t_3)) {

      /* "mathics/builtin/graphics.py":1238
 *                         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, 1238, __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, 1238, __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, 1238, __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, 1238, __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, 1238, __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, 1238, __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, 1238, __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, 1238, __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, 1238, __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":1239
 *                 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, 1239, __pyx_L1_error)

        /* "mathics/builtin/graphics.py":1238
 *                         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":1237
 *                     else:
 *                         raise BoxConstructError
 *                 elif head == "System`List":             # <<<<<<<<<<<<<<
 *                     for element in convert(item, style):
 *                         yield element
 */
      goto __pyx_L8;
    }

    /* "mathics/builtin/graphics.py":1241
 *                         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, 1241, __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, 1241, __pyx_L1_error)
    }
    __pyx_L8:;

    /* "mathics/builtin/graphics.py":1211
 *                 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":1205
 *             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":1172
 * 
 * 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_26___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_26___init__ *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_26___init__(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_26___init__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26___init__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1172, __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":1173
 * 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, 1173, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1174
 *     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, 1174, __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, 1174, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1176
 *         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, 1176, __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, 1176, __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":1178
 *         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__36)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1178, __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":1184
 *             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__38)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1184, __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":1205
 *             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__40)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1205, __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":1243
 *                     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, 1243, __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, 1243, __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, 1243, __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, 1243, __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, 1243, __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, 1243, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1172
 * 
 * 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":1245
 *         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, 1245, __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, 1245, __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, 1245, __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":1248
 *         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_28_create_style *__pyx_cur_scope;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_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_28_create_style *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "mathics/builtin/graphics.py":1249
 * 
 *         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, 1249, __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, 1249, __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, 1249, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":1250
 *         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, 1250, __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, 1250, __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, 1250, __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, 1250, __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, 1250, __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, 1250, __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, 1250, __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, 1250, __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":1251
 *             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, 1251, __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, 1251, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "mathics/builtin/graphics.py":1250
 *         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":1249
 * 
 *         def convert(expr):
 *             if expr.has_form(("List", "Directive"), None):             # <<<<<<<<<<<<<<
 *                 for item in expr.leaves:
 *                     convert(item)
 */
    goto __pyx_L3;
  }

  /* "mathics/builtin/graphics.py":1253
 *                     convert(item)
 *             else:
 *                 style.append(expr)             # <<<<<<<<<<<<<<
 * 
 *         convert(expr)
 */
  /*else*/ {
    if (unlikely(!__pyx_cur_scope->__pyx_v_style)) { __Pyx_RaiseClosureNameError("style"); __PYX_ERR(0, 1253, __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, 1253, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "mathics/builtin/graphics.py":1248
 *         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":1245
 *         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_28_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_28_create_style *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_28_create_style(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_28_create_style, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_create_style *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1245, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }

  /* "mathics/builtin/graphics.py":1246
 * 
 *     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, 1246, __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, 1246, __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, 1246, __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":1248
 *         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__44)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1248, __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":1255
 *                 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, 1255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1256
 * 
 *         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":1245
 *         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":1258
 *         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":1259
 * 
 *     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, 1259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":1258
 *         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":1265
 *     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, 1265, __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, 1265, __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, 1265, __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, 1265, __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":1266
 * 
 *     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, 1266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1266, __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, 1266, __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, 1266, __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, 1266, __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, 1266, __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, 1266, __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, 1266, __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":1267
 *     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, 1267, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1268
 *         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, 1268, __pyx_L1_error)
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ymin, Py_None) < 0) __PYX_ERR(0, 1268, __pyx_L1_error)
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_pixel_width, Py_None) < 0) __PYX_ERR(0, 1268, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1269
 *         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
 *         self.content = content
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_pixel_height, Py_None) < 0) __PYX_ERR(0, 1269, __pyx_L1_error)
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_extent_width, Py_None) < 0) __PYX_ERR(0, 1269, __pyx_L1_error)
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_extent_height, Py_None) < 0) __PYX_ERR(0, 1269, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1270
 *         self.xmin = self.ymin = self.pixel_width = None
 *         self.pixel_height = self.extent_width = self.extent_height = None
 *         self.view_width = None             # <<<<<<<<<<<<<<
 *         self.content = content
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_view_width, Py_None) < 0) __PYX_ERR(0, 1270, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1271
 *         self.pixel_height = self.extent_width = self.extent_height = None
 *         self.view_width = None
 *         self.content = content             # <<<<<<<<<<<<<<
 * 
 *     def translate(self, coords):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_content, __pyx_v_content) < 0) __PYX_ERR(0, 1271, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1265
 *     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":1273
 *         self.content = content
 * 
 *     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, 1273, __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, 1273, __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, 1273, __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":1274
 * 
 *     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, 1274, __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":1275
 *     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, 1275, __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, 1275, __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, 1275, __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, 1275, __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":1276
 *         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, 1276, __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, 1276, __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, 1276, __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, 1276, __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":1278
 *             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, 1278, __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, 1278, __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, 1278, __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, 1278, __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, 1278, __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, 1278, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":1279
 *             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, 1279, __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, 1279, __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, 1279, __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, 1279, __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, 1279, __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, 1279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":1277
 *             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, 1277, __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":1281
 *                 (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, 1281, __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, 1281, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_3) {

      /* "mathics/builtin/graphics.py":1282
 *             ]
 *             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, 1282, __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, 1282, __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, 1282, __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, 1282, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "mathics/builtin/graphics.py":1281
 *                 (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":1283
 *             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, 1283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":1274
 * 
 *     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":1285
 *             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, 1285, __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, 1285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1285, __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":1273
 *         self.content = content
 * 
 *     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":1287
 *             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, 1287, __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, 1287, __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, 1287, __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":1288
 * 
 *     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, 1288, __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":1289
 *     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__45);
    __pyx_r = __pyx_tuple__45;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":1288
 * 
 *     def translate_absolute(self, d):
 *         if self.pixel_width is None:             # <<<<<<<<<<<<<<
 *             return (0, 0)
 *         else:
 */
  }

  /* "mathics/builtin/graphics.py":1291
 *             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":1292
 *         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, 1292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyFloat_FromDouble(__pyx_v_l); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1292, __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, 1292, __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, 1292, __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, 1292, __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, 1292, __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, 1292, __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, 1292, __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, 1292, __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, 1292, __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":1287
 *             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":1294
 *             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, 1294, __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, 1294, __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, 1294, __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":1295
 * 
 *     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, 1295, __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":1296
 *     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":1295
 * 
 *     def translate_relative(self, x):
 *         if self.pixel_width is None:             # <<<<<<<<<<<<<<
 *             return 0
 *         else:
 */
  }

  /* "mathics/builtin/graphics.py":1298
 *             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, 1298, __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, 1298, __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":1294
 *             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":1300
 *             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, 1300, __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, 1300, __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_9genexpr19__pyx_v_element = NULL;
  PyObject *__pyx_9genexpr20__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":1301
 * 
 *     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, 1301, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "mathics/builtin/graphics.py":1302
 *     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, 1302, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    { /* enter inner scope */

      /* "mathics/builtin/graphics.py":1303
 *         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, 1303, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_4);

      /* "mathics/builtin/graphics.py":1305
 *                 [
 *                     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, 1305, __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, 1305, __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, 1305, __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, 1305, __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, 1305, __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, 1305, __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, 1305, __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, 1305, __pyx_L6_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_5);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr19__pyx_v_element, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "mathics/builtin/graphics.py":1306
 *                     element.extent()
 *                     for element in self.elements
 *                     if element.is_completely_visible             # <<<<<<<<<<<<<<
 *                 ]
 *             )
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr19__pyx_v_element, __pyx_n_s_is_completely_visible); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1306, __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, 1306, __pyx_L6_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (__pyx_t_1) {

          /* "mathics/builtin/graphics.py":1304
 *             ext = total_extent(
 *                 [
 *                     element.extent()             # <<<<<<<<<<<<<<
 *                     for element in self.elements
 *                     if element.is_completely_visible
 */
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr19__pyx_v_element, __pyx_n_s_extent); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1304, __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, 1304, __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, 1303, __pyx_L6_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "mathics/builtin/graphics.py":1306
 *                     element.extent()
 *                     for element in self.elements
 *                     if element.is_completely_visible             # <<<<<<<<<<<<<<
 *                 ]
 *             )
 */
        }

        /* "mathics/builtin/graphics.py":1305
 *                 [
 *                     element.extent()
 *                     for element in self.elements             # <<<<<<<<<<<<<<
 *                     if element.is_completely_visible
 *                 ]
 */
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_element); __pyx_9genexpr19__pyx_v_element = 0;
      goto __pyx_L10_exit_scope;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_element); __pyx_9genexpr19__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, 1302, __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":1301
 * 
 *     def extent(self, completely_visible_only=False):
 *         if completely_visible_only:             # <<<<<<<<<<<<<<
 *             ext = total_extent(
 *                 [
 */
    goto __pyx_L3;
  }

  /* "mathics/builtin/graphics.py":1310
 *             )
 *         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, 1310, __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, 1310, __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, 1310, __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, 1310, __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, 1310, __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, 1310, __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, 1310, __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, 1310, __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, 1310, __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, 1310, __pyx_L13_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_6);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr20__pyx_v_element, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr20__pyx_v_element, __pyx_n_s_extent); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1310, __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, 1310, __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, 1310, __pyx_L13_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_element); __pyx_9genexpr20__pyx_v_element = 0;
      goto __pyx_L16_exit_scope;
      __pyx_L13_error:;
      __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_element); __pyx_9genexpr20__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, 1310, __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":1311
 *         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, 1311, __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, 1311, __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, 1311, __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, 1311, __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, 1311, __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":1312
 *             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, 1312, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1312, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_1) {

    /* "mathics/builtin/graphics.py":1313
 *         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":1314
 *         if xmin == xmax:
 *             if xmin is None:
 *                 return 0, 0, 0, 0             # <<<<<<<<<<<<<<
 *             xmin = 0
 *             xmax *= 2
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__46);
      __pyx_r = __pyx_tuple__46;
      goto __pyx_L0;

      /* "mathics/builtin/graphics.py":1313
 *         xmin, xmax, ymin, ymax = ext
 *         if xmin == xmax:
 *             if xmin is None:             # <<<<<<<<<<<<<<
 *                 return 0, 0, 0, 0
 *             xmin = 0
 */
    }

    /* "mathics/builtin/graphics.py":1315
 *             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":1316
 *                 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, 1316, __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":1312
 *             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":1317
 *             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, 1317, __pyx_L1_error)
  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1317, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_12) {

    /* "mathics/builtin/graphics.py":1318
 *             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":1319
 *         if ymin == ymax:
 *             if ymin is None:
 *                 return 0, 0, 0, 0             # <<<<<<<<<<<<<<
 *             ymin = 0
 *             ymax *= 2
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__46);
      __pyx_r = __pyx_tuple__46;
      goto __pyx_L0;

      /* "mathics/builtin/graphics.py":1318
 *             xmax *= 2
 *         if ymin == ymax:
 *             if ymin is None:             # <<<<<<<<<<<<<<
 *                 return 0, 0, 0, 0
 *             ymin = 0
 */
    }

    /* "mathics/builtin/graphics.py":1320
 *             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":1321
 *                 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, 1321, __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":1317
 *             xmin = 0
 *             xmax *= 2
 *         if ymin == ymax:             # <<<<<<<<<<<<<<
 *             if ymin is None:
 *                 return 0, 0, 0, 0
 */
  }

  /* "mathics/builtin/graphics.py":1322
 *             ymin = 0
 *             ymax *= 2
 *         return xmin, xmax, ymin, ymax             # <<<<<<<<<<<<<<
 * 
 *     def set_size(
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1322, __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":1300
 *             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_9genexpr19__pyx_v_element);
  __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_element);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1324
 *         return xmin, xmax, ymin, ymax
 * 
 *     def set_size(             # <<<<<<<<<<<<<<
 *         self, xmin, ymin, extent_width, extent_height, pixel_width, pixel_height
 *     ):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_16GraphicsElements_11set_size(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_16GraphicsElements_11set_size = {"set_size", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_16GraphicsElements_11set_size, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_16GraphicsElements_11set_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, 1324, __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, 1324, __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, 1324, __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, 1324, __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, 1324, __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, 1324, __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, 1324, __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, 1324, __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_10set_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_10set_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":1328
 *     ):
 * 
 *         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, 1328, __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, 1328, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1329
 * 
 *         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, 1329, __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, 1329, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1330
 *         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, 1330, __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, 1330, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1324
 *         return xmin, xmax, ymin, ymax
 * 
 *     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;
}

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct__apply_makeboxes *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct__apply_makeboxes[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct__apply_makeboxes = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct__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__apply_makeboxes > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct__apply_makeboxes)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct__apply_makeboxes[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct__apply_makeboxes];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct__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__apply_makeboxes(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct__apply_makeboxes *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct__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__apply_makeboxes < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct__apply_makeboxes)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct__apply_makeboxes[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct__apply_makeboxes++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct__apply_makeboxes *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct__apply_makeboxes(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct__apply_makeboxes *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct__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__apply_makeboxes(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct__apply_makeboxes *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct__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__apply_makeboxes = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct__apply_makeboxes", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct__apply_makeboxes), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct__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__apply_makeboxes, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct__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__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_1_convert *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_1_convert[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_1_convert = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_1_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_1_convert > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_convert)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_1_convert[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_1_convert];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_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_1_convert(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_convert *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_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_1_convert < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_convert)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_1_convert[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_1_convert++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_convert *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_1_convert(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_convert *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_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_1_convert(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_convert *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_convert *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct__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_1_convert = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_1_convert", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_convert), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_1_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_1_convert, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_1_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_1_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_2_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_2_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_2_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2_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_2_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2_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_2_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_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_2_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_2_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  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_leaf);
  Py_CLEAR(p->__pyx_t_0);
  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_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_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_do_init *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_4_do_init[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_4_do_init = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_4_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_4_do_init > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_do_init)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_4_do_init[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_4_do_init];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_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_4_do_init(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_do_init *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_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_4_do_init < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_do_init)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_4_do_init[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_4_do_init++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_do_init *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_4_do_init(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_do_init *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_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_4_do_init(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_do_init *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_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_4_do_init = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_4_do_init", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_do_init), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_4_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_4_do_init, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_4_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_4_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_5_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_5_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_5_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_5_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_5_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_5_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_5_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_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_5_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_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_5_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_5_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_5_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_5_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_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_5_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_5_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_5_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #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_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_5_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if 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__svg_bezier *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_6__svg_bezier[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_6__svg_bezier = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_6__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_6__svg_bezier > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6__svg_bezier)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_6__svg_bezier[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_6__svg_bezier];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6__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_6__svg_bezier(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6__svg_bezier *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6__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_6__svg_bezier < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6__svg_bezier)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_6__svg_bezier[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_6__svg_bezier++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6__svg_bezier *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_6__svg_bezier(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6__svg_bezier *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6__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_6__svg_bezier = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_6__svg_bezier", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6__svg_bezier), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_6__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_6__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_6__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_7_path *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_7_path[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_7_path = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_7_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_7_path > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_path)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_7_path[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_7_path];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_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_7_path(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_path *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_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_7_path < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_path)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_7_path[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_7_path++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_path *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_7_path(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_path *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_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_7_path = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_7_path", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_path), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_7_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_7_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_7_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_8_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_8_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_8_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_8_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_8_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_8_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_8_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_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_8_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_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_8_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_8_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_8_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_8_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_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_8_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_8_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_8_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #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_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_8_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if 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_heads *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_9_heads[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_9_heads = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_9_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_9_heads > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_heads)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_9_heads[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_9_heads];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_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_9_heads(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_heads *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_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_9_heads < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_heads)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_9_heads[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_9_heads++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_heads *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_9_heads(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_heads *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_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_9_heads = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_9_heads", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_heads), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_9_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_9_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_9_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_10_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_10_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_10_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_10_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_10_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_10_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_10_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_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_10_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_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_10_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_10_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_10_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_10_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_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_10_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_10_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_10_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_10_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_10_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_11_make_draw_svg *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_11_make_draw_svg[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_11_make_draw_svg = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_11_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_11_make_draw_svg > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_make_draw_svg)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_11_make_draw_svg[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_11_make_draw_svg];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_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_11_make_draw_svg(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_make_draw_svg *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_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_11_make_draw_svg < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_make_draw_svg)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_11_make_draw_svg[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_11_make_draw_svg++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_make_draw_svg *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_11_make_draw_svg(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_make_draw_svg *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_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_11_make_draw_svg(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_make_draw_svg *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_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_11_make_draw_svg = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_11_make_draw_svg", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_make_draw_svg), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_11_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_11_make_draw_svg, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_11_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_11_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_12_draw *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_12_draw[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_12_draw = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_12_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_12_draw > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_draw)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_12_draw[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_12_draw];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_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_12_draw(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_draw *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_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_12_draw < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_draw)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_12_draw[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_12_draw++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_draw *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_12_draw(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_draw *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_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_12_draw = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_12_draw", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_draw), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_12_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_12_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_12_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_13_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_13_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_13_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_13_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_13_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_13_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_13_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_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_13_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_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_13_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_13_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_13_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_13_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_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_13_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_13_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_13_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_13_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_13_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_14_make_draw_asy *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_14_make_draw_asy[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_14_make_draw_asy = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_14_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_14_make_draw_asy > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_make_draw_asy)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_14_make_draw_asy[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_14_make_draw_asy];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_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_14_make_draw_asy(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_make_draw_asy *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_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_14_make_draw_asy < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_make_draw_asy)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_14_make_draw_asy[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_14_make_draw_asy++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_make_draw_asy *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_14_make_draw_asy(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_make_draw_asy *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_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_14_make_draw_asy(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_make_draw_asy *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_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_14_make_draw_asy = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_14_make_draw_asy", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_make_draw_asy), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_14_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_14_make_draw_asy, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_14_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_14_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_15_draw *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_15_draw[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_15_draw = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_15_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_15_draw > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_15_draw)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_15_draw[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_15_draw];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_15_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_15_draw(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_15_draw *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_15_draw *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_points);
  Py_CLEAR(p->__pyx_9genexpr11__pyx_v_xy);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_15_draw < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_15_draw)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_15_draw[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_15_draw++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_15_draw *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_15_draw(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_15_draw *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_15_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_9genexpr11__pyx_v_xy) {
    e = (*v)(p->__pyx_9genexpr11__pyx_v_xy, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_15_draw = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_15_draw", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_15_draw), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_15_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_15_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_15_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_16_arrows *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_16_arrows[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_16_arrows = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_16_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_16_arrows > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_arrows)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_16_arrows[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_16_arrows];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_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_16_arrows(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_arrows *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_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_16_arrows < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_arrows)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_16_arrows[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_16_arrows++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_arrows *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_16_arrows(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_arrows *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_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_16_arrows = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_16_arrows", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_arrows), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_16_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_16_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_16_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_17_segments *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_17_segments[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_17_segments = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_17_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_17_segments > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_17_segments)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_17_segments[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_17_segments];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_17_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_17_segments(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_17_segments *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_17_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_17_segments < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_17_segments)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_17_segments[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_17_segments++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_17_segments *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_17_segments(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_17_segments *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_17_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_17_segments = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_17_segments", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_17_segments), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_17_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_17_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_17_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_18_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_18_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_18_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_18_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_18_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_18_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_18_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_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_18_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_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_18_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_18_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_18_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_18_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_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_18_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_18_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_18_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_18_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_18_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_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_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_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_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_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_make_draw_svg *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_20_make_draw_svg[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_20_make_draw_svg = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_20_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_20_make_draw_svg > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20_make_draw_svg)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_20_make_draw_svg[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_20_make_draw_svg];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20_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_20_make_draw_svg(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20_make_draw_svg *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20_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_20_make_draw_svg < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20_make_draw_svg)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_20_make_draw_svg[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_20_make_draw_svg++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20_make_draw_svg *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_20_make_draw_svg(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20_make_draw_svg *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20_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_20_make_draw_svg(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20_make_draw_svg *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20_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_20_make_draw_svg = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_20_make_draw_svg", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20_make_draw_svg), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_20_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_20_make_draw_svg, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_20_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_20_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_21_draw *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_21_draw[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_21_draw = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_21_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_21_draw > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_draw)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_21_draw[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_21_draw];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_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_21_draw(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_draw *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_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_21_draw < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_draw)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_21_draw[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_21_draw++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_draw *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_21_draw(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_draw *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_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_21_draw = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_21_draw", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_draw), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_21_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_21_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_21_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_22_make_draw_asy *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_22_make_draw_asy[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_22_make_draw_asy = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_22_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_22_make_draw_asy > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_make_draw_asy)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_22_make_draw_asy[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_22_make_draw_asy];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_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_22_make_draw_asy(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_make_draw_asy *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_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_22_make_draw_asy < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_make_draw_asy)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_22_make_draw_asy[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_22_make_draw_asy++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_make_draw_asy *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_22_make_draw_asy(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_make_draw_asy *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_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_22_make_draw_asy(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_make_draw_asy *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_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_22_make_draw_asy = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_22_make_draw_asy", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_make_draw_asy), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_22_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_22_make_draw_asy, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_22_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_22_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_23_draw *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_23_draw[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_23_draw = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_23_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_23_draw > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23_draw)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_23_draw[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_23_draw];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23_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_23_draw(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23_draw *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23_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_23_draw < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23_draw)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_23_draw[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_23_draw++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23_draw *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_23_draw(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23_draw *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23_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_23_draw = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_23_draw", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23_draw), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_23_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_23_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_23_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_24_arrows *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_24_arrows[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_24_arrows = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_24_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_24_arrows > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_24_arrows)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_24_arrows[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_24_arrows];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_24_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_24_arrows(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_24_arrows *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_24_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_24_arrows < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_24_arrows)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_24_arrows[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_24_arrows++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_24_arrows *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_24_arrows(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_24_arrows *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_24_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_24_arrows = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_24_arrows", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_24_arrows), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_24_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_24_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_24_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_25__flatten *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_25__flatten[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_25__flatten = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_25__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_25__flatten > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25__flatten)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_25__flatten[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_25__flatten];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25__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_25__flatten(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25__flatten *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25__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_25__flatten < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25__flatten)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_25__flatten[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_25__flatten++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25__flatten *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_25__flatten(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25__flatten *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25__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_25__flatten = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_25__flatten", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25__flatten), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_25__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_25__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_25__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_26___init__ *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_26___init__[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_26___init__ = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_26___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_26___init__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26___init__)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_26___init__[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_26___init__];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26___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_26___init__(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26___init__ *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26___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_26___init__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26___init__)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_26___init__[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_26___init__++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26___init__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_26___init__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26___init__ *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26___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_26___init__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26___init__ *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26___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_26___init__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_26___init__", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26___init__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_26___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_26___init__, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_26___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_26___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_27_convert *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_27_convert[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_27_convert = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_27_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_27_convert > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_27_convert)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_27_convert[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_27_convert];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_27_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_27_convert(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_27_convert *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_27_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_27_convert < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_27_convert)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_27_convert[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_27_convert++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_27_convert *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_27_convert(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_27_convert *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_27_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_27_convert = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_27_convert", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_27_convert), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_27_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_27_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_27_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_28_create_style *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_28_create_style[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_28_create_style = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_28_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_28_create_style > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_create_style)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_28_create_style[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_28_create_style];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_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_28_create_style(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_create_style *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_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_28_create_style < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_create_style)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_28_create_style[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_28_create_style++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_create_style *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_28_create_style(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_create_style *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_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_28_create_style(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_create_style *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_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_28_create_style = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_28_create_style", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_create_style), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_28_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_28_create_style, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_28_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_28_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 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_5g_5g, __pyx_k_5g_5g, sizeof(__pyx_k_5g_5g), 0, 1, 0, 0},
  {&__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_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_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_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_BezierCurve, __pyx_k_BezierCurve, sizeof(__pyx_k_BezierCurve), 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_u_Box, __pyx_k_Box, sizeof(__pyx_k_Box), 0, 1, 0, 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_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_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_Color, __pyx_k_Color, sizeof(__pyx_k_Color), 0, 0, 1, 1},
  {&__pyx_n_s_ColorError, __pyx_k_ColorError, sizeof(__pyx_k_ColorError), 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_u_Cylinder, __pyx_k_Cylinder, sizeof(__pyx_k_Cylinder), 0, 1, 0, 1},
  {&__pyx_n_s_DEFAULT_POINT_FACTOR, __pyx_k_DEFAULT_POINT_FACTOR, sizeof(__pyx_k_DEFAULT_POINT_FACTOR), 0, 0, 1, 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_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_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_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_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_n_s_GLOBALS, __pyx_k_GLOBALS, sizeof(__pyx_k_GLOBALS), 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_s_Graphics3D, __pyx_k_Graphics3D, sizeof(__pyx_k_Graphics3D), 0, 0, 1, 1},
  {&__pyx_n_s_Graphics3DBox, __pyx_k_Graphics3DBox, sizeof(__pyx_k_Graphics3DBox), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsBox, __pyx_k_GraphicsBox, sizeof(__pyx_k_GraphicsBox), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsElement, __pyx_k_GraphicsElement, sizeof(__pyx_k_GraphicsElement), 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_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_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_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_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_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_u_ImageSizeMultipliers, __pyx_k_ImageSizeMultipliers, sizeof(__pyx_k_ImageSizeMultipliers), 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_Integer, __pyx_k_Integer, sizeof(__pyx_k_Integer), 0, 0, 1, 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_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_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_Line, __pyx_k_Line, sizeof(__pyx_k_Line), 0, 0, 1, 1},
  {&__pyx_n_u_Line, __pyx_k_Line, sizeof(__pyx_k_Line), 0, 1, 0, 1},
  {&__pyx_n_s_Line_2, __pyx_k_Line_2, sizeof(__pyx_k_Line_2), 0, 0, 1, 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_kp_u_M_f_f, __pyx_k_M_f_f, sizeof(__pyx_k_M_f_f), 0, 1, 0, 0},
  {&__pyx_n_s_Medium, __pyx_k_Medium, sizeof(__pyx_k_Medium), 0, 0, 1, 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_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_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_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_absolute_size, __pyx_k_PointSize_get_absolute_size, sizeof(__pyx_k_PointSize_get_absolute_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_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_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_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_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_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_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_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_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_n_s_SymbolList, __pyx_k_SymbolList, sizeof(__pyx_k_SymbolList), 0, 0, 1, 1},
  {&__pyx_n_s_SymbolMakeBoxes, __pyx_k_SymbolMakeBoxes, sizeof(__pyx_k_SymbolMakeBoxes), 0, 0, 1, 1},
  {&__pyx_n_s_SymbolN, __pyx_k_SymbolN, sizeof(__pyx_k_SymbolN), 0, 0, 1, 1},
  {&__pyx_kp_u_System, __pyx_k_System, sizeof(__pyx_k_System), 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_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_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_Large, __pyx_k_System_Large, sizeof(__pyx_k_System_Large), 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_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_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_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_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_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 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_kp_u__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0, 0},
  {&__pyx_kp_u__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 1, 0, 0},
  {&__pyx_kp_u__22, __pyx_k__22, sizeof(__pyx_k__22), 0, 1, 0, 0},
  {&__pyx_kp_u__25, __pyx_k__25, sizeof(__pyx_k__25), 0, 1, 0, 0},
  {&__pyx_kp_u__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 1, 0, 0},
  {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0},
  {&__pyx_kp_u__47, __pyx_k__47, sizeof(__pyx_k__47), 0, 1, 0, 0},
  {&__pyx_n_s__60, __pyx_k__60, sizeof(__pyx_k__60), 0, 0, 1, 1},
  {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1},
  {&__pyx_n_s_allow_forms, __pyx_k_allow_forms, sizeof(__pyx_k_allow_forms), 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_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_size, __pyx_k_arrow_size, sizeof(__pyx_k_arrow_size), 0, 0, 1, 1},
  {&__pyx_n_s_arrows, __pyx_k_arrows, sizeof(__pyx_k_arrows), 0, 0, 1, 1},
  {&__pyx_n_u_asy, __pyx_k_asy, sizeof(__pyx_k_asy), 0, 1, 0, 1},
  {&__pyx_n_s_asy_bezier, __pyx_k_asy_bezier, sizeof(__pyx_k_asy_bezier), 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_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_border, __pyx_k_border, sizeof(__pyx_k_border), 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_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_c, __pyx_k_c, sizeof(__pyx_k_c), 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_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  {&__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_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_completely_visible_only, __pyx_k_completely_visible_only, sizeof(__pyx_k_completely_visible_only), 0, 0, 1, 1},
  {&__pyx_n_s_components, __pyx_k_components, sizeof(__pyx_k_components), 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_convert, __pyx_k_convert, sizeof(__pyx_k_convert), 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_cp, __pyx_k_cp, sizeof(__pyx_k_cp), 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_css, __pyx_k_create_css, sizeof(__pyx_k_create_css), 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_custom_arrow, __pyx_k_custom_arrow, sizeof(__pyx_k_custom_arrow), 0, 0, 1, 1},
  {&__pyx_n_s_cut, __pyx_k_cut, sizeof(__pyx_k_cut), 0, 0, 1, 1},
  {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1},
  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
  {&__pyx_n_s_data_and_options, __pyx_k_data_and_options, sizeof(__pyx_k_data_and_options), 0, 0, 1, 1},
  {&__pyx_n_s_dcp, __pyx_k_dcp, sizeof(__pyx_k_dcp), 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_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_dir, __pyx_k_dir, sizeof(__pyx_k_dir), 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_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_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_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_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_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_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_draw, __pyx_k_draw, sizeof(__pyx_k_draw), 0, 0, 1, 1},
  {&__pyx_kp_u_draw_2, __pyx_k_draw_2, sizeof(__pyx_k_draw_2), 0, 1, 0, 0},
  {&__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_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_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_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 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_expr, __pyx_k_expr, sizeof(__pyx_k_expr), 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_ey, __pyx_k_ey, sizeof(__pyx_k_ey), 0, 0, 1, 1},
  {&__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_none, __pyx_k_fill_none, sizeof(__pyx_k_fill_none), 0, 1, 0, 0},
  {&__pyx_n_s_fill_opacity, __pyx_k_fill_opacity, sizeof(__pyx_k_fill_opacity), 0, 0, 1, 1},
  {&__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_s, __pyx_k_fill_s, sizeof(__pyx_k_fill_s), 0, 1, 0, 0},
  {&__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_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
  {&__pyx_n_s_format_fn, __pyx_k_format_fn, sizeof(__pyx_k_format_fn), 0, 0, 1, 1},
  {&__pyx_n_s_forms, __pyx_k_forms, sizeof(__pyx_k_forms), 0, 0, 1, 1},
  {&__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_absolute_size, __pyx_k_get_absolute_size, sizeof(__pyx_k_get_absolute_size), 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_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_options, __pyx_k_get_options, sizeof(__pyx_k_get_options), 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_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_h, __pyx_k_h, sizeof(__pyx_k_h), 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_heads, __pyx_k_heads, sizeof(__pyx_k_heads), 0, 0, 1, 1},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 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_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_inset, __pyx_k_inset, sizeof(__pyx_k_inset), 0, 0, 1, 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_numeric, __pyx_k_is_numeric, sizeof(__pyx_k_is_numeric), 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_k, __pyx_k_k, sizeof(__pyx_k_k), 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_l, __pyx_k_l, sizeof(__pyx_k_l), 0, 0, 1, 1},
  {&__pyx_n_s_lambda, __pyx_k_lambda, sizeof(__pyx_k_lambda), 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_leaves_2, __pyx_k_leaves_2, sizeof(__pyx_k_leaves_2), 0, 0, 1, 1},
  {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1},
  {&__pyx_n_s_line, __pyx_k_line, sizeof(__pyx_k_line), 0, 0, 1, 1},
  {&__pyx_n_s_lines, __pyx_k_lines, sizeof(__pyx_k_lines), 0, 0, 1, 1},
  {&__pyx_n_s_lookup_method, __pyx_k_lookup_method, sizeof(__pyx_k_lookup_method), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 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_math, __pyx_k_math, sizeof(__pyx_k_math), 0, 0, 1, 1},
  {&__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_box_graphics, __pyx_k_mathics_builtin_box_graphics, sizeof(__pyx_k_mathics_builtin_box_graphics), 0, 0, 1, 1},
  {&__pyx_n_s_mathics_builtin_box_graphics3d, __pyx_k_mathics_builtin_box_graphics3d, sizeof(__pyx_k_mathics_builtin_box_graphics3d), 0, 0, 1, 1},
  {&__pyx_n_s_mathics_builtin_colors_color_dir, __pyx_k_mathics_builtin_colors_color_dir, sizeof(__pyx_k_mathics_builtin_colors_color_dir), 0, 0, 1, 1},
  {&__pyx_n_s_mathics_builtin_drawing_graphics, __pyx_k_mathics_builtin_drawing_graphics, sizeof(__pyx_k_mathics_builtin_drawing_graphics), 0, 0, 1, 1},
  {&__pyx_n_s_mathics_builtin_drawing_graphics_2, __pyx_k_mathics_builtin_drawing_graphics_2, sizeof(__pyx_k_mathics_builtin_drawing_graphics_2), 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_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_formatter, __pyx_k_mathics_core_formatter, sizeof(__pyx_k_mathics_core_formatter), 0, 0, 1, 1},
  {&__pyx_n_s_mathics_format_asy_fns, __pyx_k_mathics_format_asy_fns, sizeof(__pyx_k_mathics_format_asy_fns), 0, 0, 1, 1},
  {&__pyx_n_s_mathics_version, __pyx_k_mathics_version, sizeof(__pyx_k_mathics_version), 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_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 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_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_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_n_s_neg_y, __pyx_k_neg_y, sizeof(__pyx_k_neg_y), 0, 0, 1, 1},
  {&__pyx_n_s_new_item, __pyx_k_new_item, sizeof(__pyx_k_new_item), 0, 0, 1, 1},
  {&__pyx_n_s_new_leaves, __pyx_k_new_leaves, sizeof(__pyx_k_new_leaves), 0, 0, 1, 1},
  {&__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_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_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_opts, __pyx_k_opts, sizeof(__pyx_k_opts), 0, 0, 1, 1},
  {&__pyx_n_s_ox, __pyx_k_ox, sizeof(__pyx_k_ox), 0, 0, 1, 1},
  {&__pyx_n_s_oy, __pyx_k_oy, sizeof(__pyx_k_oy), 0, 0, 1, 1},
  {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 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_pen, __pyx_k_pen, sizeof(__pyx_k_pen), 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_point, __pyx_k_point, sizeof(__pyx_k_point), 0, 0, 1, 1},
  {&__pyx_n_s_points, __pyx_k_points, sizeof(__pyx_k_points), 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_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_px, __pyx_k_px, sizeof(__pyx_k_px), 0, 0, 1, 1},
  {&__pyx_n_s_py, __pyx_k_py, sizeof(__pyx_k_py), 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_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_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__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_round_to_float, __pyx_k_round_to_float, sizeof(__pyx_k_round_to_float), 0, 0, 1, 1},
  {&__pyx_n_s_rules, __pyx_k_rules, sizeof(__pyx_k_rules), 0, 0, 1, 1},
  {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1},
  {&__pyx_kp_u_s_2, __pyx_k_s_2, sizeof(__pyx_k_s_2), 0, 1, 0, 0},
  {&__pyx_n_s_seg, __pyx_k_seg, sizeof(__pyx_k_seg), 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_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 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_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_kp_u_stroke_none, __pyx_k_stroke_none, sizeof(__pyx_k_stroke_none), 0, 1, 0, 0},
  {&__pyx_n_s_stroke_opacity, __pyx_k_stroke_opacity, sizeof(__pyx_k_stroke_opacity), 0, 0, 1, 1},
  {&__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_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_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_u_svg, __pyx_k_svg, sizeof(__pyx_k_svg), 0, 1, 0, 1},
  {&__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_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_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_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
  {&__pyx_n_s_tl, __pyx_k_tl, sizeof(__pyx_k_tl), 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_float, __pyx_k_to_float, sizeof(__pyx_k_to_float), 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_translate, __pyx_k_translate, sizeof(__pyx_k_translate), 0, 0, 1, 1},
  {&__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_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_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_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 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_w, __pyx_k_w, sizeof(__pyx_k_w), 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_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_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, 84, __pyx_L1_error)
  __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 205, __pyx_L1_error)
  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 366, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 878, __pyx_L1_error)
  __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 928, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 914, __pyx_L1_error)
  __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 953, __pyx_L1_error)
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 977, __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":76
 * 
 * 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, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "mathics/builtin/graphics.py":90
 *         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, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "mathics/builtin/graphics.py":309
 *                 )
 *             elif head == "System`Style":
 *                 return Expression(             # <<<<<<<<<<<<<<
 *                     "StyleBox", *[convert(item) for item in content.leaves]
 *                 )
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_u_StyleBox); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "mathics/builtin/graphics.py":332
 *                         n_leaves = [inset] + [
 *                             Expression(SymbolN, leaf).evaluate(evaluation)
 *                             for leaf in content.leaves[1:]             # <<<<<<<<<<<<<<
 *                         ]
 *                     else:
 */
  __pyx_slice__5 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__5)) __PYX_ERR(0, 332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__5);
  __Pyx_GIVEREF(__pyx_slice__5);

  /* "mathics/builtin/graphics.py":301
 *         StandardForm|TraditionalForm|OutputForm]"""
 * 
 *         def convert(content):             # <<<<<<<<<<<<<<
 *             head = content.get_head_name()
 * 
 */
  __pyx_tuple__6 = PyTuple_Pack(12, __pyx_n_s_content, __pyx_n_s_head, __pyx_n_s_atoms, __pyx_n_s_inset, __pyx_n_s_opts, __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__6)) __PYX_ERR(0, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);
  __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(1, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_convert, 301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 301, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":578
 *             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__8 = PyTuple_Pack(2, __pyx_n_u_List, Py_None); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "mathics/builtin/graphics.py":669
 *     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__11 = 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__11)) __PYX_ERR(0, 669, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);
  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_path, 669, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 669, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":897
 * 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__14 = PyTuple_Pack(3, __pyx_n_s_points, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);
  __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 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_draw, 897, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 897, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":905
 * 
 *     def make_draw_asy(self, pen):
 *         def draw(points):             # <<<<<<<<<<<<<<
 *             yield "draw("
 *             yield "--".join(["(%.5g,%5g)" % xy for xy in points])
 */
  __pyx_tuple__17 = PyTuple_Pack(2, __pyx_n_s_points, __pyx_n_s_xy); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);
  __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_draw, 905, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 905, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":913
 * 
 *     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__20 = 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__20)) __PYX_ERR(0, 913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);
  __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 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_segments, 913, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 913, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":985
 * 
 *     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__23 = PyTuple_Pack(2, __pyx_n_s_points, __pyx_n_s_s); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 985, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);
  __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_draw, 985, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 985, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":992
 * 
 *     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__27 = PyTuple_Pack(2, __pyx_n_s_points, __pyx_n_s_path); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);
  __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 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_draw, 992, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 992, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1101
 *     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_slice__30 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__30)) __PYX_ERR(0, 1101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__30);
  __Pyx_GIVEREF(__pyx_slice__30);

  /* "mathics/builtin/graphics.py":1106
 * 
 *     def get_default_face_color(self):
 *         return RGBColor(components=(0, 0, 0, 1))             # <<<<<<<<<<<<<<
 * 
 *     def get_default_edge_color(self):
 */
  __pyx_tuple__31 = PyTuple_Pack(4, __pyx_int_0, __pyx_int_0, __pyx_int_0, __pyx_int_1); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 1106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);

  /* "mathics/builtin/graphics.py":1224
 *                     ):
 *                         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__33 = PySlice_New(__pyx_int_neg_3, Py_None, Py_None); if (unlikely(!__pyx_slice__33)) __PYX_ERR(0, 1224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__33);
  __Pyx_GIVEREF(__pyx_slice__33);

  /* "mathics/builtin/graphics.py":1227
 *                     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__34 = PySlice_New(Py_None, __pyx_int_neg_3, Py_None); if (unlikely(!__pyx_slice__34)) __PYX_ERR(0, 1227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__34);
  __Pyx_GIVEREF(__pyx_slice__34);

  /* "mathics/builtin/graphics.py":1178
 *         builtins = evaluation.definitions.builtin
 * 
 *         def get_options(name):             # <<<<<<<<<<<<<<
 *             builtin = builtins.get(name)
 *             if builtin is None:
 */
  __pyx_tuple__35 = PyTuple_Pack(2, __pyx_n_s_name, __pyx_n_s_builtin); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 1178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);
  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_get_options, 1178, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 1178, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1184
 *             return builtin.options
 * 
 *         def stylebox_style(style, specs):             # <<<<<<<<<<<<<<
 *             new_style = style.clone()
 *             for spec in _flatten(specs):
 */
  __pyx_tuple__37 = 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__37)) __PYX_ERR(0, 1184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);
  __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 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_stylebox_style, 1184, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 1184, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1205
 *             return new_style
 * 
 *         def convert(content, style):             # <<<<<<<<<<<<<<
 *             if content.has_form("List", None):
 *                 items = content.leaves
 */
  __pyx_tuple__39 = 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__39)) __PYX_ERR(0, 1205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);
  __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 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_convert, 1205, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 1205, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1249
 * 
 *         def convert(expr):
 *             if expr.has_form(("List", "Directive"), None):             # <<<<<<<<<<<<<<
 *                 for item in expr.leaves:
 *                     convert(item)
 */
  __pyx_tuple__41 = PyTuple_Pack(2, __pyx_n_u_List, __pyx_n_u_Directive); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 1249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);
  __pyx_tuple__42 = PyTuple_Pack(2, __pyx_tuple__41, Py_None); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 1249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

  /* "mathics/builtin/graphics.py":1248
 *         style = self.get_style_class()(self)
 * 
 *         def convert(expr):             # <<<<<<<<<<<<<<
 *             if expr.has_form(("List", "Directive"), None):
 *                 for item in expr.leaves:
 */
  __pyx_tuple__43 = PyTuple_Pack(2, __pyx_n_s_expr, __pyx_n_s_item); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 1248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);
  __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_convert, 1248, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 1248, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1289
 *     def translate_absolute(self, d):
 *         if self.pixel_width is None:
 *             return (0, 0)             # <<<<<<<<<<<<<<
 *         else:
 *             l = 96.0 / 72
 */
  __pyx_tuple__45 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 1289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "mathics/builtin/graphics.py":1314
 *         if xmin == xmax:
 *             if xmin is None:
 *                 return 0, 0, 0, 0             # <<<<<<<<<<<<<<
 *             xmin = 0
 *             xmax *= 2
 */
  __pyx_tuple__46 = PyTuple_Pack(4, __pyx_int_0, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 1314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);

  /* "mathics/builtin/graphics.py":75
 * 
 * 
 * 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__48 = PyTuple_Pack(3, __pyx_n_s_value, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);
  __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 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_coords, 75, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 75, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":84
 * 
 * 
 * class Coords(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, graphics, expr=None, pos=None, d=None):
 *         self.graphics = graphics
 */
  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);

  /* "mathics/builtin/graphics.py":85
 * 
 * class Coords(object):
 *     def __init__(self, graphics, expr=None, pos=None, d=None):             # <<<<<<<<<<<<<<
 *         self.graphics = graphics
 *         self.p = pos
 */
  __pyx_tuple__51 = 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__51)) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);
  __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_init_2, 85, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 85, __pyx_L1_error)
  __pyx_tuple__53 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_GIVEREF(__pyx_tuple__53);

  /* "mathics/builtin/graphics.py":99
 *                 self.p = coords(expr)
 * 
 *     def pos(self):             # <<<<<<<<<<<<<<
 *         p = self.graphics.translate(self.p)
 *         p = (cut(p[0]), cut(p[1]))
 */
  __pyx_tuple__54 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_p, __pyx_n_s_d); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);
  __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(1, 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_pos, 99, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 99, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":107
 *         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__56 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_p); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__56);
  __Pyx_GIVEREF(__pyx_tuple__56);
  __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_add, 107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 107, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":112
 * 
 * 
 * def cut(value):             # <<<<<<<<<<<<<<
 *     "Cut values in graphics primitives (not displayed otherwise in SVG)"
 *     border = 10 ** 8
 */
  __pyx_tuple__58 = PyTuple_Pack(2, __pyx_n_s_value, __pyx_n_s_border); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);
  __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_cut, 112, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 112, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":122
 * 
 * 
 * def create_css(             # <<<<<<<<<<<<<<
 *     edge_color=None, face_color=None, stroke_width=None, font_color=None, opacity=1.0
 * ):
 */
  __pyx_tuple__61 = PyTuple_Pack(10, __pyx_n_s_edge_color, __pyx_n_s_face_color, __pyx_n_s_stroke_width, __pyx_n_s_font_color, __pyx_n_s_opacity, __pyx_n_s_css, __pyx_n_s_color, __pyx_n_s_stroke_opacity, __pyx_n_s_fill_opacity, __pyx_n_s__60); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);
  __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(5, 0, 10, 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_create_css, 122, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 122, __pyx_L1_error)
  __pyx_tuple__63 = PyTuple_Pack(5, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject*)__pyx_float_1_0)); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__63);
  __Pyx_GIVEREF(__pyx_tuple__63);

  /* "mathics/builtin/graphics.py":147
 * 
 * 
 * def _to_float(x):             # <<<<<<<<<<<<<<
 *     x = x.round_to_float()
 *     if x is None:
 */
  __pyx_tuple__64 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);
  __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_float, 147, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 147, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":154
 * 
 * 
 * def _data_and_options(leaves, defined_options):             # <<<<<<<<<<<<<<
 *     data = []
 *     options = defined_options.copy()
 */
  __pyx_tuple__66 = 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__66)) __PYX_ERR(0, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__66);
  __Pyx_GIVEREF(__pyx_tuple__66);
  __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_data_and_options, 154, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 154, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":175
 * 
 * 
 * def _extract_graphics(graphics, format, evaluation):             # <<<<<<<<<<<<<<
 *     graphics_box = Expression(SymbolMakeBoxes, graphics).evaluate(evaluation)
 *     # builtin = GraphicsBox(expression=False)
 */
  __pyx_tuple__68 = PyTuple_Pack(19, __pyx_n_s_graphics, __pyx_n_s_format, __pyx_n_s_evaluation, __pyx_n_s_graphics_box, __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__60, __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_format_fn, __pyx_n_s_code); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);
  __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(3, 0, 19, 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_extract_graphics, 175, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 175, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":223
 *     options = GRAPHICS_OPTIONS
 * 
 *     def apply(self, graphics, evaluation, options):             # <<<<<<<<<<<<<<
 *         """Show[graphics_, OptionsPattern[%(name)s]]"""
 * 
 */
  __pyx_tuple__70 = PyTuple_Pack(9, __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_leaf_name); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__70);
  __Pyx_GIVEREF(__pyx_tuple__70);
  __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_apply, 223, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 223, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":297
 *     box_suffix = "Box"
 * 
 *     def apply_makeboxes(self, content, evaluation, options):             # <<<<<<<<<<<<<<
 *         """MakeBoxes[%(name)s[content_, OptionsPattern[%(name)s]],
 *         StandardForm|TraditionalForm|OutputForm]"""
 */
  __pyx_tuple__72 = PyTuple_Pack(10, __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_GraphicsBox, __pyx_n_s_Graphics3DBox, __pyx_n_s_Graphics3D); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__72);
  __Pyx_GIVEREF(__pyx_tuple__72);
  __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_apply_makeboxes, 297, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 297, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":365
 * 
 * class _Size(_GraphicsElement):
 *     def init(self, graphics, item=None, value=None):             # <<<<<<<<<<<<<<
 *         super(_Size, self).init(graphics, item)
 *         if item is not None:
 */
  __pyx_tuple__74 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_graphics, __pyx_n_s_item, __pyx_n_s_value); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__74);
  __Pyx_GIVEREF(__pyx_tuple__74);
  __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_init, 365, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 365, __pyx_L1_error)
  __pyx_tuple__76 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);

  /* "mathics/builtin/graphics.py":393
 *     """
 * 
 *     def get_thickness(self):             # <<<<<<<<<<<<<<
 *         return self.graphics.translate_absolute((self.value, 0))[0]
 * 
 */
  __pyx_tuple__77 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__77);
  __Pyx_GIVEREF(__pyx_tuple__77);
  __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_get_thickness, 393, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(0, 393, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":409
 *     """
 * 
 *     def get_thickness(self):             # <<<<<<<<<<<<<<
 *         return self.graphics.translate_relative(self.value)
 * 
 */
  __pyx_tuple__79 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__79);
  __Pyx_GIVEREF(__pyx_tuple__79);
  __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_get_thickness, 409, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 409, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":450
 *     """
 * 
 *     def get_absolute_size(self):             # <<<<<<<<<<<<<<
 *         if self.graphics.view_width is None:
 *             self.graphics.view_width = 400
 */
  __pyx_tuple__81 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__81);
  __Pyx_GIVEREF(__pyx_tuple__81);
  __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_get_absolute_size, 450, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 450, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":572
 * 
 * class _Polyline(_GraphicsElement):
 *     def do_init(self, graphics, points):             # <<<<<<<<<<<<<<
 *         if not points.has_form("List", None):
 *             raise BoxConstructError
 */
  __pyx_tuple__83 = 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__83)) __PYX_ERR(0, 572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__83);
  __Pyx_GIVEREF(__pyx_tuple__83);
  __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_do_init, 572, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(0, 572, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":595
 *         ]
 * 
 *     def extent(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         result = []
 */
  __pyx_tuple__85 = 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__85)) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__85);
  __Pyx_GIVEREF(__pyx_tuple__85);
  __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_extent, 595, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(0, 595, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":657
 * 
 * 
 * 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__87 = 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__87)) __PYX_ERR(0, 657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__87);
  __Pyx_GIVEREF(__pyx_tuple__87);
  __pyx_codeobj__9 = (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__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_svg_bezier, 657, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 657, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":830
 *     }
 * 
 *     def init(self, graphics, item=None):             # <<<<<<<<<<<<<<
 *         super(Arrowheads, self).init(graphics, item)
 *         if len(item.leaves) != 1:
 */
  __pyx_tuple__88 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_graphics, __pyx_n_s_item); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__88);
  __Pyx_GIVEREF(__pyx_tuple__88);
  __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 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_init, 830, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(0, 830, __pyx_L1_error)
  __pyx_tuple__90 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);

  /* "mathics/builtin/graphics.py":836
 *         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__91 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_s, __pyx_n_s_extent, __pyx_n_s_size); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__91);
  __Pyx_GIVEREF(__pyx_tuple__91);
  __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_arrow_size, 836, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) __PYX_ERR(0, 836, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":843
 *             return _to_float(s) * extent
 * 
 *     def heads(self, extent, default_arrow, custom_arrow):             # <<<<<<<<<<<<<<
 *         # see https://reference.wolfram.com/language/ref/Arrowheads.html
 * 
 */
  __pyx_tuple__93 = 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__93)) __PYX_ERR(0, 843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__93);
  __Pyx_GIVEREF(__pyx_tuple__93);
  __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(4, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_heads, 843, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 843, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":884
 * 
 * 
 * def _norm(p, q):             # <<<<<<<<<<<<<<
 *     px, py = p
 *     qx, qy = q
 */
  __pyx_tuple__94 = 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__94)) __PYX_ERR(0, 884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__94);
  __Pyx_GIVEREF(__pyx_tuple__94);
  __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 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_norm, 884, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(0, 884, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":896
 * 
 * class _Line:
 *     def make_draw_svg(self, style):             # <<<<<<<<<<<<<<
 *         def draw(points):
 *             yield '<polyline points="'
 */
  __pyx_tuple__96 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_style, __pyx_n_s_draw, __pyx_n_s_draw); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 896, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__96);
  __Pyx_GIVEREF(__pyx_tuple__96);
  __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 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_draw_svg, 896, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(0, 896, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":904
 *         return draw
 * 
 *     def make_draw_asy(self, pen):             # <<<<<<<<<<<<<<
 *         def draw(points):
 *             yield "draw("
 */
  __pyx_tuple__98 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_pen, __pyx_n_s_draw, __pyx_n_s_draw); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__98);
  __Pyx_GIVEREF(__pyx_tuple__98);
  __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 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_make_draw_asy, 904, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 904, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":912
 *         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__100 = 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__100)) __PYX_ERR(0, 912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__100);
  __Pyx_GIVEREF(__pyx_tuple__100);
  __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(3, 0, 22, 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_arrows, 912, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 912, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":950
 * 
 * 
 * def _bezier_derivative(p):             # <<<<<<<<<<<<<<
 *     # see http://pomax.github.io/bezierinfo/, Section 12 Derivatives
 *     n = len(p[0]) - 1
 */
  __pyx_tuple__101 = 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__101)) __PYX_ERR(0, 950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__101);
  __Pyx_GIVEREF(__pyx_tuple__101);
  __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__101, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_bezier_derivative, 950, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(0, 950, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":956
 * 
 * 
 * def _bezier_evaluate(p, t):             # <<<<<<<<<<<<<<
 *     # see http://pomax.github.io/bezierinfo/, Section 4 Controlling Bezier Curvatures
 *     n = len(p[0]) - 1
 */
  __pyx_tuple__103 = 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__103)) __PYX_ERR(0, 956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__103);
  __Pyx_GIVEREF(__pyx_tuple__103);
  __pyx_codeobj__104 = (PyObject*)__Pyx_PyCode_New(2, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_bezier_evaluate, 956, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__104)) __PYX_ERR(0, 956, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":981
 * 
 * class _BezierCurve:
 *     def __init__(self, spline_degree=3):             # <<<<<<<<<<<<<<
 *         self.spline_degree = spline_degree
 * 
 */
  __pyx_tuple__105 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_spline_degree); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(0, 981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__105);
  __Pyx_GIVEREF(__pyx_tuple__105);
  __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_init_2, 981, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) __PYX_ERR(0, 981, __pyx_L1_error)
  __pyx_tuple__107 = PyTuple_Pack(1, ((PyObject *)__pyx_int_3)); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(0, 981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__107);
  __Pyx_GIVEREF(__pyx_tuple__107);

  /* "mathics/builtin/graphics.py":984
 *         self.spline_degree = spline_degree
 * 
 *     def make_draw_svg(self, style):             # <<<<<<<<<<<<<<
 *         def draw(points):
 *             s = " ".join(_svg_bezier((self.spline_degree, points)))
 */
  __pyx_tuple__108 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_style, __pyx_n_s_draw, __pyx_n_s_draw); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__108);
  __Pyx_GIVEREF(__pyx_tuple__108);
  __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_make_draw_svg, 984, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(0, 984, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":991
 *         return draw
 * 
 *     def make_draw_asy(self, pen):             # <<<<<<<<<<<<<<
 *         def draw(points):
 *             for path in asy_bezier((self.spline_degree, points)):
 */
  __pyx_tuple__110 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_pen, __pyx_n_s_draw, __pyx_n_s_draw); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(0, 991, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__110);
  __Pyx_GIVEREF(__pyx_tuple__110);
  __pyx_codeobj__111 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__110, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_make_draw_asy, 991, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__111)) __PYX_ERR(0, 991, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":998
 *         return draw
 * 
 *     def arrows(self, points, heads):  # heads has to be sorted by pos             # <<<<<<<<<<<<<<
 *         if len(points) < 2:
 *             return
 */
  __pyx_tuple__112 = 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__112)) __PYX_ERR(0, 998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__112);
  __Pyx_GIVEREF(__pyx_tuple__112);
  __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(3, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__112, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_arrows, 998, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 998, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1025
 * 
 * 
 * def total_extent(extents):             # <<<<<<<<<<<<<<
 *     xmin = xmax = ymin = ymax = None
 *     for extent in extents:
 */
  __pyx_tuple__113 = 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__113)) __PYX_ERR(0, 1025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__113);
  __Pyx_GIVEREF(__pyx_tuple__113);
  __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__113, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_total_extent, 1025, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) __PYX_ERR(0, 1025, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1056
 * 
 * 
 * def _style(graphics, item):             # <<<<<<<<<<<<<<
 *     head = item.get_head_name()
 *     if head in style_heads:
 */
  __pyx_tuple__115 = 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__115)) __PYX_ERR(0, 1056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__115);
  __Pyx_GIVEREF(__pyx_tuple__115);
  __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__115, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_style_3, 1056, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) __PYX_ERR(0, 1056, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1078
 * 
 * 
 * class Style(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, graphics, edge=False, face=False):
 *         self.styles = []
 */
  __pyx_tuple__117 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(0, 1078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__117);
  __Pyx_GIVEREF(__pyx_tuple__117);

  /* "mathics/builtin/graphics.py":1079
 * 
 * class Style(object):
 *     def __init__(self, graphics, edge=False, face=False):             # <<<<<<<<<<<<<<
 *         self.styles = []
 *         self.options = {}
 */
  __pyx_tuple__118 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_graphics, __pyx_n_s_edge, __pyx_n_s_face); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(0, 1079, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__118);
  __Pyx_GIVEREF(__pyx_tuple__118);
  __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 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_init_2, 1079, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) __PYX_ERR(0, 1079, __pyx_L1_error)
  __pyx_tuple__120 = PyTuple_Pack(2, ((PyObject *)Py_False), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(0, 1079, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__120);
  __Pyx_GIVEREF(__pyx_tuple__120);

  /* "mathics/builtin/graphics.py":1087
 *         self.klass = graphics.get_style_class()
 * 
 *     def append(self, item, allow_forms=True):             # <<<<<<<<<<<<<<
 *         self.styles.append(_style(self.graphics, item))
 * 
 */
  __pyx_tuple__121 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_item, __pyx_n_s_allow_forms); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(0, 1087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__121);
  __Pyx_GIVEREF(__pyx_tuple__121);
  __pyx_codeobj__122 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__121, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_append, 1087, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__122)) __PYX_ERR(0, 1087, __pyx_L1_error)
  __pyx_tuple__123 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(0, 1087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__123);
  __Pyx_GIVEREF(__pyx_tuple__123);

  /* "mathics/builtin/graphics.py":1090
 *         self.styles.append(_style(self.graphics, item))
 * 
 *     def set_option(self, name, value):             # <<<<<<<<<<<<<<
 *         self.options[name] = value
 * 
 */
  __pyx_tuple__124 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(0, 1090, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__124);
  __Pyx_GIVEREF(__pyx_tuple__124);
  __pyx_codeobj__125 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__124, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_set_option, 1090, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__125)) __PYX_ERR(0, 1090, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1093
 *         self.options[name] = value
 * 
 *     def extend(self, style, pre=True):             # <<<<<<<<<<<<<<
 *         if pre:
 *             self.styles = style.styles + self.styles
 */
  __pyx_tuple__126 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_style, __pyx_n_s_pre); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(0, 1093, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__126);
  __Pyx_GIVEREF(__pyx_tuple__126);
  __pyx_codeobj__127 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__126, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_extend, 1093, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__127)) __PYX_ERR(0, 1093, __pyx_L1_error)
  __pyx_tuple__128 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(0, 1093, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__128);
  __Pyx_GIVEREF(__pyx_tuple__128);

  /* "mathics/builtin/graphics.py":1099
 *             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__129 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_result); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(0, 1099, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__129);
  __Pyx_GIVEREF(__pyx_tuple__129);
  __pyx_codeobj__130 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__129, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_clone, 1099, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__130)) __PYX_ERR(0, 1099, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1105
 *         return result
 * 
 *     def get_default_face_color(self):             # <<<<<<<<<<<<<<
 *         return RGBColor(components=(0, 0, 0, 1))
 * 
 */
  __pyx_tuple__131 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(0, 1105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__131);
  __Pyx_GIVEREF(__pyx_tuple__131);
  __pyx_codeobj__132 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__131, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_get_default_face_color, 1105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__132)) __PYX_ERR(0, 1105, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1108
 *         return RGBColor(components=(0, 0, 0, 1))
 * 
 *     def get_default_edge_color(self):             # <<<<<<<<<<<<<<
 *         return RGBColor(components=(0, 0, 0, 1))
 * 
 */
  __pyx_tuple__133 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(0, 1108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__133);
  __Pyx_GIVEREF(__pyx_tuple__133);
  __pyx_codeobj__134 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__133, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_get_default_edge_color, 1108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__134)) __PYX_ERR(0, 1108, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1111
 *         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__135 = 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__60); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(0, 1111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__135);
  __Pyx_GIVEREF(__pyx_tuple__135);
  __pyx_codeobj__136 = (PyObject*)__Pyx_PyCode_New(5, 0, 9, 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_style, 1111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__136)) __PYX_ERR(0, 1111, __pyx_L1_error)
  __pyx_tuple__137 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_True), ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(0, 1111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__137);
  __Pyx_GIVEREF(__pyx_tuple__137);

  /* "mathics/builtin/graphics.py":1144
 *         return edge_style, face_style
 * 
 *     def get_option(self, name):             # <<<<<<<<<<<<<<
 *         return self.options.get(name, None)
 * 
 */
  __pyx_tuple__138 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_name); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(0, 1144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__138);
  __Pyx_GIVEREF(__pyx_tuple__138);
  __pyx_codeobj__139 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__138, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_get_option, 1144, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__139)) __PYX_ERR(0, 1144, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1147
 *         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__140 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_face_element, __pyx_n_s_edge_style, __pyx_n_s__60); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(0, 1147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__140);
  __Pyx_GIVEREF(__pyx_tuple__140);
  __pyx_codeobj__141 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__140, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_get_line_width, 1147, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__141)) __PYX_ERR(0, 1147, __pyx_L1_error)
  __pyx_tuple__142 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(0, 1147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__142);
  __Pyx_GIVEREF(__pyx_tuple__142);

  /* "mathics/builtin/graphics.py":1158
 * 
 * 
 * def _flatten(leaves):             # <<<<<<<<<<<<<<
 *     for leaf in leaves:
 *         if leaf.get_head_name() == "System`List":
 */
  __pyx_tuple__143 = PyTuple_Pack(4, __pyx_n_s_leaves, __pyx_n_s_leaf, __pyx_n_s_flattened, __pyx_n_s_x); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(0, 1158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__143);
  __Pyx_GIVEREF(__pyx_tuple__143);
  __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 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_flatten, 1158, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 1158, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1171
 * 
 * 
 * class _GraphicsElements(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, content, evaluation):
 *         self.evaluation = evaluation
 */
  __pyx_tuple__144 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(0, 1171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__144);
  __Pyx_GIVEREF(__pyx_tuple__144);

  /* "mathics/builtin/graphics.py":1172
 * 
 * class _GraphicsElements(object):
 *     def __init__(self, content, evaluation):             # <<<<<<<<<<<<<<
 *         self.evaluation = evaluation
 *         self.elements = []
 */
  __pyx_tuple__145 = 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__145)) __PYX_ERR(0, 1172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__145);
  __Pyx_GIVEREF(__pyx_tuple__145);
  __pyx_codeobj__146 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 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_init_2, 1172, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__146)) __PYX_ERR(0, 1172, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1245
 *         self.elements = list(convert(content, self.get_style_class()(self)))
 * 
 *     def create_style(self, expr):             # <<<<<<<<<<<<<<
 *         style = self.get_style_class()(self)
 * 
 */
  __pyx_tuple__147 = 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__147)) __PYX_ERR(0, 1245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__147);
  __Pyx_GIVEREF(__pyx_tuple__147);
  __pyx_codeobj__148 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__147, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_create_style, 1245, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__148)) __PYX_ERR(0, 1245, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1258
 *         return style
 * 
 *     def get_style_class(self):             # <<<<<<<<<<<<<<
 *         return Style
 * 
 */
  __pyx_tuple__149 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(0, 1258, __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_get_style_class, 1258, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__150)) __PYX_ERR(0, 1258, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1265
 *     coords = Coords
 * 
 *     def __init__(self, content, evaluation, neg_y=False):             # <<<<<<<<<<<<<<
 *         super(GraphicsElements, self).__init__(content, evaluation)
 *         self.neg_y = neg_y
 */
  __pyx_tuple__151 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_content, __pyx_n_s_evaluation, __pyx_n_s_neg_y); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(0, 1265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__151);
  __Pyx_GIVEREF(__pyx_tuple__151);
  __pyx_codeobj__152 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__151, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_init_2, 1265, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__152)) __PYX_ERR(0, 1265, __pyx_L1_error)
  __pyx_tuple__153 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(0, 1265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__153);
  __Pyx_GIVEREF(__pyx_tuple__153);

  /* "mathics/builtin/graphics.py":1273
 *         self.content = content
 * 
 *     def translate(self, coords):             # <<<<<<<<<<<<<<
 *         if self.pixel_width is not None:
 *             w = self.extent_width if self.extent_width > 0 else 1
 */
  __pyx_tuple__154 = 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__154)) __PYX_ERR(0, 1273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__154);
  __Pyx_GIVEREF(__pyx_tuple__154);
  __pyx_codeobj__155 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 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_translate, 1273, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__155)) __PYX_ERR(0, 1273, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1287
 *             return (coords[0], coords[1])
 * 
 *     def translate_absolute(self, d):             # <<<<<<<<<<<<<<
 *         if self.pixel_width is None:
 *             return (0, 0)
 */
  __pyx_tuple__156 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_d, __pyx_n_s_l); if (unlikely(!__pyx_tuple__156)) __PYX_ERR(0, 1287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__156);
  __Pyx_GIVEREF(__pyx_tuple__156);
  __pyx_codeobj__157 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__156, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_translate_absolute, 1287, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__157)) __PYX_ERR(0, 1287, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1294
 *             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__158 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_x); if (unlikely(!__pyx_tuple__158)) __PYX_ERR(0, 1294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__158);
  __Pyx_GIVEREF(__pyx_tuple__158);
  __pyx_codeobj__159 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__158, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_translate_relative, 1294, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__159)) __PYX_ERR(0, 1294, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1300
 *             return x * self.pixel_width
 * 
 *     def extent(self, completely_visible_only=False):             # <<<<<<<<<<<<<<
 *         if completely_visible_only:
 *             ext = total_extent(
 */
  __pyx_tuple__160 = 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__160)) __PYX_ERR(0, 1300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__160);
  __Pyx_GIVEREF(__pyx_tuple__160);
  __pyx_codeobj__161 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 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_extent, 1300, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__161)) __PYX_ERR(0, 1300, __pyx_L1_error)
  __pyx_tuple__162 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(0, 1300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__162);
  __Pyx_GIVEREF(__pyx_tuple__162);

  /* "mathics/builtin/graphics.py":1324
 *         return xmin, xmax, ymin, ymax
 * 
 *     def set_size(             # <<<<<<<<<<<<<<
 *         self, xmin, ymin, extent_width, extent_height, pixel_width, pixel_height
 *     ):
 */
  __pyx_tuple__163 = 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__163)) __PYX_ERR(0, 1324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__163);
  __Pyx_GIVEREF(__pyx_tuple__163);
  __pyx_codeobj__164 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__163, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_set_size, 1324, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__164)) __PYX_ERR(0, 1324, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1334
 * 
 * class Directive(Builtin):
 *     attributes = ("ReadProtected",)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__165 = PyTuple_Pack(1, __pyx_n_u_ReadProtected); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(0, 1334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__165);
  __Pyx_GIVEREF(__pyx_tuple__165);

  /* "mathics/builtin/graphics.py":1374
 * 
 * element_heads = frozenset(
 *     system_symbols(             # <<<<<<<<<<<<<<
 *         "Arrow",
 *         "BezierCurve",
 */
  __pyx_tuple__166 = PyTuple_Pack(15, __pyx_n_u_Arrow, __pyx_n_u_BezierCurve_2, __pyx_n_u_Circle, __pyx_n_u_Cylinder, __pyx_n_u_Disk, __pyx_n_u_FilledCurve, __pyx_n_u_Inset, __pyx_n_u_Line, __pyx_n_u_Point, __pyx_n_u_Polygon, __pyx_n_u_Rectangle, __pyx_n_u_RegularPolygon, __pyx_n_u_Sphere, __pyx_n_u_Style, __pyx_n_u_Text); if (unlikely(!__pyx_tuple__166)) __PYX_ERR(0, 1374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__166);
  __Pyx_GIVEREF(__pyx_tuple__166);
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  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_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_0_04 = PyFloat_FromDouble(0.04); if (unlikely(!__pyx_float_0_04)) __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_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_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __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_18 = PyInt_FromLong(18); if (unlikely(!__pyx_int_18)) __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_100000000 = PyInt_FromLong(100000000L); if (unlikely(!__pyx_int_100000000)) __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_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_9genexpr21__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__apply_makeboxes) < 0) __PYX_ERR(0, 297, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct__apply_makeboxes.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct__apply_makeboxes.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct__apply_makeboxes.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct__apply_makeboxes.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct__apply_makeboxes = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct__apply_makeboxes;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_1_convert) < 0) __PYX_ERR(0, 301, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_1_convert.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_1_convert.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_1_convert.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_1_convert.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_1_convert = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_1_convert;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 319, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_2_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 336, __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_do_init) < 0) __PYX_ERR(0, 572, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_4_do_init.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_4_do_init.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_4_do_init.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_4_do_init.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_4_do_init = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_4_do_init;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 578, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_5_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_5_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_5_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_5_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_5_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_5_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_6__svg_bezier) < 0) __PYX_ERR(0, 657, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_6__svg_bezier.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_6__svg_bezier.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_6__svg_bezier.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_6__svg_bezier.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_6__svg_bezier = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_6__svg_bezier;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_7_path) < 0) __PYX_ERR(0, 669, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_7_path.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_7_path.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_7_path.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_7_path.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_7_path = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_7_path;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_8_genexpr) < 0) __PYX_ERR(0, 675, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_8_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_8_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_8_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_8_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_8_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_8_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_9_heads) < 0) __PYX_ERR(0, 843, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_9_heads.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_9_heads.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_9_heads.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_9_heads.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_9_heads = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_9_heads;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_10_genexpr) < 0) __PYX_ERR(0, 848, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_10_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_10_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_10_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_10_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_10_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_10_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_11_make_draw_svg) < 0) __PYX_ERR(0, 896, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_11_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_11_make_draw_svg.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_11_make_draw_svg.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_11_make_draw_svg.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_11_make_draw_svg = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_11_make_draw_svg;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_12_draw) < 0) __PYX_ERR(0, 897, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_12_draw.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_12_draw.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_12_draw.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_12_draw.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_12_draw = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_12_draw;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_13_genexpr) < 0) __PYX_ERR(0, 899, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_13_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_13_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_13_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_13_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_13_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_13_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_14_make_draw_asy) < 0) __PYX_ERR(0, 904, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_14_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_14_make_draw_asy.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_14_make_draw_asy.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_14_make_draw_asy.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_14_make_draw_asy = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_14_make_draw_asy;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_15_draw) < 0) __PYX_ERR(0, 905, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_15_draw.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_15_draw.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_15_draw.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_15_draw.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_15_draw = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_15_draw;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_16_arrows) < 0) __PYX_ERR(0, 912, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_16_arrows.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_16_arrows.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_16_arrows.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_16_arrows.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_16_arrows = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_16_arrows;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_17_segments) < 0) __PYX_ERR(0, 913, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_17_segments.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_17_segments.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_17_segments.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_17_segments.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_17_segments = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_17_segments;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_18_genexpr) < 0) __PYX_ERR(0, 928, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_18_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_18_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_18_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_18_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_18_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_18_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr) < 0) __PYX_ERR(0, 930, __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_make_draw_svg) < 0) __PYX_ERR(0, 984, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_20_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_20_make_draw_svg.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_20_make_draw_svg.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_20_make_draw_svg.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_20_make_draw_svg = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_20_make_draw_svg;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_21_draw) < 0) __PYX_ERR(0, 985, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_21_draw.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_21_draw.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_21_draw.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_21_draw.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_21_draw = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_21_draw;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_22_make_draw_asy) < 0) __PYX_ERR(0, 991, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_22_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_22_make_draw_asy.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_22_make_draw_asy.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_22_make_draw_asy.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_22_make_draw_asy = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_22_make_draw_asy;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_23_draw) < 0) __PYX_ERR(0, 992, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_23_draw.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_23_draw.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_23_draw.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_23_draw.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_23_draw = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_23_draw;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_24_arrows) < 0) __PYX_ERR(0, 998, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_24_arrows.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_24_arrows.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_24_arrows.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_24_arrows.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_24_arrows = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_24_arrows;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_25__flatten) < 0) __PYX_ERR(0, 1158, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_25__flatten.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_25__flatten.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_25__flatten.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_25__flatten.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_25__flatten = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_25__flatten;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_26___init__) < 0) __PYX_ERR(0, 1172, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_26___init__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_26___init__.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_26___init__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_26___init__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_26___init__ = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_26___init__;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_27_convert) < 0) __PYX_ERR(0, 1205, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_27_convert.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_27_convert.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_27_convert.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_27_convert.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_27_convert = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_27_convert;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_28_create_style) < 0) __PYX_ERR(0, 1245, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_28_create_style.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_28_create_style.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_28_create_style.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_28_create_style.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_28_create_style = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_28_create_style;
  __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;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #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":9
 * 
 * 
 * from math import floor, sqrt             # <<<<<<<<<<<<<<
 * 
 * from mathics.version import __version__  # noqa used in loading to check consistency.
 */
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __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_sqrt);
  __Pyx_GIVEREF(__pyx_n_s_sqrt);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_sqrt);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_math, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __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, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_floor, __pyx_t_1) < 0) __PYX_ERR(0, 9, __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, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sqrt, __pyx_t_1) < 0) __PYX_ERR(0, 9, __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, sqrt
 * 
 * from mathics.version import __version__  # noqa used in loading to check consistency.             # <<<<<<<<<<<<<<
 * 
 * from mathics.builtin.base import (
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_version);
  __Pyx_GIVEREF(__pyx_n_s_version);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_version);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_mathics_version, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __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_version); 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_version, __pyx_t_2) < 0) __PYX_ERR(0, 11, __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":14
 * 
 * from mathics.builtin.base import (
 *     Builtin,             # <<<<<<<<<<<<<<
 *     BoxConstructError,
 * )
 */
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __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_BoxConstructError);
  __Pyx_GIVEREF(__pyx_n_s_BoxConstructError);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_BoxConstructError);

  /* "mathics/builtin/graphics.py":13
 * from mathics.version import __version__  # noqa used in loading to check consistency.
 * 
 * from mathics.builtin.base import (             # <<<<<<<<<<<<<<
 *     Builtin,
 *     BoxConstructError,
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_mathics_builtin_base, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __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, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Builtin, __pyx_t_1) < 0) __PYX_ERR(0, 14, __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, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BoxConstructError, __pyx_t_1) < 0) __PYX_ERR(0, 15, __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":19
 * 
 * from mathics.builtin.drawing.graphics_internals import (
 *     _GraphicsElement,             # <<<<<<<<<<<<<<
 *     GLOBALS,
 *     get_class,
 */
  __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_GraphicsElement);
  __Pyx_GIVEREF(__pyx_n_s_GraphicsElement);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_GraphicsElement);
  __Pyx_INCREF(__pyx_n_s_GLOBALS);
  __Pyx_GIVEREF(__pyx_n_s_GLOBALS);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_GLOBALS);
  __Pyx_INCREF(__pyx_n_s_get_class);
  __Pyx_GIVEREF(__pyx_n_s_get_class);
  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_get_class);

  /* "mathics/builtin/graphics.py":18
 * )
 * 
 * from mathics.builtin.drawing.graphics_internals import (             # <<<<<<<<<<<<<<
 *     _GraphicsElement,
 *     GLOBALS,
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_mathics_builtin_drawing_graphics_2, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __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_GraphicsElement); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_GraphicsElement, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_GLOBALS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_GLOBALS, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_get_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __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, 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":24
 * )
 * from mathics.builtin.colors.color_directives import (
 *     _Color,             # <<<<<<<<<<<<<<
 *     CMYKColor,
 *     ColorError,
 */
  __pyx_t_1 = PyList_New(10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_Color);
  __Pyx_GIVEREF(__pyx_n_s_Color);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Color);
  __Pyx_INCREF(__pyx_n_s_CMYKColor);
  __Pyx_GIVEREF(__pyx_n_s_CMYKColor);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_CMYKColor);
  __Pyx_INCREF(__pyx_n_s_ColorError);
  __Pyx_GIVEREF(__pyx_n_s_ColorError);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_ColorError);
  __Pyx_INCREF(__pyx_n_s_GrayLevel);
  __Pyx_GIVEREF(__pyx_n_s_GrayLevel);
  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_GrayLevel);
  __Pyx_INCREF(__pyx_n_s_Hue);
  __Pyx_GIVEREF(__pyx_n_s_Hue);
  PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_Hue);
  __Pyx_INCREF(__pyx_n_s_LABColor);
  __Pyx_GIVEREF(__pyx_n_s_LABColor);
  PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_LABColor);
  __Pyx_INCREF(__pyx_n_s_LCHColor);
  __Pyx_GIVEREF(__pyx_n_s_LCHColor);
  PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_LCHColor);
  __Pyx_INCREF(__pyx_n_s_LUVColor);
  __Pyx_GIVEREF(__pyx_n_s_LUVColor);
  PyList_SET_ITEM(__pyx_t_1, 7, __pyx_n_s_LUVColor);
  __Pyx_INCREF(__pyx_n_s_RGBColor);
  __Pyx_GIVEREF(__pyx_n_s_RGBColor);
  PyList_SET_ITEM(__pyx_t_1, 8, __pyx_n_s_RGBColor);
  __Pyx_INCREF(__pyx_n_s_XYZColor);
  __Pyx_GIVEREF(__pyx_n_s_XYZColor);
  PyList_SET_ITEM(__pyx_t_1, 9, __pyx_n_s_XYZColor);

  /* "mathics/builtin/graphics.py":23
 *     get_class,
 * )
 * from mathics.builtin.colors.color_directives import (             # <<<<<<<<<<<<<<
 *     _Color,
 *     CMYKColor,
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_mathics_builtin_colors_color_dir, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __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_Color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Color, __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_CMYKColor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CMYKColor, __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_ColorError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ColorError, __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_GrayLevel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_GrayLevel, __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_Hue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Hue, __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_LABColor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LABColor, __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_LCHColor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LCHColor, __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_LUVColor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LUVColor, __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_RGBColor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_RGBColor, __pyx_t_1) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_XYZColor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_XYZColor, __pyx_t_1) < 0) __PYX_ERR(0, 33, __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":36
 * )
 * 
 * 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, 36, __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, 36, __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, 36, __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, 36, __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":38
 * 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, 38, __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_Symbol);
  __Pyx_GIVEREF(__pyx_n_s_Symbol);
  PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_Symbol);
  __Pyx_INCREF(__pyx_n_s_SymbolList);
  __Pyx_GIVEREF(__pyx_n_s_SymbolList);
  PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_SymbolList);
  __Pyx_INCREF(__pyx_n_s_SymbolN);
  __Pyx_GIVEREF(__pyx_n_s_SymbolN);
  PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_SymbolN);
  __Pyx_INCREF(__pyx_n_s_SymbolMakeBoxes);
  __Pyx_GIVEREF(__pyx_n_s_SymbolMakeBoxes);
  PyList_SET_ITEM(__pyx_t_1, 7, __pyx_n_s_SymbolMakeBoxes);
  __Pyx_INCREF(__pyx_n_s_system_symbols);
  __Pyx_GIVEREF(__pyx_n_s_system_symbols);
  PyList_SET_ITEM(__pyx_t_1, 8, __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, 9, __pyx_n_s_system_symbols_dict);

  /* "mathics/builtin/graphics.py":37
 * 
 * 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, 37, __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, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Expression, __pyx_t_1) < 0) __PYX_ERR(0, 38, __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, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Integer, __pyx_t_1) < 0) __PYX_ERR(0, 39, __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, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rational, __pyx_t_1) < 0) __PYX_ERR(0, 40, __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, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Real, __pyx_t_1) < 0) __PYX_ERR(0, 41, __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, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Symbol, __pyx_t_1) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_SymbolList); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SymbolList, __pyx_t_1) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_SymbolN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SymbolN, __pyx_t_1) < 0) __PYX_ERR(0, 44, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_SymbolMakeBoxes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SymbolMakeBoxes, __pyx_t_1) < 0) __PYX_ERR(0, 45, __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, 37, __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, 46, __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, 37, __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, 47, __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":50
 * )
 * 
 * from mathics.core.formatter import lookup_method             # <<<<<<<<<<<<<<
 * from mathics.format.asy_fns import asy_bezier
 * 
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_lookup_method);
  __Pyx_GIVEREF(__pyx_n_s_lookup_method);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_lookup_method);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_mathics_core_formatter, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __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_lookup_method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_lookup_method, __pyx_t_2) < 0) __PYX_ERR(0, 50, __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":51
 * 
 * from mathics.core.formatter import lookup_method
 * from mathics.format.asy_fns import asy_bezier             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_asy_bezier);
  __Pyx_GIVEREF(__pyx_n_s_asy_bezier);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_asy_bezier);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_mathics_format_asy_fns, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __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_asy_bezier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __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, 51, __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":55
 * 
 * GRAPHICS_OPTIONS = {
 *     "AspectRatio": "Automatic",             # <<<<<<<<<<<<<<
 *     "Axes": "False",
 *     "AxesStyle": "{}",
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_AspectRatio, __pyx_n_u_Automatic) < 0) __PYX_ERR(0, 55, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_Axes, __pyx_n_u_False) < 0) __PYX_ERR(0, 55, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_AxesStyle, __pyx_kp_u__47) < 0) __PYX_ERR(0, 55, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_Background, __pyx_n_u_Automatic) < 0) __PYX_ERR(0, 55, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_ImageSize, __pyx_n_u_Automatic) < 0) __PYX_ERR(0, 55, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_LabelStyle, __pyx_kp_u__47) < 0) __PYX_ERR(0, 55, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_PlotRange, __pyx_n_u_Automatic) < 0) __PYX_ERR(0, 55, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_PlotRangePadding, __pyx_n_u_Automatic) < 0) __PYX_ERR(0, 55, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_TicksStyle, __pyx_kp_u__47) < 0) __PYX_ERR(0, 55, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_OptionSyntax, __pyx_n_u_Ignore) < 0) __PYX_ERR(0, 55, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_GRAPHICS_OPTIONS, __pyx_t_2) < 0) __PYX_ERR(0, 54, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":68
 * 
 * # fraction of point relative canvas width
 * DEFAULT_POINT_FACTOR = 0.005             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULT_POINT_FACTOR, __pyx_float_0_005) < 0) __PYX_ERR(0, 68, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":71
 * 
 * 
 * class CoordinatesError(BoxConstructError):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __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, 71, __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, 71, __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, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CoordinatesError, __pyx_t_4) < 0) __PYX_ERR(0, 71, __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":75
 * 
 * 
 * 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_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_1coords, 0, __pyx_n_s_coords, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_coords, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":84
 * 
 * 
 * class Coords(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, graphics, expr=None, pos=None, d=None):
 *         self.graphics = graphics
 */
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__50); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__50, __pyx_n_s_Coords, __pyx_n_s_Coords, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mathics/builtin/graphics.py":85
 * 
 * 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__52)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__53);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_3) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":99
 *                 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__55)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_pos, __pyx_t_3) < 0) __PYX_ERR(0, 99, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":107
 *         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__57)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_add, __pyx_t_3) < 0) __PYX_ERR(0, 107, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":84
 * 
 * 
 * class Coords(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, graphics, expr=None, pos=None, d=None):
 *         self.graphics = graphics
 */
  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Coords, __pyx_tuple__50, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Coords, __pyx_t_3) < 0) __PYX_ERR(0, 84, __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":112
 * 
 * 
 * def cut(value):             # <<<<<<<<<<<<<<
 *     "Cut values in graphics primitives (not displayed otherwise in SVG)"
 *     border = 10 ** 8
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_3cut, 0, __pyx_n_s_cut, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cut, __pyx_t_1) < 0) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":122
 * 
 * 
 * def create_css(             # <<<<<<<<<<<<<<
 *     edge_color=None, face_color=None, stroke_width=None, font_color=None, opacity=1.0
 * ):
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_5create_css, 0, __pyx_n_s_create_css, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__63);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_create_css, __pyx_t_1) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
  __Pyx_DECREF(__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:
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_7_to_float, 0, __pyx_n_s_to_float, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_to_float, __pyx_t_1) < 0) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":154
 * 
 * 
 * def _data_and_options(leaves, defined_options):             # <<<<<<<<<<<<<<
 *     data = []
 *     options = defined_options.copy()
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_9_data_and_options, 0, __pyx_n_s_data_and_options, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_data_and_options, __pyx_t_1) < 0) __PYX_ERR(0, 154, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":175
 * 
 * 
 * def _extract_graphics(graphics, format, evaluation):             # <<<<<<<<<<<<<<
 *     graphics_box = Expression(SymbolMakeBoxes, graphics).evaluate(evaluation)
 *     # builtin = GraphicsBox(expression=False)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_11_extract_graphics, 0, __pyx_n_s_extract_graphics, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_extract_graphics, __pyx_t_1) < 0) __PYX_ERR(0, 175, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":210
 * 
 * 
 * class Show(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 210, __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, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __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, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":221
 *     """
 * 
 *     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, 221, __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, 221, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":223
 *     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__71)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __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, 223, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":210
 * 
 * 
 * class Show(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Show, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Show, __pyx_t_4) < 0) __PYX_ERR(0, 210, __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":247
 * 
 * 
 * class Graphics(Builtin):             # <<<<<<<<<<<<<<
 *     r"""
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __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, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __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, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":293
 *     """
 * 
 *     options = GRAPHICS_OPTIONS             # <<<<<<<<<<<<<<
 * 
 *     box_suffix = "Box"
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_GRAPHICS_OPTIONS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 293, __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, 293, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":295
 *     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, 295, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":297
 *     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__73)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __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, 297, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":247
 * 
 * 
 * class Graphics(Builtin):             # <<<<<<<<<<<<<<
 *     r"""
 *     <dl>
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Graphics, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Graphics, __pyx_t_4) < 0) __PYX_ERR(0, 247, __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":364
 * 
 * 
 * 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, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __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, 364, __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, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":365
 * 
 * class _Size(_GraphicsElement):
 *     def init(self, graphics, item=None, value=None):             # <<<<<<<<<<<<<<
 *         super(_Size, self).init(graphics, item)
 *         if item is not None:
 */
  __pyx_t_4 = __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__75)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__76);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":364
 * 
 * 
 * class _Size(_GraphicsElement):             # <<<<<<<<<<<<<<
 *     def init(self, graphics, item=None, value=None):
 *         super(_Size, self).init(graphics, item)
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Size, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Size, __pyx_t_4) < 0) __PYX_ERR(0, 364, __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":377
 * 
 * 
 * class _Thickness(_Size):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __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, 377, __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, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Thickness, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Thickness, __pyx_t_4) < 0) __PYX_ERR(0, 377, __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":381
 * 
 * 
 * class AbsoluteThickness(_Thickness):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Thickness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __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, 381, __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, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":393
 *     """
 * 
 *     def get_thickness(self):             # <<<<<<<<<<<<<<
 *         return self.graphics.translate_absolute((self.value, 0))[0]
 * 
 */
  __pyx_t_4 = __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__78)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_get_thickness, __pyx_t_4) < 0) __PYX_ERR(0, 393, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":381
 * 
 * 
 * class AbsoluteThickness(_Thickness):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_AbsoluteThickness, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_AbsoluteThickness, __pyx_t_4) < 0) __PYX_ERR(0, 381, __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":397
 * 
 * 
 * class Thickness(_Thickness):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Thickness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 397, __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, 397, __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, 397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":409
 *     """
 * 
 *     def get_thickness(self):             # <<<<<<<<<<<<<<
 *         return self.graphics.translate_relative(self.value)
 * 
 */
  __pyx_t_4 = __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__80)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_get_thickness, __pyx_t_4) < 0) __PYX_ERR(0, 409, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":397
 * 
 * 
 * class Thickness(_Thickness):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Thickness_2, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Thickness_2, __pyx_t_4) < 0) __PYX_ERR(0, 397, __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":413
 * 
 * 
 * class Thin(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 413, __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, 413, __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, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":421
 *     """
 * 
 *     rules = {"Thin": "AbsoluteThickness[0.5]"}             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_Thin, __pyx_kp_u_AbsoluteThickness_0_5) < 0) __PYX_ERR(0, 421, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rules, __pyx_t_4) < 0) __PYX_ERR(0, 421, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":413
 * 
 * 
 * class Thin(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Thin, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Thin, __pyx_t_4) < 0) __PYX_ERR(0, 413, __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":424
 * 
 * 
 * class Thick(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __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, 424, __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, 424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":432
 *     """
 * 
 *     rules = {"Thick": "AbsoluteThickness[2]"}             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_Thick, __pyx_kp_u_AbsoluteThickness_2) < 0) __PYX_ERR(0, 432, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rules, __pyx_t_4) < 0) __PYX_ERR(0, 432, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":424
 * 
 * 
 * class Thick(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Thick, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Thick, __pyx_t_4) < 0) __PYX_ERR(0, 424, __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":435
 * 
 * 
 * class PointSize(_Size):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 435, __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, 435, __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, 435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":450
 *     """
 * 
 *     def get_absolute_size(self):             # <<<<<<<<<<<<<<
 *         if self.graphics.view_width is None:
 *             self.graphics.view_width = 400
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_9PointSize_1get_absolute_size, 0, __pyx_n_s_PointSize_get_absolute_size, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_get_absolute_size, __pyx_t_4) < 0) __PYX_ERR(0, 450, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":435
 * 
 * 
 * class PointSize(_Size):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_PointSize, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PointSize, __pyx_t_4) < 0) __PYX_ERR(0, 435, __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":458
 * 
 * 
 * class FontColor(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __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, 458, __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, 458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FontColor, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FontColor, __pyx_t_4) < 0) __PYX_ERR(0, 458, __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":469
 * 
 * 
 * class Offset(Builtin):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 469, __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, 469, __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, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Offset, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Offset, __pyx_t_4) < 0) __PYX_ERR(0, 469, __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":473
 * 
 * 
 * class Rectangle(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 473, __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, 473, __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, 473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":489
 *     """
 * 
 *     rules = {"Rectangle[]": "Rectangle[{0, 0}]"}             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_Rectangle_2, __pyx_kp_u_Rectangle_0_0) < 0) __PYX_ERR(0, 489, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rules, __pyx_t_4) < 0) __PYX_ERR(0, 489, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":473
 * 
 * 
 * class Rectangle(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Rectangle, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rectangle, __pyx_t_4) < 0) __PYX_ERR(0, 473, __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":492
 * 
 * 
 * class Disk(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 492, __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, 492, __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, 492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":520
 *     """
 * 
 *     rules = {"Disk[]": "Disk[{0, 0}]"}             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_Disk_2, __pyx_kp_u_Disk_0_0) < 0) __PYX_ERR(0, 520, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rules, __pyx_t_4) < 0) __PYX_ERR(0, 520, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":492
 * 
 * 
 * class Disk(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Disk, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Disk, __pyx_t_4) < 0) __PYX_ERR(0, 492, __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":523
 * 
 * 
 * class Circle(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __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, 523, __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, 523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":549
 *     """
 * 
 *     rules = {"Circle[]": "Circle[{0, 0}]"}             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_Circle_2, __pyx_kp_u_Circle_0_0) < 0) __PYX_ERR(0, 549, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rules, __pyx_t_4) < 0) __PYX_ERR(0, 549, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":523
 * 
 * 
 * class Circle(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Circle, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Circle, __pyx_t_4) < 0) __PYX_ERR(0, 523, __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":552
 * 
 * 
 * class Inset(Builtin):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 552, __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, 552, __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, 552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Inset, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Inset, __pyx_t_4) < 0) __PYX_ERR(0, 552, __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":556
 * 
 * 
 * class Text(Inset):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Inset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __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, 556, __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, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Text, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Text, __pyx_t_4) < 0) __PYX_ERR(0, 556, __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":571
 * 
 * 
 * class _Polyline(_GraphicsElement):             # <<<<<<<<<<<<<<
 *     def do_init(self, graphics, points):
 *         if not points.has_form("List", None):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_GraphicsElement); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __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, 571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __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, 571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":572
 * 
 * class _Polyline(_GraphicsElement):
 *     def do_init(self, graphics, points):             # <<<<<<<<<<<<<<
 *         if not points.has_form("List", None):
 *             raise BoxConstructError
 */
  __pyx_t_4 = __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__84)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_do_init, __pyx_t_4) < 0) __PYX_ERR(0, 572, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":595
 *         ]
 * 
 *     def extent(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         result = []
 */
  __pyx_t_4 = __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__86)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_extent, __pyx_t_4) < 0) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":571
 * 
 * 
 * class _Polyline(_GraphicsElement):             # <<<<<<<<<<<<<<
 *     def do_init(self, graphics, points):
 *         if not points.has_form("List", None):
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Polyline, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Polyline, __pyx_t_4) < 0) __PYX_ERR(0, 571, __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":607
 * 
 * 
 * class Point(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __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, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __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, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Point, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Point, __pyx_t_4) < 0) __PYX_ERR(0, 607, __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":638
 * # FIXME: We model points as line segments which
 * # is kind of  wrong.
 * class Line(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 638, __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, 638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Line, __pyx_n_s_Line, (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, 638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Line, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Line, __pyx_t_4) < 0) __PYX_ERR(0, 638, __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":657
 * 
 * 
 * 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_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_13_svg_bezier, 0, __pyx_n_s_svg_bezier, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_svg_bezier, __pyx_t_2) < 0) __PYX_ERR(0, 657, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":689
 * 
 * 
 * class FilledCurve(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Builtin); 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_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, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FilledCurve, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FilledCurve, __pyx_t_4) < 0) __PYX_ERR(0, 689, __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":706
 * 
 * 
 * class Polygon(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 706, __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, 706, __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, 706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Polygon, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Polygon, __pyx_t_4) < 0) __PYX_ERR(0, 706, __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":733
 * 
 * 
 * class RegularPolygon(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 733, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 733, __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, 733, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __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, 733, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_RegularPolygon, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 733, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_RegularPolygon, __pyx_t_4) < 0) __PYX_ERR(0, 733, __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":754
 * 
 * 
 * class Arrow(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 754, __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, 754, __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, 754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Arrow, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Arrow, __pyx_t_4) < 0) __PYX_ERR(0, 754, __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":790
 * 
 * 
 * class Arrowheads(_GraphicsElement):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_GraphicsElement); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __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, 790, __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, 790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":821
 *     """
 * 
 *     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, 821, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":824
 * 
 *     symbolic_sizes = {
 *         "System`Tiny": 3,             # <<<<<<<<<<<<<<
 *         "System`Small": 5,
 *         "System`Medium": 9,
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_System_Tiny, __pyx_int_3) < 0) __PYX_ERR(0, 824, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_System_Small, __pyx_int_5) < 0) __PYX_ERR(0, 824, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_System_Medium, __pyx_int_9) < 0) __PYX_ERR(0, 824, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_System_Large, __pyx_int_18) < 0) __PYX_ERR(0, 824, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_symbolic_sizes, __pyx_t_4) < 0) __PYX_ERR(0, 823, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":830
 *     }
 * 
 *     def init(self, graphics, item=None):             # <<<<<<<<<<<<<<
 *         super(Arrowheads, self).init(graphics, item)
 *         if len(item.leaves) != 1:
 */
  __pyx_t_4 = __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__89)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__90);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 830, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":836
 *         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_4 = __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__92)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_arrow_size, __pyx_t_4) < 0) __PYX_ERR(0, 836, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":843
 *             return _to_float(s) * extent
 * 
 *     def heads(self, extent, default_arrow, custom_arrow):             # <<<<<<<<<<<<<<
 *         # see https://reference.wolfram.com/language/ref/Arrowheads.html
 * 
 */
  __pyx_t_4 = __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__13)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_heads, __pyx_t_4) < 0) __PYX_ERR(0, 843, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":790
 * 
 * 
 * class Arrowheads(_GraphicsElement):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Arrowheads, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Arrowheads, __pyx_t_4) < 0) __PYX_ERR(0, 790, __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":884
 * 
 * 
 * def _norm(p, q):             # <<<<<<<<<<<<<<
 *     px, py = p
 *     qx, qy = q
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_16_norm, 0, __pyx_n_s_norm, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__95)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_norm, __pyx_t_1) < 0) __PYX_ERR(0, 884, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":895
 * 
 * 
 * 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_2, __pyx_n_s_Line_2, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "mathics/builtin/graphics.py":896
 * 
 * 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__97)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __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, 896, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":904
 *         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__99)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 904, __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, 904, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":912
 *         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__19)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 912, __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, 912, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":895
 * 
 * 
 * class _Line:             # <<<<<<<<<<<<<<
 *     def make_draw_svg(self, style):
 *         def draw(points):
 */
  __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_Line_2, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Line_2, __pyx_t_2) < 0) __PYX_ERR(0, 895, __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":950
 * 
 * 
 * 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_18_bezier_derivative, 0, __pyx_n_s_bezier_derivative, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__102)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 950, __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, 950, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":956
 * 
 * 
 * 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_20_bezier_evaluate, 0, __pyx_n_s_bezier_evaluate, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__104)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 956, __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, 956, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":980
 * 
 * 
 * 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, 980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "mathics/builtin/graphics.py":981
 * 
 * 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__106)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__107);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init_2, __pyx_t_2) < 0) __PYX_ERR(0, 981, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":984
 *         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__109)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __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, 984, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":991
 *         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__111)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 991, __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, 991, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":998
 *         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__29)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 998, __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, 998, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":980
 * 
 * 
 * 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, 980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BezierCurve, __pyx_t_2) < 0) __PYX_ERR(0, 980, __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":1025
 * 
 * 
 * def total_extent(extents):             # <<<<<<<<<<<<<<
 *     xmin = xmax = ymin = ymax = None
 *     for extent in extents:
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_22total_extent, 0, __pyx_n_s_total_extent, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1025, __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, 1025, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1040
 * 
 * 
 * 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, 1040, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1040, __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, 1040, __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, 1040, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_EdgeForm, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1040, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EdgeForm, __pyx_t_4) < 0) __PYX_ERR(0, 1040, __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":1052
 * 
 * 
 * class FaceForm(Builtin):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1052, __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, 1052, __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, 1052, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FaceForm, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1052, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FaceForm, __pyx_t_4) < 0) __PYX_ERR(0, 1052, __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":1056
 * 
 * 
 * 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_24_style, 0, __pyx_n_s_style_3, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1056, __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, 1056, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1078
 * 
 * 
 * class Style(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, graphics, edge=False, face=False):
 *         self.styles = []
 */
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__117); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__117, __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, 1078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mathics/builtin/graphics.py":1079
 * 
 * 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__119)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1079, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__120);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_3) < 0) __PYX_ERR(0, 1079, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1087
 *         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__122)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__123);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_append, __pyx_t_3) < 0) __PYX_ERR(0, 1087, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1090
 *         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__125)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1090, __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, 1090, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1093
 *         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__127)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1093, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__128);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_extend, __pyx_t_3) < 0) __PYX_ERR(0, 1093, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1099
 *             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__130)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1099, __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, 1099, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1105
 *         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__132)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1105, __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, 1105, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1108
 *         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__134)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1108, __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, 1108, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1111
 *         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__136)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__137);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_get_style, __pyx_t_3) < 0) __PYX_ERR(0, 1111, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1144
 *         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__139)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1144, __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, 1144, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1147
 *         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__141)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__142);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_get_line_width, __pyx_t_3) < 0) __PYX_ERR(0, 1147, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1078
 * 
 * 
 * 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__117, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Style, __pyx_t_3) < 0) __PYX_ERR(0, 1078, __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":1158
 * 
 * 
 * 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_26_flatten, 0, __pyx_n_s_flatten, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_flatten, __pyx_t_1) < 0) __PYX_ERR(0, 1158, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1171
 * 
 * 
 * class _GraphicsElements(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, content, evaluation):
 *         self.evaluation = evaluation
 */
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__144); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__144, __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, 1171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mathics/builtin/graphics.py":1172
 * 
 * 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__146)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1172, __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, 1172, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1245
 *         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__148)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1245, __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, 1245, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1258
 *         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__150)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1258, __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, 1258, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1171
 * 
 * 
 * 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__144, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1171, __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, 1171, __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":1262
 * 
 * 
 * class GraphicsElements(_GraphicsElements):             # <<<<<<<<<<<<<<
 *     coords = Coords
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_GraphicsElements_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1262, __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, 1262, __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, 1262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1263
 * 
 * class GraphicsElements(_GraphicsElements):
 *     coords = Coords             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, content, evaluation, neg_y=False):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Coords); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_coords, __pyx_t_4) < 0) __PYX_ERR(0, 1263, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":1265
 *     coords = Coords
 * 
 *     def __init__(self, content, evaluation, neg_y=False):             # <<<<<<<<<<<<<<
 *         super(GraphicsElements, self).__init__(content, evaluation)
 *         self.neg_y = neg_y
 */
  __pyx_t_4 = __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__152)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__153);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init_2, __pyx_t_4) < 0) __PYX_ERR(0, 1265, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":1273
 *         self.content = content
 * 
 *     def translate(self, coords):             # <<<<<<<<<<<<<<
 *         if self.pixel_width is not None:
 *             w = self.extent_width if self.extent_width > 0 else 1
 */
  __pyx_t_4 = __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__155)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_translate, __pyx_t_4) < 0) __PYX_ERR(0, 1273, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":1287
 *             return (coords[0], coords[1])
 * 
 *     def translate_absolute(self, d):             # <<<<<<<<<<<<<<
 *         if self.pixel_width is None:
 *             return (0, 0)
 */
  __pyx_t_4 = __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__157)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_translate_absolute, __pyx_t_4) < 0) __PYX_ERR(0, 1287, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":1294
 *             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_4 = __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__159)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_translate_relative, __pyx_t_4) < 0) __PYX_ERR(0, 1294, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":1300
 *             return x * self.pixel_width
 * 
 *     def extent(self, completely_visible_only=False):             # <<<<<<<<<<<<<<
 *         if completely_visible_only:
 *             ext = total_extent(
 */
  __pyx_t_4 = __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__161)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__162);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_extent, __pyx_t_4) < 0) __PYX_ERR(0, 1300, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":1324
 *         return xmin, xmax, ymin, ymax
 * 
 *     def set_size(             # <<<<<<<<<<<<<<
 *         self, xmin, ymin, extent_width, extent_height, pixel_width, pixel_height
 *     ):
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_16GraphicsElements_11set_size, 0, __pyx_n_s_GraphicsElements_set_size, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__164)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_set_size, __pyx_t_4) < 0) __PYX_ERR(0, 1324, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":1262
 * 
 * 
 * class GraphicsElements(_GraphicsElements):             # <<<<<<<<<<<<<<
 *     coords = Coords
 * 
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_GraphicsElements, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_GraphicsElements, __pyx_t_4) < 0) __PYX_ERR(0, 1262, __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":1333
 * 
 * 
 * class Directive(Builtin):             # <<<<<<<<<<<<<<
 *     attributes = ("ReadProtected",)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1333, __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, 1333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __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, 1333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1334
 * 
 * class Directive(Builtin):
 *     attributes = ("ReadProtected",)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_attributes, __pyx_tuple__165) < 0) __PYX_ERR(0, 1334, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1333
 * 
 * 
 * class Directive(Builtin):             # <<<<<<<<<<<<<<
 *     attributes = ("ReadProtected",)
 * 
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Directive, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Directive, __pyx_t_4) < 0) __PYX_ERR(0, 1333, __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":1337
 * 
 * 
 * class Tiny(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1337, __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, 1337, __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, 1337, __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, 1337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Tiny, __pyx_t_4) < 0) __PYX_ERR(0, 1337, __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":1346
 * 
 * 
 * class Small(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1346, __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, 1346, __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, 1346, __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, 1346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Small, __pyx_t_4) < 0) __PYX_ERR(0, 1346, __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":1355
 * 
 * 
 * class Medium(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1355, __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, 1355, __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, 1355, __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, 1355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Medium, __pyx_t_4) < 0) __PYX_ERR(0, 1355, __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":1364
 * 
 * 
 * class Large(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __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, 1364, __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, 1364, __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, 1364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Large, __pyx_t_4) < 0) __PYX_ERR(0, 1364, __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":1374
 * 
 * element_heads = frozenset(
 *     system_symbols(             # <<<<<<<<<<<<<<
 *         "Arrow",
 *         "BezierCurve",
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_system_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__166, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1373
 * 
 * 
 * element_heads = frozenset(             # <<<<<<<<<<<<<<
 *     system_symbols(
 *         "Arrow",
 */
  __pyx_t_1 = __Pyx_PyFrozenSet_New(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1373, __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, 1373, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1393
 * )
 * 
 * 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, 1393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "mathics/builtin/graphics.py":1395
 * 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, 1395, __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, 1395, __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, 1395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1396
 *     {
 *         "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, 1396, __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, 1395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1397
 *         "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, 1397, __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, 1395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1398
 *         "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, 1398, __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, 1395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1399
 *         "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, 1399, __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, 1395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1400
 *         "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, 1400, __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, 1395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1401
 *         "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, 1401, __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, 1395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1402
 *         "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, 1402, __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, 1395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1403
 *         "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, 1403, __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, 1395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1404
 *         "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, 1404, __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, 1395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1405
 *         "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, 1405, __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, 1395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1406
 *         "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, 1406, __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, 1395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1407
 *         "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, 1407, __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, 1395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1408
 *         "Thin": Thin,
 *         "PointSize": PointSize,
 *         "Arrowheads": Arrowheads,             # <<<<<<<<<<<<<<
 *     }
 * )
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Arrowheads); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1408, __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, 1395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1393
 * )
 * 
 * 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, 1393, __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, 1393, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1412
 * )
 * 
 * style_options = system_symbols_dict(             # <<<<<<<<<<<<<<
 *     {"FontColor": _style, "ImageSizeMultipliers": (lambda *x: x[1])}
 * )
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_system_symbols_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1413
 * 
 * style_options = system_symbols_dict(
 *     {"FontColor": _style, "ImageSizeMultipliers": (lambda *x: x[1])}             # <<<<<<<<<<<<<<
 * )
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1413, __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, 1413, __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, 1413, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_28lambda8, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_ImageSizeMultipliers, __pyx_t_1) < 0) __PYX_ERR(0, 1413, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1412
 * )
 * 
 * style_options = system_symbols_dict(             # <<<<<<<<<<<<<<
 *     {"FontColor": _style, "ImageSizeMultipliers": (lambda *x: x[1])}
 * )
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1412, __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, 1412, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1416
 * )
 * 
 * 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, 1416, __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, 1416, __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, 1416, __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, 1416, __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, 1416, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1419
 * 
 * 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, 1419, __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, 1419, __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, 1419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PySet_Add(__pyx_t_2, __pyx_kp_u_System_EdgeForm) < 0) __PYX_ERR(0, 1419, __pyx_L1_error)
  if (PySet_Add(__pyx_t_2, __pyx_kp_u_System_FaceForm) < 0) __PYX_ERR(0, 1419, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1419, __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":1418
 * 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, 1418, __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, 1418, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1422
 * )
 * 
 * GLOBALS.update(             # <<<<<<<<<<<<<<
 *     {
 *         "Rectangle": Rectangle,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_GLOBALS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1424
 * GLOBALS.update(
 *     {
 *         "Rectangle": Rectangle,             # <<<<<<<<<<<<<<
 *         "Disk": Disk,
 *         "Circle": Circle,
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Rectangle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_Rectangle, __pyx_t_1) < 0) __PYX_ERR(0, 1424, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1425
 *     {
 *         "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, 1425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_Disk, __pyx_t_1) < 0) __PYX_ERR(0, 1424, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1426
 *         "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, 1426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_Circle, __pyx_t_1) < 0) __PYX_ERR(0, 1424, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1427
 *         "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, 1427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_Polygon, __pyx_t_1) < 0) __PYX_ERR(0, 1424, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1428
 *         "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, 1428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_RegularPolygon, __pyx_t_1) < 0) __PYX_ERR(0, 1424, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1429
 *         "Polygon": Polygon,
 *         "RegularPolygon": RegularPolygon,
 *         "Inset": Inset,             # <<<<<<<<<<<<<<
 *         "Text": Text,
 *     }
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Inset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_Inset, __pyx_t_1) < 0) __PYX_ERR(0, 1424, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1430
 *         "RegularPolygon": RegularPolygon,
 *         "Inset": Inset,
 *         "Text": Text,             # <<<<<<<<<<<<<<
 *     }
 * )
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_Text, __pyx_t_1) < 0) __PYX_ERR(0, 1424, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1422
 * )
 * 
 * GLOBALS.update(             # <<<<<<<<<<<<<<
 *     {
 *         "Rectangle": Rectangle,
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1422, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1434
 * )
 * 
 * GLOBALS.update(styles)             # <<<<<<<<<<<<<<
 * 
 * GRAPHICS_SYMBOLS = set(
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_GLOBALS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_update); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1434, __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_styles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1437
 * 
 * GRAPHICS_SYMBOLS = set(
 *     ["System`List", "System`Rule", "System`VertexColors"]             # <<<<<<<<<<<<<<
 *     + list(element_heads)
 *     + [element + "Box" for element in element_heads]
 */
  __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_kp_u_System_List);
  __Pyx_GIVEREF(__pyx_kp_u_System_List);
  PyList_SET_ITEM(__pyx_t_3, 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_3, 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_3, 2, __pyx_kp_u_System_VertexColors);

  /* "mathics/builtin/graphics.py":1438
 * GRAPHICS_SYMBOLS = set(
 *     ["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, 1438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1438, __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;
  { /* enter inner scope */

    /* "mathics/builtin/graphics.py":1439
 *     ["System`List", "System`Rule", "System`VertexColors"]
 *     + list(element_heads)
 *     + [element + "Box" for element in element_heads]             # <<<<<<<<<<<<<<
 *     + list(style_heads)
 * )
 */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1439, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_element_heads); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1439, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1439, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1439, __pyx_L4_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1439, __pyx_L4_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1439, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1439, __pyx_L4_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1439, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_6(__pyx_t_4);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1439, __pyx_L4_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XGOTREF(__pyx_9genexpr21__pyx_v_7mathics_7builtin_8graphics_element);
      __Pyx_DECREF_SET(__pyx_9genexpr21__pyx_v_7mathics_7builtin_8graphics_element, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_Add(__pyx_9genexpr21__pyx_v_7mathics_7builtin_8graphics_element, __pyx_n_u_Box); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1439, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1439, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_9genexpr21__pyx_v_7mathics_7builtin_8graphics_element);
    __Pyx_DECREF_SET(__pyx_9genexpr21__pyx_v_7mathics_7builtin_8graphics_element, Py_None);
    goto __pyx_L7_exit_scope;
    __pyx_L4_error:;
    __Pyx_GOTREF(__pyx_9genexpr21__pyx_v_7mathics_7builtin_8graphics_element);
    __Pyx_DECREF_SET(__pyx_9genexpr21__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_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1439, __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;

  /* "mathics/builtin/graphics.py":1440
 *     + list(element_heads)
 *     + [element + "Box" for element in element_heads]
 *     + list(style_heads)             # <<<<<<<<<<<<<<
 * )
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_style_heads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1440, __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;

  /* "mathics/builtin/graphics.py":1436
 * GLOBALS.update(styles)
 * 
 * GRAPHICS_SYMBOLS = set(             # <<<<<<<<<<<<<<
 *     ["System`List", "System`Rule", "System`VertexColors"]
 *     + list(element_heads)
 */
  __pyx_t_1 = PySet_New(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1436, __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_GRAPHICS_SYMBOLS, __pyx_t_1) < 0) __PYX_ERR(0, 1436, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1
 * # -*- 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);
  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;
}

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

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

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

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

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallNoArg */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, NULL, 0);
    }
#endif
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
#else
    if (likely(PyCFunction_Check(func)))
#endif
    {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

/* PyCFunctionFastCall */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
    PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    int flags = PyCFunction_GET_FLAGS(func);
    assert(PyCFunction_Check(func));
    assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
    assert(nargs >= 0);
    assert(nargs == 0 || args != NULL);
    /* _PyCFunction_FastCallDict() must not be called with an exception set,
       because it may clear it (directly or indirectly) and so the
       caller loses its exception */
    assert(!PyErr_Occurred());
    if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
        return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
    } else {
        return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
    }
}
#endif

/* PyObjectCallOneArg */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, &arg, 1);
    }
#endif
    if (likely(PyCFunction_Check(func))) {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
#if CYTHON_FAST_PYCCALL
        } else if (__Pyx_PyFastCFunction_Check(func)) {
            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

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

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

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

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

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

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

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

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

/* None */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

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

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

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

/* SliceTupleAndList */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_crop_slice(Py_ssize_t* _start, Py_ssize_t* _stop, Py_ssize_t* _length) {
    Py_ssize_t start = *_start, stop = *_stop, length = *_length;
    if (start < 0) {
        start += length;
        if (start < 0)
            start = 0;
    }
    if (stop < 0)
        stop += length;
    else if (stop > length)
        stop = length;
    *_length = stop - start;
    *_start = start;
    *_stop = stop;
}
static CYTHON_INLINE void __Pyx_copy_object_array(PyObject** CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
    PyObject *v;
    Py_ssize_t i;
    for (i = 0; i < length; i++) {
        v = dest[i] = src[i];
        Py_INCREF(v);
    }
}
static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(
            PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
    PyObject* dest;
    Py_ssize_t length = PyList_GET_SIZE(src);
    __Pyx_crop_slice(&start, &stop, &length);
    if (unlikely(length <= 0))
        return PyList_New(0);
    dest = PyList_New(length);
    if (unlikely(!dest))
        return NULL;
    __Pyx_copy_object_array(
        ((PyListObject*)src)->ob_item + start,
        ((PyListObject*)dest)->ob_item,
        length);
    return dest;
}
static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(
            PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
    PyObject* dest;
    Py_ssize_t length = PyTuple_GET_SIZE(src);
    __Pyx_crop_slice(&start, &stop, &length);
    if (unlikely(length <= 0))
        return PyTuple_New(0);
    dest = PyTuple_New(length);
    if (unlikely(!dest))
        return NULL;
    __Pyx_copy_object_array(
        ((PyTupleObject*)src)->ob_item + start,
        ((PyTupleObject*)dest)->ob_item,
        length);
    return dest;
}
#endif

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
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

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

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

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

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

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

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

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

/* 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) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        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) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } 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) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } 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;
}

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

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

/* 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;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
static CYTHON_INLINE
PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) {
#if PY_VERSION_HEX <= 0x030A00A1
    return _PyGen_Send(gen, arg);
#else
    PyObject *result;
    if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) {
        if (PyAsyncGen_CheckExact(gen)) {
            assert(result == Py_None);
            PyErr_SetNone(PyExc_StopAsyncIteration);
        }
        else if (result == Py_None) {
            PyErr_SetNone(PyExc_StopIteration);
        }
        else {
            _PyGen_SetStopIterationValue(result);
        }
        Py_CLEAR(result);
    }
    return result;
#endif
}
#endif
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
    PyObject *ret;
    PyObject *val = NULL;
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
    ret = __Pyx_Coroutine_SendEx(gen, val, 0);
    Py_XDECREF(val);
    return ret;
}
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
    PyObject *retval;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_AsyncGen_USED
        if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
            ret = __Pyx_async_gen_asend_send(yf, value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyCoro_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        {
            if (value == Py_None)
                ret = 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 = __Pyx_PyGen_Send((PyGenObject*)yf, NULL);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, Py_None);
        } else
        #endif
            ret = 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);
    __Pyx_SET_REFCNT(self, 1);
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
        PyObject *finalizer = agen->ag_finalizer;
        if (finalizer && !agen->ag_closed) {
            PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
            if (unlikely(!res)) {
                PyErr_WriteUnraisable(self);
            } else {
                Py_DECREF(res);
            }
            __Pyx_ErrRestore(error_type, error_value, error_traceback);
            return;
        }
    }
#endif
    if (unlikely(gen->resume_label == 0 && !error_value)) {
#ifdef __Pyx_Coroutine_USED
#ifdef __Pyx_Generator_USED
    if (!__Pyx_Generator_CheckExact(self))
#endif
        {
        PyObject_GC_UnTrack(self);
#if PY_MAJOR_VERSION >= 3  || defined(PyErr_WarnFormat)
        if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
            PyErr_WriteUnraisable(self);
#else
        {PyObject *msg;
        char *cmsg;
        #if CYTHON_COMPILING_IN_PYPY
        msg = NULL;
        cmsg = (char*) "coroutine was never awaited";
        #else
        char *cname;
        PyObject *qualname;
        qualname = gen->gi_qualname;
        cname = PyString_AS_STRING(qualname);
        msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
        if (unlikely(!msg)) {
            PyErr_Clear();
            cmsg = (char*) "coroutine was never awaited";
        } else {
            cmsg = PyString_AS_STRING(msg);
        }
        #endif
        if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
            PyErr_WriteUnraisable(self);
        Py_XDECREF(msg);}
#endif
        PyObject_GC_Track(self);
        }
#endif
    } else {
        PyObject *res = __Pyx_Coroutine_Close(self);
        if (unlikely(!res)) {
            if (PyErr_Occurred())
                PyErr_WriteUnraisable(self);
        } else {
            Py_DECREF(res);
        }
    }
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt > 0);
    if (--self->ob_refcnt == 0) {
        return;
    }
    {
        Py_ssize_t refcnt = self->ob_refcnt;
        _Py_NewReference(self);
        __Pyx_SET_REFCNT(self, 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 */
