/* Generated by Cython 0.29.32 */

#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* 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_32"
#define CYTHON_HEX_VERSION 0x001D20F0
#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
  #define CYTHON_COMPILING_IN_NOGIL 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
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900)
  #endif
#elif defined(PYSTON_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_NOGIL 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
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
#elif defined(PY_NOGIL)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_NOGIL 1
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #ifndef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #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
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #define CYTHON_COMPILING_IN_NOGIL 0
  #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 || PY_VERSION_HEX >= 0x030B00A2
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #if PY_VERSION_HEX >= 0x030B00A4
    #undef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 0
  #elif !defined(CYTHON_FAST_THREAD_STATE)
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
  #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
  #if PY_VERSION_HEX >= 0x030B00A4
    #undef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK 0
  #elif !defined(CYTHON_USE_EXC_INFO_STACK)
    #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
  #endif
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
  #endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #if PY_MAJOR_VERSION < 3
    #include "longintrepr.h"
  #endif
  #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"
  #define __Pyx_DefaultClassType PyType_Type
#if PY_VERSION_HEX >= 0x030B00A1
    static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f,
                                                    PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                                    PyObject *fv, PyObject *cell, PyObject* fn,
                                                    PyObject *name, int fline, PyObject *lnos) {
        PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
        PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
        const char *fn_cstr=NULL;
        const char *name_cstr=NULL;
        PyCodeObject* co=NULL;
        PyObject *type, *value, *traceback;
        PyErr_Fetch(&type, &value, &traceback);
        if (!(kwds=PyDict_New())) goto end;
        if (!(argcount=PyLong_FromLong(a))) goto end;
        if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
        if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
        if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
        if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
        if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
        if (!(nlocals=PyLong_FromLong(l))) goto end;
        if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
        if (!(stacksize=PyLong_FromLong(s))) goto end;
        if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
        if (!(flags=PyLong_FromLong(f))) goto end;
        if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
        if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
        if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
        if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
        if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
        if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
        if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
        Py_XDECREF((PyObject*)co);
        co = (PyCodeObject*)call_result;
        call_result = NULL;
        if (0) {
            cleanup_code_too:
            Py_XDECREF((PyObject*)co);
            co = NULL;
        }
        end:
        Py_XDECREF(kwds);
        Py_XDECREF(argcount);
        Py_XDECREF(posonlyargcount);
        Py_XDECREF(kwonlyargcount);
        Py_XDECREF(nlocals);
        Py_XDECREF(stacksize);
        Py_XDECREF(replace);
        Py_XDECREF(call_result);
        Py_XDECREF(empty);
        if (type) {
            PyErr_Restore(type, value, traceback);
        }
        return co;
    }
#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
  #if defined(PyUnicode_IS_READY)
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #else
  #define __Pyx_PyUnicode_READY(op)       (0)
  #endif
  #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)
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
  #else
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
  #endif
  #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   __Pyx_PyIndex_AsHash_t
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   __Pyx_PyIndex_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(WIN32) || defined(MS_WINDOWS)
  #if !defined(_USE_MATH_DEFINES)
    #define _USE_MATH_DEFINES
  #endif
#endif
#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif

#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__brlapi
#define __PYX_HAVE_API__brlapi
/* Early includes */
#include <stdint.h>
#include <string.h>
#include <stdio.h>
#include "sys/types.h"
#include "Programs/brlapi_protocol.h"
#include "Programs/brlapi.h"
#include "bindings.h"
#include "stdlib.h"
#include "string.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

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

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

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
    return (size_t) i < (size_t) limit;
}
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER)
    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
#define __Pyx_PySequence_Tuple(obj)\
    (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#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[] = {
  "brlapi.pyx",
  "stringsource",
  "type.pxd",
  "constants.auto.pyx",
};
/* NoFastGil.proto */
#define __Pyx_PyGILState_Ensure PyGILState_Ensure
#define __Pyx_PyGILState_Release PyGILState_Release
#define __Pyx_FastGIL_Remember()
#define __Pyx_FastGIL_Forget()
#define __Pyx_FastGilFuncInit()

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


/*--- Type declarations ---*/
struct __pyx_obj_6brlapi_WriteStruct;
struct __pyx_obj_6brlapi_Connection;
struct __pyx_obj_6brlapi___pyx_scope_struct__watchParameter;

/* "brlapi.pyx":283
 * 		return self.settings.auth
 * 
 * cdef class WriteStruct:             # <<<<<<<<<<<<<<
 * 	"""Structure containing arguments to be given to Connection.write()
 * 	See brlapi_writeArguments_t(3).
 */
struct __pyx_obj_6brlapi_WriteStruct {
  PyObject_HEAD
  brlapi_writeArguments_t props;
};


/* "brlapi.pyx":421
 * 				self.props.orMask = NULL
 * 
 * cdef class Connection:             # <<<<<<<<<<<<<<
 * 	"""Class which manages the bridge between your program and BrlAPI"""
 * 
 */
struct __pyx_obj_6brlapi_Connection {
  PyObject_HEAD
  brlapi_handle_t *h;
  brlapi_connectionSettings_t settings;
  int fd;
};


/* "brlapi.pyx":1051
 * 		c_brlapi.free(c_value)
 * 
 * 	def watchParameter(self, param, subparam, flags, func):             # <<<<<<<<<<<<<<
 * 		"""Set a parameter change callback.
 * 		See brlapi_watchParameter(3).
 */
struct __pyx_obj_6brlapi___pyx_scope_struct__watchParameter {
  PyObject_HEAD
  PyObject *__pyx_v_func;
};


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

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

/* 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
#if CYTHON_FAST_PYCALL
  static size_t __pyx_pyframe_localsplus_offset = 0;
  #include "frameobject.h"
#if PY_VERSION_HEX >= 0x030b00a6
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
  #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 // CYTHON_FAST_PYCALL
#endif

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

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

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

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

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

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

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

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

/* decode_bytes.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_bytes(
         PyObject* string, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    return __Pyx_decode_c_bytes(
        PyBytes_AS_STRING(string), PyBytes_GET_SIZE(string),
        start, stop, encoding, errors, decode_func);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto
#define __PYX_HAVE_RT_ImportType_proto
enum __Pyx_ImportType_CheckSize {
   __Pyx_ImportType_CheckSize_Error = 0,
   __Pyx_ImportType_CheckSize_Warn = 1,
   __Pyx_ImportType_CheckSize_Ignore = 2
};
static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
#endif

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

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

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

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

/* 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_brlapi_keyCode_t(brlapi_keyCode_t value);

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

/* CIntFromPy.proto */
static CYTHON_INLINE brlapi_keyCode_t __Pyx_PyInt_As_brlapi_keyCode_t(PyObject *);

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

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_brlapi_param_type_t(brlapi_param_type_t value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value);

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

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

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

/* CIntFromPy.proto */
static CYTHON_INLINE brlapi_rangeType_t __Pyx_PyInt_As_brlapi_rangeType_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE brlapi_param_t __Pyx_PyInt_As_brlapi_param_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_brlapi_param_t(brlapi_param_t value);

/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(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)

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

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


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

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

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

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.type' */
static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;

/* Module declarations from 'cpython' */

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

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

/* Module declarations from 'c_brlapi' */

/* Module declarations from 'brlapi' */
static PyTypeObject *__pyx_ptype_6brlapi_WriteStruct = 0;
static PyTypeObject *__pyx_ptype_6brlapi_Connection = 0;
static PyTypeObject *__pyx_ptype_6brlapi___pyx_scope_struct__watchParameter = 0;
static PyObject *__pyx_f_6brlapi__parameterToPython(brlapi_param_t, void const *, size_t); /*proto*/
#define __Pyx_MODULE_NAME "brlapi"
extern int __pyx_module_is_main_brlapi;
int __pyx_module_is_main_brlapi = 0;

/* Implementation of 'brlapi' */
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_TypeError;
static const char __pyx_k_d[] = "d";
static const char __pyx_k__2[] = "";
static const char __pyx_k__4[] = ": ";
static const char __pyx_k__5[] = ")";
static const char __pyx_k__10[] = "\000";
static const char __pyx_k_buf[] = "buf";
static const char __pyx_k_dkc[] = "dkc";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_ekc[] = "ekc";
static const char __pyx_k_msg[] = "msg";
static const char __pyx_k_ret[] = "ret";
static const char __pyx_k_set[] = "set";
static const char __pyx_k_str[] = "__str__";
static const char __pyx_k_tty[] = "tty";
static const char __pyx_k_DOT1[] = "DOT1";
static const char __pyx_k_DOT2[] = "DOT2";
static const char __pyx_k_DOT3[] = "DOT3";
static const char __pyx_k_DOT4[] = "DOT4";
static const char __pyx_k_DOT5[] = "DOT5";
static const char __pyx_k_DOT6[] = "DOT6";
static const char __pyx_k_DOT7[] = "DOT7";
static const char __pyx_k_DOT8[] = "DOT8";
static const char __pyx_k_DOTC[] = "DOTC";
static const char __pyx_k_auth[] = "auth";
static const char __pyx_k_code[] = "code";
static const char __pyx_k_data[] = "data";
static const char __pyx_k_flag[] = "flag";
static const char __pyx_k_func[] = "func";
static const char __pyx_k_host[] = "host";
static const char __pyx_k_init[] = "__init__";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_name[] = "__name__";
static const char __pyx_k_path[] = "path";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_size[] = "size";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_text[] = "text";
static const char __pyx_k_type[] = "type";
static const char __pyx_k_wait[] = "wait";
static const char __pyx_k_ASCII[] = "ASCII";
static const char __pyx_k_EINTR[] = "EINTR";
static const char __pyx_k_UTF_8[] = "UTF-8";
static const char __pyx_k_cfunc[] = "cfunc";
static const char __pyx_k_errno[] = "errno";
static const char __pyx_k_error[] = "error";
static const char __pyx_k_flags[] = "flags";
static const char __pyx_k_major[] = "major";
static const char __pyx_k_minor[] = "minor";
static const char __pyx_k_param[] = "param";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_str_2[] = "str";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_write[] = "write";
static const char __pyx_k_ENOENT[] = "ENOENT";
static const char __pyx_k_attrOr[] = "attrOr";
static const char __pyx_k_brlapi[] = "brlapi";
static const char __pyx_k_center[] = "center";
static const char __pyx_k_cursor[] = "cursor";
static const char __pyx_k_decode[] = "decode";
static const char __pyx_k_driver[] = "driver";
static const char __pyx_k_encode[] = "encode";
static const char __pyx_k_errfun[] = "errfun";
static const char __pyx_k_errors[] = "errors";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_latin1[] = "latin1";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_orMask[] = "orMask";
static const char __pyx_k_reduce[] = "__reduce__";
static const char __pyx_k_retval[] = "retval";
static const char __pyx_k_KEY_MAX[] = "KEY_MAX";
static const char __pyx_k_andMask[] = "andMask";
static const char __pyx_k_attrAnd[] = "attrAnd";
static const char __pyx_k_charset[] = "charset";
static const char __pyx_k_command[] = "command";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_replace[] = "replace";
static const char __pyx_k_argument[] = "argument";
static const char __pyx_k_brlerrno[] = "brlerrno";
static const char __pyx_k_gaierrno[] = "gaierrno";
static const char __pyx_k_getstate[] = "__getstate__";
static const char __pyx_k_key_type[] = "key_type";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_revision[] = "revision";
static const char __pyx_k_setstate[] = "__setstate__";
static const char __pyx_k_settings[] = "settings";
static const char __pyx_k_subparam[] = "subparam";
static const char __pyx_k_with_key[] = " with key ";
static const char __pyx_k_ERROR_EOF[] = "ERROR_EOF";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_exception[] = "exception";
static const char __pyx_k_libcerrno[] = "libcerrno";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_parameter[] = "parameter";
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
static const char __pyx_k_CURSOR_OFF[] = "CURSOR_OFF";
static const char __pyx_k_Connection[] = "Connection";
static const char __pyx_k_KEY_SYM_F1[] = "KEY_SYM_F1";
static const char __pyx_k_KEY_SYM_F2[] = "KEY_SYM_F2";
static const char __pyx_k_KEY_SYM_F3[] = "KEY_SYM_F3";
static const char __pyx_k_KEY_SYM_F4[] = "KEY_SYM_F4";
static const char __pyx_k_KEY_SYM_F5[] = "KEY_SYM_F5";
static const char __pyx_k_KEY_SYM_F6[] = "KEY_SYM_F6";
static const char __pyx_k_KEY_SYM_F7[] = "KEY_SYM_F7";
static const char __pyx_k_KEY_SYM_F8[] = "KEY_SYM_F8";
static const char __pyx_k_KEY_SYM_F9[] = "KEY_SYM_F9";
static const char __pyx_k_KEY_SYM_UP[] = "KEY_SYM_UP";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_brlapi_pyx[] = "brlapi.pyx";
static const char __pyx_k_brlerrno_2[] = "\n(brlerrno ";
static const char __pyx_k_gaierrno_2[] = ", gaierrno ";
static const char __pyx_k_regionSize[] = "regionSize";
static const char __pyx_k_timeout_ms[] = "timeout_ms";
static const char __pyx_k_ERROR_NOMEM[] = "ERROR_NOMEM";
static const char __pyx_k_KEY_CMD_BOT[] = "KEY_CMD_BOT";
static const char __pyx_k_KEY_CMD_GUI[] = "KEY_CMD_GUI";
static const char __pyx_k_KEY_CMD_TOP[] = "KEY_CMD_TOP";
static const char __pyx_k_KEY_SYM_END[] = "KEY_SYM_END";
static const char __pyx_k_KEY_SYM_F10[] = "KEY_SYM_F10";
static const char __pyx_k_KEY_SYM_F11[] = "KEY_SYM_F11";
static const char __pyx_k_KEY_SYM_F12[] = "KEY_SYM_F12";
static const char __pyx_k_KEY_SYM_F13[] = "KEY_SYM_F13";
static const char __pyx_k_KEY_SYM_F14[] = "KEY_SYM_F14";
static const char __pyx_k_KEY_SYM_F15[] = "KEY_SYM_F15";
static const char __pyx_k_KEY_SYM_F16[] = "KEY_SYM_F16";
static const char __pyx_k_KEY_SYM_F17[] = "KEY_SYM_F17";
static const char __pyx_k_KEY_SYM_F18[] = "KEY_SYM_F18";
static const char __pyx_k_KEY_SYM_F19[] = "KEY_SYM_F19";
static const char __pyx_k_KEY_SYM_F20[] = "KEY_SYM_F20";
static const char __pyx_k_KEY_SYM_F21[] = "KEY_SYM_F21";
static const char __pyx_k_KEY_SYM_F22[] = "KEY_SYM_F22";
static const char __pyx_k_KEY_SYM_F23[] = "KEY_SYM_F23";
static const char __pyx_k_KEY_SYM_F24[] = "KEY_SYM_F24";
static const char __pyx_k_KEY_SYM_F25[] = "KEY_SYM_F25";
static const char __pyx_k_KEY_SYM_F26[] = "KEY_SYM_F26";
static const char __pyx_k_KEY_SYM_F27[] = "KEY_SYM_F27";
static const char __pyx_k_KEY_SYM_F28[] = "KEY_SYM_F28";
static const char __pyx_k_KEY_SYM_F29[] = "KEY_SYM_F29";
static const char __pyx_k_KEY_SYM_F30[] = "KEY_SYM_F30";
static const char __pyx_k_KEY_SYM_F31[] = "KEY_SYM_F31";
static const char __pyx_k_KEY_SYM_F32[] = "KEY_SYM_F32";
static const char __pyx_k_KEY_SYM_F33[] = "KEY_SYM_F33";
static const char __pyx_k_KEY_SYM_F34[] = "KEY_SYM_F34";
static const char __pyx_k_KEY_SYM_F35[] = "KEY_SYM_F35";
static const char __pyx_k_KEY_SYM_TAB[] = "KEY_SYM_TAB";
static const char __pyx_k_PARAMF_SELF[] = "PARAMF_SELF";
static const char __pyx_k_PARAM_COUNT[] = "PARAM_COUNT";
static const char __pyx_k_TTY_DEFAULT[] = "TTY_DEFAULT";
static const char __pyx_k_WriteStruct[] = "WriteStruct";
static const char __pyx_k_displaySize[] = "displaySize";
static const char __pyx_k_libcerrno_2[] = ", libcerrno ";
static const char __pyx_k_regionBegin[] = "regionBegin";
static const char __pyx_k_CURSOR_LEAVE[] = "CURSOR_LEAVE";
static const char __pyx_k_ECONNREFUSED[] = "ECONNREFUSED";
static const char __pyx_k_ERROR_GAIERR[] = "ERROR_GAIERR";
static const char __pyx_k_KEY_CMD_BACK[] = "KEY_CMD_BACK";
static const char __pyx_k_KEY_CMD_HELP[] = "KEY_CMD_HELP";
static const char __pyx_k_KEY_CMD_HOME[] = "KEY_CMD_HOME";
static const char __pyx_k_KEY_CMD_INFO[] = "KEY_CMD_INFO";
static const char __pyx_k_KEY_CMD_LNDN[] = "KEY_CMD_LNDN";
static const char __pyx_k_KEY_CMD_LNUP[] = "KEY_CMD_LNUP";
static const char __pyx_k_KEY_CMD_META[] = "KEY_CMD_META";
static const char __pyx_k_KEY_CMD_MUTE[] = "KEY_CMD_MUTE";
static const char __pyx_k_KEY_CMD_NOOP[] = "KEY_CMD_NOOP";
static const char __pyx_k_KEY_CMD_TIME[] = "KEY_CMD_TIME";
static const char __pyx_k_KEY_SYM_DOWN[] = "KEY_SYM_DOWN";
static const char __pyx_k_KEY_SYM_HOME[] = "KEY_SYM_HOME";
static const char __pyx_k_KEY_SYM_LEFT[] = "KEY_SYM_LEFT";
static const char __pyx_k_KEY_TYPE_CMD[] = "KEY_TYPE_CMD";
static const char __pyx_k_KEY_TYPE_SYM[] = "KEY_TYPE_SYM";
static const char __pyx_k_PARAMF_LOCAL[] = "PARAMF_LOCAL";
static const char __pyx_k_callbackData[] = "callbackData";
static const char __pyx_k_ERROR_LIBCERR[] = "ERROR_LIBCERR";
static const char __pyx_k_ERROR_SUCCESS[] = "ERROR_SUCCESS";
static const char __pyx_k_ERROR_TTYBUSY[] = "ERROR_TTYBUSY";
static const char __pyx_k_KEY_CMD_ALERT[] = "KEY_CMD_ALERT";
static const char __pyx_k_KEY_CMD_ALTGR[] = "KEY_CMD_ALTGR";
static const char __pyx_k_KEY_CMD_CHRLT[] = "KEY_CMD_CHRLT";
static const char __pyx_k_KEY_CMD_CHRRT[] = "KEY_CMD_CHRRT";
static const char __pyx_k_KEY_CMD_LEARN[] = "KEY_CMD_LEARN";
static const char __pyx_k_KEY_CMD_LNBEG[] = "KEY_CMD_LNBEG";
static const char __pyx_k_KEY_CMD_LNEND[] = "KEY_CMD_LNEND";
static const char __pyx_k_KEY_CMD_PASTE[] = "KEY_CMD_PASTE";
static const char __pyx_k_KEY_CMD_ROUTE[] = "KEY_CMD_ROUTE";
static const char __pyx_k_KEY_CMD_SHIFT[] = "KEY_CMD_SHIFT";
static const char __pyx_k_KEY_CMD_TUNES[] = "KEY_CMD_TUNES";
static const char __pyx_k_KEY_CMD_UPPER[] = "KEY_CMD_UPPER";
static const char __pyx_k_KEY_CMD_WINDN[] = "KEY_CMD_WINDN";
static const char __pyx_k_KEY_CMD_WINUP[] = "KEY_CMD_WINUP";
static const char __pyx_k_KEY_CODE_MASK[] = "KEY_CODE_MASK";
static const char __pyx_k_KEY_SYM_RIGHT[] = "KEY_SYM_RIGHT";
static const char __pyx_k_KEY_TYPE_MASK[] = "KEY_TYPE_MASK";
static const char __pyx_k_PARAMF_GLOBAL[] = "PARAMF_GLOBAL";
static const char __pyx_k_displayNumber[] = "displayNumber";
static const char __pyx_k_expandKeyCode[] = "expandKeyCode";
static const char __pyx_k_rangeType_all[] = "rangeType_all";
static const char __pyx_k_rangeType_key[] = "rangeType_key";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
static const char __pyx_k_ERROR_EMPTYKEY[] = "ERROR_EMPTYKEY";
static const char __pyx_k_KEY_CMD_ATTRDN[] = "KEY_CMD_ATTRDN";
static const char __pyx_k_KEY_CMD_ATTRUP[] = "KEY_CMD_ATTRUP";
static const char __pyx_k_KEY_CMD_BRLKBD[] = "KEY_CMD_BRLKBD";
static const char __pyx_k_KEY_CMD_CSRTRK[] = "KEY_CMD_CSRTRK";
static const char __pyx_k_KEY_CMD_CSRVIS[] = "KEY_CMD_CSRVIS";
static const char __pyx_k_KEY_CMD_DISPMD[] = "KEY_CMD_DISPMD";
static const char __pyx_k_KEY_CMD_FREEZE[] = "KEY_CMD_FREEZE";
static const char __pyx_k_KEY_CMD_FWINLT[] = "KEY_CMD_FWINLT";
static const char __pyx_k_KEY_CMD_FWINRT[] = "KEY_CMD_FWINRT";
static const char __pyx_k_KEY_CMD_HWINLT[] = "KEY_CMD_HWINLT";
static const char __pyx_k_KEY_CMD_HWINRT[] = "KEY_CMD_HWINRT";
static const char __pyx_k_KEY_CMD_PASSAT[] = "KEY_CMD_PASSAT";
static const char __pyx_k_KEY_CMD_PASSXT[] = "KEY_CMD_PASSXT";
static const char __pyx_k_KEY_CMD_RETURN[] = "KEY_CMD_RETURN";
static const char __pyx_k_KEY_CODE_SHIFT[] = "KEY_CODE_SHIFT";
static const char __pyx_k_KEY_FLAGS_MASK[] = "KEY_FLAGS_MASK";
static const char __pyx_k_KEY_SYM_DELETE[] = "KEY_SYM_DELETE";
static const char __pyx_k_KEY_SYM_ESCAPE[] = "KEY_SYM_ESCAPE";
static const char __pyx_k_KEY_SYM_INSERT[] = "KEY_SYM_INSERT";
static const char __pyx_k_KEY_TYPE_SHIFT[] = "KEY_TYPE_SHIFT";
static const char __pyx_k_OperationError[] = "OperationError";
static const char __pyx_k_rangeType_code[] = "rangeType_code";
static const char __pyx_k_rangeType_type[] = "rangeType_type";
static const char __pyx_k_writeArguments[] = "writeArguments";
static const char __pyx_k_ConnectionError[] = "ConnectionError";
static const char __pyx_k_DISPLAY_DEFAULT[] = "DISPLAY_DEFAULT";
static const char __pyx_k_ERROR_OPNOTSUPP[] = "ERROR_OPNOTSUPP";
static const char __pyx_k_KEY_CMD_ATTRVIS[] = "KEY_CMD_ATTRVIS";
static const char __pyx_k_KEY_CMD_CONTEXT[] = "KEY_CMD_CONTEXT";
static const char __pyx_k_KEY_CMD_CONTROL[] = "KEY_CMD_CONTROL";
static const char __pyx_k_KEY_CMD_CSRHIDE[] = "KEY_CMD_CSRHIDE";
static const char __pyx_k_KEY_CMD_CSRSIZE[] = "KEY_CMD_CSRSIZE";
static const char __pyx_k_KEY_CMD_CUTLINE[] = "KEY_CMD_CUTLINE";
static const char __pyx_k_KEY_CMD_CUTRECT[] = "KEY_CMD_CUTRECT";
static const char __pyx_k_KEY_CMD_NXDIFLN[] = "KEY_CMD_NXDIFLN";
static const char __pyx_k_KEY_CMD_NXNBWIN[] = "KEY_CMD_NXNBWIN";
static const char __pyx_k_KEY_CMD_NXPGRPH[] = "KEY_CMD_NXPGRPH";
static const char __pyx_k_KEY_CMD_OFFLINE[] = "KEY_CMD_OFFLINE";
static const char __pyx_k_KEY_CMD_PASSPS2[] = "KEY_CMD_PASSPS2";
static const char __pyx_k_KEY_CMD_PRDIFLN[] = "KEY_CMD_PRDIFLN";
static const char __pyx_k_KEY_CMD_PRNBWIN[] = "KEY_CMD_PRNBWIN";
static const char __pyx_k_KEY_CMD_PRPGRPH[] = "KEY_CMD_PRPGRPH";
static const char __pyx_k_KEY_CMD_REFRESH[] = "KEY_CMD_REFRESH";
static const char __pyx_k_KEY_CMD_SAY_ALL[] = "KEY_CMD_SAY_ALL";
static const char __pyx_k_KEY_CMD_SETLEFT[] = "KEY_CMD_SETLEFT";
static const char __pyx_k_KEY_CMD_SETMARK[] = "KEY_CMD_SETMARK";
static const char __pyx_k_KEY_CMD_SIXDOTS[] = "KEY_CMD_SIXDOTS";
static const char __pyx_k_KEY_CMD_SPKHOME[] = "KEY_CMD_SPKHOME";
static const char __pyx_k_KEY_CMD_UNSTICK[] = "KEY_CMD_UNSTICK";
static const char __pyx_k_KEY_FLAGS_SHIFT[] = "KEY_FLAGS_SHIFT";
static const char __pyx_k_KEY_SYM_PAGE_UP[] = "KEY_SYM_PAGE_UP";
static const char __pyx_k_KEY_SYM_UNICODE[] = "KEY_SYM_UNICODE";
static const char __pyx_k_describeKeyCode[] = "describeKeyCode";
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
static const char __pyx_k_ERROR_DEVICEBUSY[] = "ERROR_DEVICEBUSY";
static const char __pyx_k_ERROR_UNKNOWNTTY[] = "ERROR_UNKNOWNTTY";
static const char __pyx_k_KEY_CMD_ARG_MASK[] = "KEY_CMD_ARG_MASK";
static const char __pyx_k_KEY_CMD_BLK_MASK[] = "KEY_CMD_BLK_MASK";
static const char __pyx_k_KEY_CMD_BOT_LEFT[] = "KEY_CMD_BOT_LEFT";
static const char __pyx_k_KEY_CMD_BRL_STOP[] = "KEY_CMD_BRL_STOP";
static const char __pyx_k_KEY_CMD_CAPBLINK[] = "KEY_CMD_CAPBLINK";
static const char __pyx_k_KEY_CMD_CLIP_ADD[] = "KEY_CMD_CLIP_ADD";
static const char __pyx_k_KEY_CMD_CLIP_NEW[] = "KEY_CMD_CLIP_NEW";
static const char __pyx_k_KEY_CMD_COMPBRL6[] = "KEY_CMD_COMPBRL6";
static const char __pyx_k_KEY_CMD_CSRBLINK[] = "KEY_CMD_CSRBLINK";
static const char __pyx_k_KEY_CMD_CUTBEGIN[] = "KEY_CMD_CUTBEGIN";
static const char __pyx_k_KEY_CMD_DESCCHAR[] = "KEY_CMD_DESCCHAR";
static const char __pyx_k_KEY_CMD_GOTOLINE[] = "KEY_CMD_GOTOLINE";
static const char __pyx_k_KEY_CMD_GOTOMARK[] = "KEY_CMD_GOTOMARK";
static const char __pyx_k_KEY_CMD_GUI_BACK[] = "KEY_CMD_GUI_BACK";
static const char __pyx_k_KEY_CMD_GUI_HOME[] = "KEY_CMD_GUI_HOME";
static const char __pyx_k_KEY_CMD_HOST_CUT[] = "KEY_CMD_HOST_CUT";
static const char __pyx_k_KEY_CMD_NXINDENT[] = "KEY_CMD_NXINDENT";
static const char __pyx_k_KEY_CMD_NXPROMPT[] = "KEY_CMD_NXPROMPT";
static const char __pyx_k_KEY_CMD_NXSEARCH[] = "KEY_CMD_NXSEARCH";
static const char __pyx_k_KEY_CMD_PASSDOTS[] = "KEY_CMD_PASSDOTS";
static const char __pyx_k_KEY_CMD_PREFLOAD[] = "KEY_CMD_PREFLOAD";
static const char __pyx_k_KEY_CMD_PREFMENU[] = "KEY_CMD_PREFMENU";
static const char __pyx_k_KEY_CMD_PREFSAVE[] = "KEY_CMD_PREFSAVE";
static const char __pyx_k_KEY_CMD_PRINDENT[] = "KEY_CMD_PRINDENT";
static const char __pyx_k_KEY_CMD_PRPROMPT[] = "KEY_CMD_PRPROMPT";
static const char __pyx_k_KEY_CMD_PRSEARCH[] = "KEY_CMD_PRSEARCH";
static const char __pyx_k_KEY_CMD_SAY_LINE[] = "KEY_CMD_SAY_LINE";
static const char __pyx_k_KEY_CMD_SCR_STOP[] = "KEY_CMD_SCR_STOP";
static const char __pyx_k_KEY_CMD_SELECTVT[] = "KEY_CMD_SELECTVT";
static const char __pyx_k_KEY_CMD_SKPIDLNS[] = "KEY_CMD_SKPIDLNS";
static const char __pyx_k_KEY_CMD_SLIDEWIN[] = "KEY_CMD_SLIDEWIN";
static const char __pyx_k_KEY_CMD_SPK_STOP[] = "KEY_CMD_SPK_STOP";
static const char __pyx_k_KEY_CMD_SWITCHVT[] = "KEY_CMD_SWITCHVT";
static const char __pyx_k_KEY_CMD_TOP_LEFT[] = "KEY_CMD_TOP_LEFT";
static const char __pyx_k_KEY_CMD_TOUCH_AT[] = "KEY_CMD_TOUCH_AT";
static const char __pyx_k_KEY_SYM_LINEFEED[] = "KEY_SYM_LINEFEED";
static const char __pyx_k_PARAM_TYPE_UINT8[] = "PARAM_TYPE_UINT8";
static const char __pyx_k_ERROR_CONNREFUSED[] = "ERROR_CONNREFUSED";
static const char __pyx_k_ERROR_DRIVERERROR[] = "ERROR_DRIVERERROR";
static const char __pyx_k_KEY_CMD_APNDCHARS[] = "KEY_CMD_APNDCHARS";
static const char __pyx_k_KEY_CMD_ARG_SHIFT[] = "KEY_CMD_ARG_SHIFT";
static const char __pyx_k_KEY_CMD_ATTRBLINK[] = "KEY_CMD_ATTRBLINK";
static const char __pyx_k_KEY_CMD_AUTOSPEAK[] = "KEY_CMD_AUTOSPEAK";
static const char __pyx_k_KEY_CMD_BLK_SHIFT[] = "KEY_CMD_BLK_SHIFT";
static const char __pyx_k_KEY_CMD_BRLUCDOTS[] = "KEY_CMD_BRLUCDOTS";
static const char __pyx_k_KEY_CMD_BRL_START[] = "KEY_CMD_BRL_START";
static const char __pyx_k_KEY_CMD_CLIP_COPY[] = "KEY_CMD_CLIP_COPY";
static const char __pyx_k_KEY_CMD_CLIP_SAVE[] = "KEY_CMD_CLIP_SAVE";
static const char __pyx_k_KEY_CMD_COPYCHARS[] = "KEY_CMD_COPYCHARS";
static const char __pyx_k_KEY_CMD_COPY_LINE[] = "KEY_CMD_COPY_LINE";
static const char __pyx_k_KEY_CMD_COPY_RECT[] = "KEY_CMD_COPY_RECT";
static const char __pyx_k_KEY_CMD_CUTAPPEND[] = "KEY_CMD_CUTAPPEND";
static const char __pyx_k_KEY_CMD_GUI_TITLE[] = "KEY_CMD_GUI_TITLE";
static const char __pyx_k_KEY_CMD_HOST_COPY[] = "KEY_CMD_HOST_COPY";
static const char __pyx_k_KEY_CMD_NXDIFCHAR[] = "KEY_CMD_NXDIFCHAR";
static const char __pyx_k_KEY_CMD_PRDIFCHAR[] = "KEY_CMD_PRDIFCHAR";
static const char __pyx_k_KEY_CMD_SAY_ABOVE[] = "KEY_CMD_SAY_ABOVE";
static const char __pyx_k_KEY_CMD_SAY_BELOW[] = "KEY_CMD_SAY_BELOW";
static const char __pyx_k_KEY_CMD_SAY_LOWER[] = "KEY_CMD_SAY_LOWER";
static const char __pyx_k_KEY_CMD_SCR_START[] = "KEY_CMD_SCR_START";
static const char __pyx_k_KEY_CMD_SPK_START[] = "KEY_CMD_SPK_START";
static const char __pyx_k_KEY_CMD_TOUCH_NAV[] = "KEY_CMD_TOUCH_NAV";
static const char __pyx_k_KEY_FLG_INPUT_GUI[] = "KEY_FLG_INPUT_GUI";
static const char __pyx_k_KEY_FLG_KBD_EMUL0[] = "KEY_FLG_KBD_EMUL0";
static const char __pyx_k_KEY_FLG_KBD_EMUL1[] = "KEY_FLG_KBD_EMUL1";
static const char __pyx_k_KEY_FLG_TOGGLE_ON[] = "KEY_FLG_TOGGLE_ON";
static const char __pyx_k_KEY_SYM_BACKSPACE[] = "KEY_SYM_BACKSPACE";
static const char __pyx_k_KEY_SYM_PAGE_DOWN[] = "KEY_SYM_PAGE_DOWN";
static const char __pyx_k_PARAM_CURSOR_DOTS[] = "PARAM_CURSOR_DOTS";
static const char __pyx_k_PARAM_DRIVER_CODE[] = "PARAM_DRIVER_CODE";
static const char __pyx_k_PARAM_DRIVER_NAME[] = "PARAM_DRIVER_NAME";
static const char __pyx_k_PARAM_RETAIN_DOTS[] = "PARAM_RETAIN_DOTS";
static const char __pyx_k_PARAM_TYPE_STRING[] = "PARAM_TYPE_STRING";
static const char __pyx_k_PARAM_TYPE_UINT16[] = "PARAM_TYPE_UINT16";
static const char __pyx_k_PARAM_TYPE_UINT32[] = "PARAM_TYPE_UINT32";
static const char __pyx_k_PARAM_TYPE_UINT64[] = "PARAM_TYPE_UINT64";
static const char __pyx_k_getLibraryVersion[] = "getLibraryVersion";
static const char __pyx_k_rangeType_command[] = "rangeType_command";
static const char __pyx_k_BRLTTY_is_too_busy[] = "\nBRLTTY is too busy...";
static const char __pyx_k_KEY_CMD_AUTOREPEAT[] = "KEY_CMD_AUTOREPEAT";
static const char __pyx_k_KEY_CMD_CONTRACTED[] = "KEY_CMD_CONTRACTED";
static const char __pyx_k_KEY_CMD_FWINLTSKIP[] = "KEY_CMD_FWINLTSKIP";
static const char __pyx_k_KEY_CMD_FWINRTSKIP[] = "KEY_CMD_FWINRTSKIP";
static const char __pyx_k_KEY_CMD_HOST_PASTE[] = "KEY_CMD_HOST_PASTE";
static const char __pyx_k_KEY_CMD_INDICATORS[] = "KEY_CMD_INDICATORS";
static const char __pyx_k_KEY_CMD_RESTARTBRL[] = "KEY_CMD_RESTARTBRL";
static const char __pyx_k_KEY_CMD_ROUTE_LINE[] = "KEY_CMD_ROUTE_LINE";
static const char __pyx_k_KEY_CMD_SAY_FASTER[] = "KEY_CMD_SAY_FASTER";
static const char __pyx_k_KEY_CMD_SAY_HIGHER[] = "KEY_CMD_SAY_HIGHER";
static const char __pyx_k_KEY_CMD_SAY_LOUDER[] = "KEY_CMD_SAY_LOUDER";
static const char __pyx_k_KEY_CMD_SAY_SLOWER[] = "KEY_CMD_SAY_SLOWER";
static const char __pyx_k_KEY_CMD_SAY_SOFTER[] = "KEY_CMD_SAY_SOFTER";
static const char __pyx_k_KEY_CMD_TXTSEL_ALL[] = "KEY_CMD_TXTSEL_ALL";
static const char __pyx_k_KEY_CMD_TXTSEL_SET[] = "KEY_CMD_TXTSEL_SET";
static const char __pyx_k_KEY_FLG_INPUT_META[] = "KEY_FLG_INPUT_META";
static const char __pyx_k_KEY_FLG_TOGGLE_OFF[] = "KEY_FLG_TOGGLE_OFF";
static const char __pyx_k_PARAM_DEVICE_MODEL[] = "PARAM_DEVICE_MODEL";
static const char __pyx_k_PARAM_DEVICE_SPEED[] = "PARAM_DEVICE_SPEED";
static const char __pyx_k_PARAM_DISPLAY_SIZE[] = "PARAM_DISPLAY_SIZE";
static const char __pyx_k_PARAM_TYPE_BOOLEAN[] = "PARAM_TYPE_BOOLEAN";
static const char __pyx_k_PARAM_TYPE_KEYCODE[] = "PARAM_TYPE_KEYCODE";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_KEY_CMD_ASPK_INDENT[] = "KEY_CMD_ASPK_INDENT";
static const char __pyx_k_KEY_CMD_CLIP_APPEND[] = "KEY_CMD_CLIP_APPEND";
static const char __pyx_k_KEY_CMD_CSRJMP_VERT[] = "KEY_CMD_CSRJMP_VERT";
static const char __pyx_k_KEY_CMD_SKPBLNKWINS[] = "KEY_CMD_SKPBLNKWINS";
static const char __pyx_k_KEY_FLG_INPUT_ALTGR[] = "KEY_FLG_INPUT_ALTGR";
static const char __pyx_k_KEY_FLG_INPUT_SHIFT[] = "KEY_FLG_INPUT_SHIFT";
static const char __pyx_k_KEY_FLG_INPUT_UPPER[] = "KEY_FLG_INPUT_UPPER";
static const char __pyx_k_KEY_FLG_KBD_RELEASE[] = "KEY_FLG_KBD_RELEASE";
static const char __pyx_k_KEY_FLG_TOGGLE_MASK[] = "KEY_FLG_TOGGLE_MASK";
static const char __pyx_k_PARAM_DEVICE_ONLINE[] = "PARAM_DEVICE_ONLINE";
static const char __pyx_k_couldn_t_connect_to[] = "couldn't connect to ";
static const char __pyx_k_ConnectionError_auth[] = "ConnectionError.auth";
static const char __pyx_k_ConnectionError_host[] = "ConnectionError.host";
static const char __pyx_k_ERROR_AUTHENTICATION[] = "ERROR_AUTHENTICATION";
static const char __pyx_k_ERROR_INVALID_PACKET[] = "ERROR_INVALID_PACKET";
static const char __pyx_k_KEY_CMD_CLIP_RESTORE[] = "KEY_CMD_CLIP_RESTORE";
static const char __pyx_k_KEY_CMD_GUI_APP_LIST[] = "KEY_CMD_GUI_APP_LIST";
static const char __pyx_k_KEY_CMD_GUI_APP_MENU[] = "KEY_CMD_GUI_APP_MENU";
static const char __pyx_k_KEY_CMD_REFRESH_LINE[] = "KEY_CMD_REFRESH_LINE";
static const char __pyx_k_KEY_CMD_SPEAK_INDENT[] = "KEY_CMD_SPEAK_INDENT";
static const char __pyx_k_KEY_CMD_TXTSEL_CLEAR[] = "KEY_CMD_TXTSEL_CLEAR";
static const char __pyx_k_KEY_CMD_TXTSEL_START[] = "KEY_CMD_TXTSEL_START";
static const char __pyx_k_KEY_FLG_MOTION_ROUTE[] = "KEY_FLG_MOTION_ROUTE";
static const char __pyx_k_OperationError___str[] = "OperationError.__str__";
static const char __pyx_k_PARAM_AUDIBLE_ALERTS[] = "PARAM_AUDIBLE_ALERTS";
static const char __pyx_k_PARAM_DRIVER_VERSION[] = "PARAM_DRIVER_VERSION";
static const char __pyx_k_PARAM_MESSAGE_LOCALE[] = "PARAM_MESSAGE_LOCALE";
static const char __pyx_k_PARAM_RENDERED_CELLS[] = "PARAM_RENDERED_CELLS";
static const char __pyx_k_PARAM_SERVER_VERSION[] = "PARAM_SERVER_VERSION";
static const char __pyx_k_ConnectionError___str[] = "ConnectionError.__str__";
static const char __pyx_k_KEY_CMD_ASPK_SEL_CHAR[] = "KEY_CMD_ASPK_SEL_CHAR";
static const char __pyx_k_KEY_CMD_ASPK_SEL_LINE[] = "KEY_CMD_ASPK_SEL_LINE";
static const char __pyx_k_KEY_CMD_GUI_AREA_ACTV[] = "KEY_CMD_GUI_AREA_ACTV";
static const char __pyx_k_KEY_CMD_GUI_AREA_NEXT[] = "KEY_CMD_GUI_AREA_NEXT";
static const char __pyx_k_KEY_CMD_GUI_AREA_PREV[] = "KEY_CMD_GUI_AREA_PREV";
static const char __pyx_k_KEY_CMD_GUI_ITEM_FRST[] = "KEY_CMD_GUI_ITEM_FRST";
static const char __pyx_k_KEY_CMD_GUI_ITEM_LAST[] = "KEY_CMD_GUI_ITEM_LAST";
static const char __pyx_k_KEY_CMD_GUI_ITEM_NEXT[] = "KEY_CMD_GUI_ITEM_NEXT";
static const char __pyx_k_KEY_CMD_GUI_ITEM_PREV[] = "KEY_CMD_GUI_ITEM_PREV";
static const char __pyx_k_KEY_CMD_PASTE_HISTORY[] = "KEY_CMD_PASTE_HISTORY";
static const char __pyx_k_KEY_CMD_RESTARTSPEECH[] = "KEY_CMD_RESTARTSPEECH";
static const char __pyx_k_KEY_CMD_SELECTVT_NEXT[] = "KEY_CMD_SELECTVT_NEXT";
static const char __pyx_k_KEY_CMD_SELECTVT_PREV[] = "KEY_CMD_SELECTVT_PREV";
static const char __pyx_k_KEY_CMD_SWITCHVT_NEXT[] = "KEY_CMD_SWITCHVT_NEXT";
static const char __pyx_k_KEY_CMD_SWITCHVT_PREV[] = "KEY_CMD_SWITCHVT_PREV";
static const char __pyx_k_KEY_FLG_INPUT_CONTROL[] = "KEY_FLG_INPUT_CONTROL";
static const char __pyx_k_KEY_FLG_INPUT_ESCAPED[] = "KEY_FLG_INPUT_ESCAPED";
static const char __pyx_k_KEY_FLG_MOTION_SCALED[] = "KEY_FLG_MOTION_SCALED";
static const char __pyx_k_KEY_FLG_MOTION_TOLEFT[] = "KEY_FLG_MOTION_TOLEFT";
static const char __pyx_k_OperationError___init[] = "OperationError.__init__";
static const char __pyx_k_PARAM_CLIENT_PRIORITY[] = "PARAM_CLIENT_PRIORITY";
static const char __pyx_k_String_value_expected[] = "String value expected";
static const char __pyx_k_Boolean_value_expected[] = "Boolean value expected";
static const char __pyx_k_ConnectionError___init[] = "ConnectionError.__init__";
static const char __pyx_k_ERROR_PROTOCOL_VERSION[] = "ERROR_PROTOCOL_VERSION";
static const char __pyx_k_Integer_value_expected[] = "Integer value expected";
static const char __pyx_k_KEY_CMD_ASPK_CMP_WORDS[] = "KEY_CMD_ASPK_CMP_WORDS";
static const char __pyx_k_KEY_CMD_ASPK_DEL_CHARS[] = "KEY_CMD_ASPK_DEL_CHARS";
static const char __pyx_k_KEY_CMD_ASPK_INS_CHARS[] = "KEY_CMD_ASPK_INS_CHARS";
static const char __pyx_k_KEY_CMD_ASPK_REP_CHARS[] = "KEY_CMD_ASPK_REP_CHARS";
static const char __pyx_k_KEY_CMD_DESC_CURR_CHAR[] = "KEY_CMD_DESC_CURR_CHAR";
static const char __pyx_k_KEY_CMD_GUI_APP_ALERTS[] = "KEY_CMD_GUI_APP_ALERTS";
static const char __pyx_k_KEY_CMD_MENU_LAST_ITEM[] = "KEY_CMD_MENU_LAST_ITEM";
static const char __pyx_k_KEY_CMD_MENU_NEXT_ITEM[] = "KEY_CMD_MENU_NEXT_ITEM";
static const char __pyx_k_KEY_CMD_MENU_PREV_ITEM[] = "KEY_CMD_MENU_PREV_ITEM";
static const char __pyx_k_KEY_CMD_SET_TEXT_TABLE[] = "KEY_CMD_SET_TEXT_TABLE";
static const char __pyx_k_KEY_CMD_SHOW_CURR_LOCN[] = "KEY_CMD_SHOW_CURR_LOCN";
static const char __pyx_k_PARAM_DEVICE_CELL_SIZE[] = "PARAM_DEVICE_CELL_SIZE";
static const char __pyx_k_PARAM_LITERARY_BRAILLE[] = "PARAM_LITERARY_BRAILLE";
static const char __pyx_k_Boolean_values_expected[] = "Boolean values expected";
static const char __pyx_k_ERROR_INVALID_PARAMETER[] = "ERROR_INVALID_PARAMETER";
static const char __pyx_k_Integer_values_expected[] = "Integer values expected";
static const char __pyx_k_KEY_CMD_GUI_BRL_ACTIONS[] = "KEY_CMD_GUI_BRL_ACTIONS";
static const char __pyx_k_KEY_CMD_GUI_DEV_OPTIONS[] = "KEY_CMD_GUI_DEV_OPTIONS";
static const char __pyx_k_KEY_CMD_MENU_FIRST_ITEM[] = "KEY_CMD_MENU_FIRST_ITEM";
static const char __pyx_k_KEY_CMD_MENU_PREV_LEVEL[] = "KEY_CMD_MENU_PREV_LEVEL";
static const char __pyx_k_KEY_CMD_ROUTE_CURR_LOCN[] = "KEY_CMD_ROUTE_CURR_LOCN";
static const char __pyx_k_KEY_CMD_SPEAK_CURR_CHAR[] = "KEY_CMD_SPEAK_CURR_CHAR";
static const char __pyx_k_KEY_CMD_SPEAK_CURR_LINE[] = "KEY_CMD_SPEAK_CURR_LINE";
static const char __pyx_k_KEY_CMD_SPEAK_CURR_LOCN[] = "KEY_CMD_SPEAK_CURR_LOCN";
static const char __pyx_k_KEY_CMD_SPEAK_CURR_WORD[] = "KEY_CMD_SPEAK_CURR_WORD";
static const char __pyx_k_KEY_CMD_SPEAK_FRST_CHAR[] = "KEY_CMD_SPEAK_FRST_CHAR";
static const char __pyx_k_KEY_CMD_SPEAK_FRST_LINE[] = "KEY_CMD_SPEAK_FRST_LINE";
static const char __pyx_k_KEY_CMD_SPEAK_LAST_CHAR[] = "KEY_CMD_SPEAK_LAST_CHAR";
static const char __pyx_k_KEY_CMD_SPEAK_LAST_LINE[] = "KEY_CMD_SPEAK_LAST_LINE";
static const char __pyx_k_KEY_CMD_SPEAK_NEXT_CHAR[] = "KEY_CMD_SPEAK_NEXT_CHAR";
static const char __pyx_k_KEY_CMD_SPEAK_NEXT_LINE[] = "KEY_CMD_SPEAK_NEXT_LINE";
static const char __pyx_k_KEY_CMD_SPEAK_NEXT_WORD[] = "KEY_CMD_SPEAK_NEXT_WORD";
static const char __pyx_k_KEY_CMD_SPEAK_PREV_CHAR[] = "KEY_CMD_SPEAK_PREV_CHAR";
static const char __pyx_k_KEY_CMD_SPEAK_PREV_LINE[] = "KEY_CMD_SPEAK_PREV_LINE";
static const char __pyx_k_KEY_CMD_SPEAK_PREV_WORD[] = "KEY_CMD_SPEAK_PREV_WORD";
static const char __pyx_k_KEY_CMD_SPELL_CURR_WORD[] = "KEY_CMD_SPELL_CURR_WORD";
static const char __pyx_k_PARAM_CLIPBOARD_CONTENT[] = "PARAM_CLIPBOARD_CONTENT";
static const char __pyx_k_PARAM_DEVICE_IDENTIFIER[] = "PARAM_DEVICE_IDENTIFIER";
static const char __pyx_k_ERROR_READONLY_PARAMETER[] = "ERROR_READONLY_PARAMETER";
static const char __pyx_k_Is_BRLTTY_really_running[] = "\nIs BRLTTY really running?";
static const char __pyx_k_KEY_CMD_GUI_DEV_SETTINGS[] = "KEY_CMD_GUI_DEV_SETTINGS";
static const char __pyx_k_ERROR_ILLEGAL_INSTRUCTION[] = "ERROR_ILLEGAL_INSTRUCTION";
static const char __pyx_k_ERROR_UNKNOWN_INSTRUCTION[] = "ERROR_UNKNOWN_INSTRUCTION";
static const char __pyx_k_KEY_CMD_MENU_NEXT_SETTING[] = "KEY_CMD_MENU_NEXT_SETTING";
static const char __pyx_k_KEY_CMD_MENU_PREV_SETTING[] = "KEY_CMD_MENU_PREV_SETTING";
static const char __pyx_k_PARAM_CURSOR_BLINK_PERIOD[] = "PARAM_CURSOR_BLINK_PERIOD";
static const char __pyx_k_PARAM_DRIVER_KEYCODE_NAME[] = "PARAM_DRIVER_KEYCODE_NAME";
static const char __pyx_k_KEY_CMD_SET_KEYBOARD_TABLE[] = "KEY_CMD_SET_KEYBOARD_TABLE";
static const char __pyx_k_PARAM_COMMAND_KEYCODE_NAME[] = "PARAM_COMMAND_KEYCODE_NAME";
static const char __pyx_k_PARAM_SKIP_IDENTICAL_LINES[] = "PARAM_SKIP_IDENTICAL_LINES";
static const char __pyx_k_Unsupported_parameter_type[] = "Unsupported parameter type";
static const char __pyx_k_watchParameter_locals_cfunc[] = "watchParameter.<locals>.cfunc";
static const char __pyx_k_KEY_CMD_SET_ATTRIBUTES_TABLE[] = "KEY_CMD_SET_ATTRIBUTES_TABLE";
static const char __pyx_k_KEY_CMD_SET_LANGUAGE_PROFILE[] = "KEY_CMD_SET_LANGUAGE_PROFILE";
static const char __pyx_k_PARAM_BOUND_COMMAND_KEYCODES[] = "PARAM_BOUND_COMMAND_KEYCODES";
static const char __pyx_k_PARAM_COMPUTER_BRAILLE_TABLE[] = "PARAM_COMPUTER_BRAILLE_TABLE";
static const char __pyx_k_PARAM_DRIVER_KEYCODE_SUMMARY[] = "PARAM_DRIVER_KEYCODE_SUMMARY";
static const char __pyx_k_PARAM_LITERARY_BRAILLE_TABLE[] = "PARAM_LITERARY_BRAILLE_TABLE";
static const char __pyx_k_KEY_CMD_SET_CONTRACTION_TABLE[] = "KEY_CMD_SET_CONTRACTION_TABLE";
static const char __pyx_k_PARAM_COMMAND_KEYCODE_SUMMARY[] = "PARAM_COMMAND_KEYCODE_SUMMARY";
static const char __pyx_k_PARAM_CURSOR_BLINK_PERCENTAGE[] = "PARAM_CURSOR_BLINK_PERCENTAGE";
static const char __pyx_k_PARAM_DEFINED_DRIVER_KEYCODES[] = "PARAM_DEFINED_DRIVER_KEYCODES";
static const char __pyx_k_Authentication_failed_Please_ch[] = "\nAuthentication failed. Please check you can read %s and it is not empty.";
static const char __pyx_k_Pickling_of_struct_members_such[] = "Pickling of struct members such as self.props must be explicitly requested with @auto_pickle(True)";
static const char __pyx_k_This_module_implements_a_set_of[] = "\nThis module implements a set of bindings for BrlAPI, a braille bridge for applications.\n\nThe reference C API documentation is available online http://brltty.app/doc/BrlAPIref, as well as in manual pages.\n\nThis documentation is only a python helper, you should also read C manual pages.\n\nExample : \nimport brlapi\nimport errno\nimport Xlib.keysymdef.miscellany\ntry:\n  b = brlapi.Connection()\n  print(\"Server version \" + str(b.getParameter(brlapi.PARAM_SERVER_VERSION, 0, brlapi.PARAMF_GLOBAL)))\n  print(\"Display size \" + str(b.getParameter(brlapi.PARAM_DISPLAY_SIZE, 0, brlapi.PARAMF_GLOBAL)))\n  print(\"Driver \" + b.getParameter(brlapi.PARAM_DRIVER_NAME, 0, brlapi.PARAMF_GLOBAL))\n  print(\"Model \" + b.getParameter(brlapi.PARAM_DEVICE_MODEL, 0, brlapi.PARAMF_GLOBAL))\n\n  for cmd in b.getParameter(brlapi.PARAM_BOUND_COMMAND_KEYCODES, 0, brlapi.PARAMF_GLOBAL):\n    print(\"Command %x short name: %s\" % (cmd, b.getParameter(brlapi.PARAM_COMMAND_KEYCODE_NAME, cmd, brlapi.PARAMF_GLOBAL)))\n\n  for key in b.getParameter(brlapi.PARAM_DEFINED_DRIVER_KEYCODES, 0, brlapi.PARAMF_GLOBAL):\n    print(\"Key %x short name: %s\" % (key, b.getParameter(brlapi.PARAM_DRIVER_KEYCODE_NAME, key, brlapi.PARAMF_GLOBAL)))\n\n  # Make our output more prioritized\n  b.setParameter(brlapi.PARAM_CLIENT_PRIORITY, 0, False, 70)\n\n  def update_callback(param, subparam, flags, value):\n    s = \"\"\n    for i in value:\n      s += unichr(0x2800 + ord(i))\n    print(\"Got output update %s\" % s)\n\n  p = b.watchParameter(brlapi.PARAM_RENDERED_CELLS, 0, False, update_callback)\n\n  b.enterTtyMode()\n  b.ignoreKeys(brlapi.rangeType_all,[0])\n\n  # Accept the home, window up and window down braille commands\n  b.acceptKeys(brlapi.rangeType_command,[brlapi.KEY_TYPE_CMD|brlapi.KEY_CMD_HOME, brlapi.KEY_TYPE_CMD|brlapi.KEY_CMD_WINUP, brlapi.KEY_TYPE_CMD|brlapi.KEY_CMD_WINDN])\n\n  # Accept the tab key\n  b.acceptKeys(brlapi.rangeType_key,[brlapi.KEY_TYPE_SYM|Xlib.keysymdef.miscellany.XK_Tab])""\n\n  b.writeText(\"Trying to get a key within one second\")\n  key = b.readKeyWithTimeout(1000)\n  print(\"got \" + str(key))\n\n  b.writeText(\"Press home, winup/dn or tab to continue ... \302\244\")\n  key = b.readKey()\n\n  k = brlapi.expandKeyCode(key)\n  b.writeText(\"Key %ld (%x %x %x %x) !\" % (key, k[\"type\"], k[\"command\"], k[\"argument\"], k[\"flags\"]))\n  b.writeText(None,1)\n  b.acceptAllKeys()\n  b.readKey()\n\n  underline = chr(brlapi.DOT7 + brlapi.DOT8)\n  # Note: center() can take two arguments only starting from python 2.4\n  b.write(\n      regionBegin = 1,\n      regionSize = 40,\n      text = \"Press any key to continue               \",\n      orMask = 25*underline + 15*chr(0))\n  b.readKey()\n\n  b.acceptAllKeys()\n  b.writeText(\"Press any key\")\n  k = b.readKey()\n  k = brlapi.expandKeyCode(key)\n  b.writeText(\"Key %ld (%x %x %x %x) !\" % (key, k[\"type\"], k[\"command\"], k[\"argument\"], k[\"flags\"]))\n  b.readKey()\n\n  b.ignoreAllKeys()\n  b.acceptKeyRanges([(brlapi.KEY_TYPE_CMD|brlapi.KEY_CMD_PASSDOTS, brlapi.KEY_TYPE_CMD|brlapi.KEY_CMD_PASSDOTS|brlapi.KEY_CMD_ARG_MASK)])\n  b.writeText(\"Press a dot key\")\n  key = b.readKey()\n  k = brlapi.expandKeyCode(key)\n  b.writeText(\"Key %ld (%x %x %x %x) !\" % (key, k[\"type\"], k[\"command\"], k[\"argument\"], k[\"flags\"]))\n  b.acceptAllKeys()\n  b.readKey()\n\n  b.unwatchParameter(p)\n  b.leaveTtyMode()\n  b.closeConnection()\n\nexcept brlapi.ConnectionError as e:\n  if e.brlerrno == brlapi.ERROR_CONNREFUSED:\n    print(\"Connection to %s refused. BRLTTY is too busy...\" % e.host)\n  elif e.brlerrno == brlapi.ERROR_AUTHENTICATION:\n    print(\"Authentication with %s failed. Please check the permissions of %s\" % (e.host,e.auth))\n  elif e.brlerrno == brlapi.ERROR_LIBCERR and (e.libcerrno == errno.ECONNREFUSED or e.libcerrno == errno.ENOENT):\n    print(\"Connection to %s failed. Is BRLTTY really running?\" % (e.host))\n  else:\n    print(\"Connection to BRLTTY at %s failed: \" % (e.""host))\n  print(e)\n  print(e.brlerrno)\n  print(e.libcerrno)\n";
static const char __pyx_k_self_h_cannot_be_converted_to_a[] = "self.h cannot be converted to a Python object for pickling";
static const char __pyx_k_Error_while_connecting_to_BrlTTY[] = "Error while connecting to BrlTTY";
static const char __pyx_k_Error_while_performing_some_oper[] = "Error while performing some operation";
static const char __pyx_k_PARAM_COMPUTER_BRAILLE_CELL_SIZE[] = "PARAM_COMPUTER_BRAILLE_CELL_SIZE";
static const char __pyx_k_PARAM_COMPUTER_BRAILLE_ROWS_MASK[] = "PARAM_COMPUTER_BRAILLE_ROWS_MASK";
static const char __pyx_k_PARAM_COMPUTER_BRAILLE_ROW_CELLS[] = "PARAM_COMPUTER_BRAILLE_ROW_CELLS";
static PyObject *__pyx_n_u_ASCII;
static PyObject *__pyx_kp_u_Authentication_failed_Please_ch;
static PyObject *__pyx_kp_u_BRLTTY_is_too_busy;
static PyObject *__pyx_kp_u_Boolean_value_expected;
static PyObject *__pyx_kp_u_Boolean_values_expected;
static PyObject *__pyx_n_s_CURSOR_LEAVE;
static PyObject *__pyx_n_s_CURSOR_OFF;
static PyObject *__pyx_n_s_Connection;
static PyObject *__pyx_n_s_ConnectionError;
static PyObject *__pyx_n_s_ConnectionError___init;
static PyObject *__pyx_n_s_ConnectionError___str;
static PyObject *__pyx_n_s_ConnectionError_auth;
static PyObject *__pyx_n_s_ConnectionError_host;
static PyObject *__pyx_n_s_DISPLAY_DEFAULT;
static PyObject *__pyx_n_s_DOT1;
static PyObject *__pyx_n_s_DOT2;
static PyObject *__pyx_n_s_DOT3;
static PyObject *__pyx_n_s_DOT4;
static PyObject *__pyx_n_s_DOT5;
static PyObject *__pyx_n_s_DOT6;
static PyObject *__pyx_n_s_DOT7;
static PyObject *__pyx_n_s_DOT8;
static PyObject *__pyx_n_s_DOTC;
static PyObject *__pyx_n_s_ECONNREFUSED;
static PyObject *__pyx_n_s_EINTR;
static PyObject *__pyx_n_s_ENOENT;
static PyObject *__pyx_n_s_ERROR_AUTHENTICATION;
static PyObject *__pyx_n_s_ERROR_CONNREFUSED;
static PyObject *__pyx_n_s_ERROR_DEVICEBUSY;
static PyObject *__pyx_n_s_ERROR_DRIVERERROR;
static PyObject *__pyx_n_s_ERROR_EMPTYKEY;
static PyObject *__pyx_n_s_ERROR_EOF;
static PyObject *__pyx_n_s_ERROR_GAIERR;
static PyObject *__pyx_n_s_ERROR_ILLEGAL_INSTRUCTION;
static PyObject *__pyx_n_s_ERROR_INVALID_PACKET;
static PyObject *__pyx_n_s_ERROR_INVALID_PARAMETER;
static PyObject *__pyx_n_s_ERROR_LIBCERR;
static PyObject *__pyx_n_s_ERROR_NOMEM;
static PyObject *__pyx_n_s_ERROR_OPNOTSUPP;
static PyObject *__pyx_n_s_ERROR_PROTOCOL_VERSION;
static PyObject *__pyx_n_s_ERROR_READONLY_PARAMETER;
static PyObject *__pyx_n_s_ERROR_SUCCESS;
static PyObject *__pyx_n_s_ERROR_TTYBUSY;
static PyObject *__pyx_n_s_ERROR_UNKNOWNTTY;
static PyObject *__pyx_n_s_ERROR_UNKNOWN_INSTRUCTION;
static PyObject *__pyx_kp_s_Error_while_connecting_to_BrlTTY;
static PyObject *__pyx_kp_s_Error_while_performing_some_oper;
static PyObject *__pyx_kp_u_Integer_value_expected;
static PyObject *__pyx_kp_u_Integer_values_expected;
static PyObject *__pyx_kp_u_Is_BRLTTY_really_running;
static PyObject *__pyx_n_s_KEY_CMD_ALERT;
static PyObject *__pyx_n_s_KEY_CMD_ALTGR;
static PyObject *__pyx_n_s_KEY_CMD_APNDCHARS;
static PyObject *__pyx_n_s_KEY_CMD_ARG_MASK;
static PyObject *__pyx_n_s_KEY_CMD_ARG_SHIFT;
static PyObject *__pyx_n_s_KEY_CMD_ASPK_CMP_WORDS;
static PyObject *__pyx_n_s_KEY_CMD_ASPK_DEL_CHARS;
static PyObject *__pyx_n_s_KEY_CMD_ASPK_INDENT;
static PyObject *__pyx_n_s_KEY_CMD_ASPK_INS_CHARS;
static PyObject *__pyx_n_s_KEY_CMD_ASPK_REP_CHARS;
static PyObject *__pyx_n_s_KEY_CMD_ASPK_SEL_CHAR;
static PyObject *__pyx_n_s_KEY_CMD_ASPK_SEL_LINE;
static PyObject *__pyx_n_s_KEY_CMD_ATTRBLINK;
static PyObject *__pyx_n_s_KEY_CMD_ATTRDN;
static PyObject *__pyx_n_s_KEY_CMD_ATTRUP;
static PyObject *__pyx_n_s_KEY_CMD_ATTRVIS;
static PyObject *__pyx_n_s_KEY_CMD_AUTOREPEAT;
static PyObject *__pyx_n_s_KEY_CMD_AUTOSPEAK;
static PyObject *__pyx_n_s_KEY_CMD_BACK;
static PyObject *__pyx_n_s_KEY_CMD_BLK_MASK;
static PyObject *__pyx_n_s_KEY_CMD_BLK_SHIFT;
static PyObject *__pyx_n_s_KEY_CMD_BOT;
static PyObject *__pyx_n_s_KEY_CMD_BOT_LEFT;
static PyObject *__pyx_n_s_KEY_CMD_BRLKBD;
static PyObject *__pyx_n_s_KEY_CMD_BRLUCDOTS;
static PyObject *__pyx_n_s_KEY_CMD_BRL_START;
static PyObject *__pyx_n_s_KEY_CMD_BRL_STOP;
static PyObject *__pyx_n_s_KEY_CMD_CAPBLINK;
static PyObject *__pyx_n_s_KEY_CMD_CHRLT;
static PyObject *__pyx_n_s_KEY_CMD_CHRRT;
static PyObject *__pyx_n_s_KEY_CMD_CLIP_ADD;
static PyObject *__pyx_n_s_KEY_CMD_CLIP_APPEND;
static PyObject *__pyx_n_s_KEY_CMD_CLIP_COPY;
static PyObject *__pyx_n_s_KEY_CMD_CLIP_NEW;
static PyObject *__pyx_n_s_KEY_CMD_CLIP_RESTORE;
static PyObject *__pyx_n_s_KEY_CMD_CLIP_SAVE;
static PyObject *__pyx_n_s_KEY_CMD_COMPBRL6;
static PyObject *__pyx_n_s_KEY_CMD_CONTEXT;
static PyObject *__pyx_n_s_KEY_CMD_CONTRACTED;
static PyObject *__pyx_n_s_KEY_CMD_CONTROL;
static PyObject *__pyx_n_s_KEY_CMD_COPYCHARS;
static PyObject *__pyx_n_s_KEY_CMD_COPY_LINE;
static PyObject *__pyx_n_s_KEY_CMD_COPY_RECT;
static PyObject *__pyx_n_s_KEY_CMD_CSRBLINK;
static PyObject *__pyx_n_s_KEY_CMD_CSRHIDE;
static PyObject *__pyx_n_s_KEY_CMD_CSRJMP_VERT;
static PyObject *__pyx_n_s_KEY_CMD_CSRSIZE;
static PyObject *__pyx_n_s_KEY_CMD_CSRTRK;
static PyObject *__pyx_n_s_KEY_CMD_CSRVIS;
static PyObject *__pyx_n_s_KEY_CMD_CUTAPPEND;
static PyObject *__pyx_n_s_KEY_CMD_CUTBEGIN;
static PyObject *__pyx_n_s_KEY_CMD_CUTLINE;
static PyObject *__pyx_n_s_KEY_CMD_CUTRECT;
static PyObject *__pyx_n_s_KEY_CMD_DESCCHAR;
static PyObject *__pyx_n_s_KEY_CMD_DESC_CURR_CHAR;
static PyObject *__pyx_n_s_KEY_CMD_DISPMD;
static PyObject *__pyx_n_s_KEY_CMD_FREEZE;
static PyObject *__pyx_n_s_KEY_CMD_FWINLT;
static PyObject *__pyx_n_s_KEY_CMD_FWINLTSKIP;
static PyObject *__pyx_n_s_KEY_CMD_FWINRT;
static PyObject *__pyx_n_s_KEY_CMD_FWINRTSKIP;
static PyObject *__pyx_n_s_KEY_CMD_GOTOLINE;
static PyObject *__pyx_n_s_KEY_CMD_GOTOMARK;
static PyObject *__pyx_n_s_KEY_CMD_GUI;
static PyObject *__pyx_n_s_KEY_CMD_GUI_APP_ALERTS;
static PyObject *__pyx_n_s_KEY_CMD_GUI_APP_LIST;
static PyObject *__pyx_n_s_KEY_CMD_GUI_APP_MENU;
static PyObject *__pyx_n_s_KEY_CMD_GUI_AREA_ACTV;
static PyObject *__pyx_n_s_KEY_CMD_GUI_AREA_NEXT;
static PyObject *__pyx_n_s_KEY_CMD_GUI_AREA_PREV;
static PyObject *__pyx_n_s_KEY_CMD_GUI_BACK;
static PyObject *__pyx_n_s_KEY_CMD_GUI_BRL_ACTIONS;
static PyObject *__pyx_n_s_KEY_CMD_GUI_DEV_OPTIONS;
static PyObject *__pyx_n_s_KEY_CMD_GUI_DEV_SETTINGS;
static PyObject *__pyx_n_s_KEY_CMD_GUI_HOME;
static PyObject *__pyx_n_s_KEY_CMD_GUI_ITEM_FRST;
static PyObject *__pyx_n_s_KEY_CMD_GUI_ITEM_LAST;
static PyObject *__pyx_n_s_KEY_CMD_GUI_ITEM_NEXT;
static PyObject *__pyx_n_s_KEY_CMD_GUI_ITEM_PREV;
static PyObject *__pyx_n_s_KEY_CMD_GUI_TITLE;
static PyObject *__pyx_n_s_KEY_CMD_HELP;
static PyObject *__pyx_n_s_KEY_CMD_HOME;
static PyObject *__pyx_n_s_KEY_CMD_HOST_COPY;
static PyObject *__pyx_n_s_KEY_CMD_HOST_CUT;
static PyObject *__pyx_n_s_KEY_CMD_HOST_PASTE;
static PyObject *__pyx_n_s_KEY_CMD_HWINLT;
static PyObject *__pyx_n_s_KEY_CMD_HWINRT;
static PyObject *__pyx_n_s_KEY_CMD_INDICATORS;
static PyObject *__pyx_n_s_KEY_CMD_INFO;
static PyObject *__pyx_n_s_KEY_CMD_LEARN;
static PyObject *__pyx_n_s_KEY_CMD_LNBEG;
static PyObject *__pyx_n_s_KEY_CMD_LNDN;
static PyObject *__pyx_n_s_KEY_CMD_LNEND;
static PyObject *__pyx_n_s_KEY_CMD_LNUP;
static PyObject *__pyx_n_s_KEY_CMD_MENU_FIRST_ITEM;
static PyObject *__pyx_n_s_KEY_CMD_MENU_LAST_ITEM;
static PyObject *__pyx_n_s_KEY_CMD_MENU_NEXT_ITEM;
static PyObject *__pyx_n_s_KEY_CMD_MENU_NEXT_SETTING;
static PyObject *__pyx_n_s_KEY_CMD_MENU_PREV_ITEM;
static PyObject *__pyx_n_s_KEY_CMD_MENU_PREV_LEVEL;
static PyObject *__pyx_n_s_KEY_CMD_MENU_PREV_SETTING;
static PyObject *__pyx_n_s_KEY_CMD_META;
static PyObject *__pyx_n_s_KEY_CMD_MUTE;
static PyObject *__pyx_n_s_KEY_CMD_NOOP;
static PyObject *__pyx_n_s_KEY_CMD_NXDIFCHAR;
static PyObject *__pyx_n_s_KEY_CMD_NXDIFLN;
static PyObject *__pyx_n_s_KEY_CMD_NXINDENT;
static PyObject *__pyx_n_s_KEY_CMD_NXNBWIN;
static PyObject *__pyx_n_s_KEY_CMD_NXPGRPH;
static PyObject *__pyx_n_s_KEY_CMD_NXPROMPT;
static PyObject *__pyx_n_s_KEY_CMD_NXSEARCH;
static PyObject *__pyx_n_s_KEY_CMD_OFFLINE;
static PyObject *__pyx_n_s_KEY_CMD_PASSAT;
static PyObject *__pyx_n_s_KEY_CMD_PASSDOTS;
static PyObject *__pyx_n_s_KEY_CMD_PASSPS2;
static PyObject *__pyx_n_s_KEY_CMD_PASSXT;
static PyObject *__pyx_n_s_KEY_CMD_PASTE;
static PyObject *__pyx_n_s_KEY_CMD_PASTE_HISTORY;
static PyObject *__pyx_n_s_KEY_CMD_PRDIFCHAR;
static PyObject *__pyx_n_s_KEY_CMD_PRDIFLN;
static PyObject *__pyx_n_s_KEY_CMD_PREFLOAD;
static PyObject *__pyx_n_s_KEY_CMD_PREFMENU;
static PyObject *__pyx_n_s_KEY_CMD_PREFSAVE;
static PyObject *__pyx_n_s_KEY_CMD_PRINDENT;
static PyObject *__pyx_n_s_KEY_CMD_PRNBWIN;
static PyObject *__pyx_n_s_KEY_CMD_PRPGRPH;
static PyObject *__pyx_n_s_KEY_CMD_PRPROMPT;
static PyObject *__pyx_n_s_KEY_CMD_PRSEARCH;
static PyObject *__pyx_n_s_KEY_CMD_REFRESH;
static PyObject *__pyx_n_s_KEY_CMD_REFRESH_LINE;
static PyObject *__pyx_n_s_KEY_CMD_RESTARTBRL;
static PyObject *__pyx_n_s_KEY_CMD_RESTARTSPEECH;
static PyObject *__pyx_n_s_KEY_CMD_RETURN;
static PyObject *__pyx_n_s_KEY_CMD_ROUTE;
static PyObject *__pyx_n_s_KEY_CMD_ROUTE_CURR_LOCN;
static PyObject *__pyx_n_s_KEY_CMD_ROUTE_LINE;
static PyObject *__pyx_n_s_KEY_CMD_SAY_ABOVE;
static PyObject *__pyx_n_s_KEY_CMD_SAY_ALL;
static PyObject *__pyx_n_s_KEY_CMD_SAY_BELOW;
static PyObject *__pyx_n_s_KEY_CMD_SAY_FASTER;
static PyObject *__pyx_n_s_KEY_CMD_SAY_HIGHER;
static PyObject *__pyx_n_s_KEY_CMD_SAY_LINE;
static PyObject *__pyx_n_s_KEY_CMD_SAY_LOUDER;
static PyObject *__pyx_n_s_KEY_CMD_SAY_LOWER;
static PyObject *__pyx_n_s_KEY_CMD_SAY_SLOWER;
static PyObject *__pyx_n_s_KEY_CMD_SAY_SOFTER;
static PyObject *__pyx_n_s_KEY_CMD_SCR_START;
static PyObject *__pyx_n_s_KEY_CMD_SCR_STOP;
static PyObject *__pyx_n_s_KEY_CMD_SELECTVT;
static PyObject *__pyx_n_s_KEY_CMD_SELECTVT_NEXT;
static PyObject *__pyx_n_s_KEY_CMD_SELECTVT_PREV;
static PyObject *__pyx_n_s_KEY_CMD_SETLEFT;
static PyObject *__pyx_n_s_KEY_CMD_SETMARK;
static PyObject *__pyx_n_s_KEY_CMD_SET_ATTRIBUTES_TABLE;
static PyObject *__pyx_n_s_KEY_CMD_SET_CONTRACTION_TABLE;
static PyObject *__pyx_n_s_KEY_CMD_SET_KEYBOARD_TABLE;
static PyObject *__pyx_n_s_KEY_CMD_SET_LANGUAGE_PROFILE;
static PyObject *__pyx_n_s_KEY_CMD_SET_TEXT_TABLE;
static PyObject *__pyx_n_s_KEY_CMD_SHIFT;
static PyObject *__pyx_n_s_KEY_CMD_SHOW_CURR_LOCN;
static PyObject *__pyx_n_s_KEY_CMD_SIXDOTS;
static PyObject *__pyx_n_s_KEY_CMD_SKPBLNKWINS;
static PyObject *__pyx_n_s_KEY_CMD_SKPIDLNS;
static PyObject *__pyx_n_s_KEY_CMD_SLIDEWIN;
static PyObject *__pyx_n_s_KEY_CMD_SPEAK_CURR_CHAR;
static PyObject *__pyx_n_s_KEY_CMD_SPEAK_CURR_LINE;
static PyObject *__pyx_n_s_KEY_CMD_SPEAK_CURR_LOCN;
static PyObject *__pyx_n_s_KEY_CMD_SPEAK_CURR_WORD;
static PyObject *__pyx_n_s_KEY_CMD_SPEAK_FRST_CHAR;
static PyObject *__pyx_n_s_KEY_CMD_SPEAK_FRST_LINE;
static PyObject *__pyx_n_s_KEY_CMD_SPEAK_INDENT;
static PyObject *__pyx_n_s_KEY_CMD_SPEAK_LAST_CHAR;
static PyObject *__pyx_n_s_KEY_CMD_SPEAK_LAST_LINE;
static PyObject *__pyx_n_s_KEY_CMD_SPEAK_NEXT_CHAR;
static PyObject *__pyx_n_s_KEY_CMD_SPEAK_NEXT_LINE;
static PyObject *__pyx_n_s_KEY_CMD_SPEAK_NEXT_WORD;
static PyObject *__pyx_n_s_KEY_CMD_SPEAK_PREV_CHAR;
static PyObject *__pyx_n_s_KEY_CMD_SPEAK_PREV_LINE;
static PyObject *__pyx_n_s_KEY_CMD_SPEAK_PREV_WORD;
static PyObject *__pyx_n_s_KEY_CMD_SPELL_CURR_WORD;
static PyObject *__pyx_n_s_KEY_CMD_SPKHOME;
static PyObject *__pyx_n_s_KEY_CMD_SPK_START;
static PyObject *__pyx_n_s_KEY_CMD_SPK_STOP;
static PyObject *__pyx_n_s_KEY_CMD_SWITCHVT;
static PyObject *__pyx_n_s_KEY_CMD_SWITCHVT_NEXT;
static PyObject *__pyx_n_s_KEY_CMD_SWITCHVT_PREV;
static PyObject *__pyx_n_s_KEY_CMD_TIME;
static PyObject *__pyx_n_s_KEY_CMD_TOP;
static PyObject *__pyx_n_s_KEY_CMD_TOP_LEFT;
static PyObject *__pyx_n_s_KEY_CMD_TOUCH_AT;
static PyObject *__pyx_n_s_KEY_CMD_TOUCH_NAV;
static PyObject *__pyx_n_s_KEY_CMD_TUNES;
static PyObject *__pyx_n_s_KEY_CMD_TXTSEL_ALL;
static PyObject *__pyx_n_s_KEY_CMD_TXTSEL_CLEAR;
static PyObject *__pyx_n_s_KEY_CMD_TXTSEL_SET;
static PyObject *__pyx_n_s_KEY_CMD_TXTSEL_START;
static PyObject *__pyx_n_s_KEY_CMD_UNSTICK;
static PyObject *__pyx_n_s_KEY_CMD_UPPER;
static PyObject *__pyx_n_s_KEY_CMD_WINDN;
static PyObject *__pyx_n_s_KEY_CMD_WINUP;
static PyObject *__pyx_n_s_KEY_CODE_MASK;
static PyObject *__pyx_n_s_KEY_CODE_SHIFT;
static PyObject *__pyx_n_s_KEY_FLAGS_MASK;
static PyObject *__pyx_n_s_KEY_FLAGS_SHIFT;
static PyObject *__pyx_n_s_KEY_FLG_INPUT_ALTGR;
static PyObject *__pyx_n_s_KEY_FLG_INPUT_CONTROL;
static PyObject *__pyx_n_s_KEY_FLG_INPUT_ESCAPED;
static PyObject *__pyx_n_s_KEY_FLG_INPUT_GUI;
static PyObject *__pyx_n_s_KEY_FLG_INPUT_META;
static PyObject *__pyx_n_s_KEY_FLG_INPUT_SHIFT;
static PyObject *__pyx_n_s_KEY_FLG_INPUT_UPPER;
static PyObject *__pyx_n_s_KEY_FLG_KBD_EMUL0;
static PyObject *__pyx_n_s_KEY_FLG_KBD_EMUL1;
static PyObject *__pyx_n_s_KEY_FLG_KBD_RELEASE;
static PyObject *__pyx_n_s_KEY_FLG_MOTION_ROUTE;
static PyObject *__pyx_n_s_KEY_FLG_MOTION_SCALED;
static PyObject *__pyx_n_s_KEY_FLG_MOTION_TOLEFT;
static PyObject *__pyx_n_s_KEY_FLG_TOGGLE_MASK;
static PyObject *__pyx_n_s_KEY_FLG_TOGGLE_OFF;
static PyObject *__pyx_n_s_KEY_FLG_TOGGLE_ON;
static PyObject *__pyx_n_s_KEY_MAX;
static PyObject *__pyx_n_s_KEY_SYM_BACKSPACE;
static PyObject *__pyx_n_s_KEY_SYM_DELETE;
static PyObject *__pyx_n_s_KEY_SYM_DOWN;
static PyObject *__pyx_n_s_KEY_SYM_END;
static PyObject *__pyx_n_s_KEY_SYM_ESCAPE;
static PyObject *__pyx_n_s_KEY_SYM_F1;
static PyObject *__pyx_n_s_KEY_SYM_F10;
static PyObject *__pyx_n_s_KEY_SYM_F11;
static PyObject *__pyx_n_s_KEY_SYM_F12;
static PyObject *__pyx_n_s_KEY_SYM_F13;
static PyObject *__pyx_n_s_KEY_SYM_F14;
static PyObject *__pyx_n_s_KEY_SYM_F15;
static PyObject *__pyx_n_s_KEY_SYM_F16;
static PyObject *__pyx_n_s_KEY_SYM_F17;
static PyObject *__pyx_n_s_KEY_SYM_F18;
static PyObject *__pyx_n_s_KEY_SYM_F19;
static PyObject *__pyx_n_s_KEY_SYM_F2;
static PyObject *__pyx_n_s_KEY_SYM_F20;
static PyObject *__pyx_n_s_KEY_SYM_F21;
static PyObject *__pyx_n_s_KEY_SYM_F22;
static PyObject *__pyx_n_s_KEY_SYM_F23;
static PyObject *__pyx_n_s_KEY_SYM_F24;
static PyObject *__pyx_n_s_KEY_SYM_F25;
static PyObject *__pyx_n_s_KEY_SYM_F26;
static PyObject *__pyx_n_s_KEY_SYM_F27;
static PyObject *__pyx_n_s_KEY_SYM_F28;
static PyObject *__pyx_n_s_KEY_SYM_F29;
static PyObject *__pyx_n_s_KEY_SYM_F3;
static PyObject *__pyx_n_s_KEY_SYM_F30;
static PyObject *__pyx_n_s_KEY_SYM_F31;
static PyObject *__pyx_n_s_KEY_SYM_F32;
static PyObject *__pyx_n_s_KEY_SYM_F33;
static PyObject *__pyx_n_s_KEY_SYM_F34;
static PyObject *__pyx_n_s_KEY_SYM_F35;
static PyObject *__pyx_n_s_KEY_SYM_F4;
static PyObject *__pyx_n_s_KEY_SYM_F5;
static PyObject *__pyx_n_s_KEY_SYM_F6;
static PyObject *__pyx_n_s_KEY_SYM_F7;
static PyObject *__pyx_n_s_KEY_SYM_F8;
static PyObject *__pyx_n_s_KEY_SYM_F9;
static PyObject *__pyx_n_s_KEY_SYM_HOME;
static PyObject *__pyx_n_s_KEY_SYM_INSERT;
static PyObject *__pyx_n_s_KEY_SYM_LEFT;
static PyObject *__pyx_n_s_KEY_SYM_LINEFEED;
static PyObject *__pyx_n_s_KEY_SYM_PAGE_DOWN;
static PyObject *__pyx_n_s_KEY_SYM_PAGE_UP;
static PyObject *__pyx_n_s_KEY_SYM_RIGHT;
static PyObject *__pyx_n_s_KEY_SYM_TAB;
static PyObject *__pyx_n_s_KEY_SYM_UNICODE;
static PyObject *__pyx_n_s_KEY_SYM_UP;
static PyObject *__pyx_n_s_KEY_TYPE_CMD;
static PyObject *__pyx_n_s_KEY_TYPE_MASK;
static PyObject *__pyx_n_s_KEY_TYPE_SHIFT;
static PyObject *__pyx_n_s_KEY_TYPE_SYM;
static PyObject *__pyx_n_s_OperationError;
static PyObject *__pyx_n_s_OperationError___init;
static PyObject *__pyx_n_s_OperationError___str;
static PyObject *__pyx_n_s_PARAMF_GLOBAL;
static PyObject *__pyx_n_s_PARAMF_LOCAL;
static PyObject *__pyx_n_s_PARAMF_SELF;
static PyObject *__pyx_n_s_PARAM_AUDIBLE_ALERTS;
static PyObject *__pyx_n_s_PARAM_BOUND_COMMAND_KEYCODES;
static PyObject *__pyx_n_s_PARAM_CLIENT_PRIORITY;
static PyObject *__pyx_n_s_PARAM_CLIPBOARD_CONTENT;
static PyObject *__pyx_n_s_PARAM_COMMAND_KEYCODE_NAME;
static PyObject *__pyx_n_s_PARAM_COMMAND_KEYCODE_SUMMARY;
static PyObject *__pyx_n_s_PARAM_COMPUTER_BRAILLE_CELL_SIZE;
static PyObject *__pyx_n_s_PARAM_COMPUTER_BRAILLE_ROWS_MASK;
static PyObject *__pyx_n_s_PARAM_COMPUTER_BRAILLE_ROW_CELLS;
static PyObject *__pyx_n_s_PARAM_COMPUTER_BRAILLE_TABLE;
static PyObject *__pyx_n_s_PARAM_COUNT;
static PyObject *__pyx_n_s_PARAM_CURSOR_BLINK_PERCENTAGE;
static PyObject *__pyx_n_s_PARAM_CURSOR_BLINK_PERIOD;
static PyObject *__pyx_n_s_PARAM_CURSOR_DOTS;
static PyObject *__pyx_n_s_PARAM_DEFINED_DRIVER_KEYCODES;
static PyObject *__pyx_n_s_PARAM_DEVICE_CELL_SIZE;
static PyObject *__pyx_n_s_PARAM_DEVICE_IDENTIFIER;
static PyObject *__pyx_n_s_PARAM_DEVICE_MODEL;
static PyObject *__pyx_n_s_PARAM_DEVICE_ONLINE;
static PyObject *__pyx_n_s_PARAM_DEVICE_SPEED;
static PyObject *__pyx_n_s_PARAM_DISPLAY_SIZE;
static PyObject *__pyx_n_s_PARAM_DRIVER_CODE;
static PyObject *__pyx_n_s_PARAM_DRIVER_KEYCODE_NAME;
static PyObject *__pyx_n_s_PARAM_DRIVER_KEYCODE_SUMMARY;
static PyObject *__pyx_n_s_PARAM_DRIVER_NAME;
static PyObject *__pyx_n_s_PARAM_DRIVER_VERSION;
static PyObject *__pyx_n_s_PARAM_LITERARY_BRAILLE;
static PyObject *__pyx_n_s_PARAM_LITERARY_BRAILLE_TABLE;
static PyObject *__pyx_n_s_PARAM_MESSAGE_LOCALE;
static PyObject *__pyx_n_s_PARAM_RENDERED_CELLS;
static PyObject *__pyx_n_s_PARAM_RETAIN_DOTS;
static PyObject *__pyx_n_s_PARAM_SERVER_VERSION;
static PyObject *__pyx_n_s_PARAM_SKIP_IDENTICAL_LINES;
static PyObject *__pyx_n_s_PARAM_TYPE_BOOLEAN;
static PyObject *__pyx_n_s_PARAM_TYPE_KEYCODE;
static PyObject *__pyx_n_s_PARAM_TYPE_STRING;
static PyObject *__pyx_n_s_PARAM_TYPE_UINT16;
static PyObject *__pyx_n_s_PARAM_TYPE_UINT32;
static PyObject *__pyx_n_s_PARAM_TYPE_UINT64;
static PyObject *__pyx_n_s_PARAM_TYPE_UINT8;
static PyObject *__pyx_kp_s_Pickling_of_struct_members_such;
static PyObject *__pyx_kp_u_String_value_expected;
static PyObject *__pyx_n_s_TTY_DEFAULT;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_kp_b_UTF_8;
static PyObject *__pyx_kp_u_UTF_8;
static PyObject *__pyx_kp_u_Unsupported_parameter_type;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_n_s_WriteStruct;
static PyObject *__pyx_kp_b__10;
static PyObject *__pyx_kp_b__2;
static PyObject *__pyx_kp_u__2;
static PyObject *__pyx_kp_u__4;
static PyObject *__pyx_kp_u__5;
static PyObject *__pyx_n_s_andMask;
static PyObject *__pyx_n_u_argument;
static PyObject *__pyx_n_s_attrAnd;
static PyObject *__pyx_n_s_attrOr;
static PyObject *__pyx_n_s_auth;
static PyObject *__pyx_n_s_brlapi;
static PyObject *__pyx_kp_s_brlapi_pyx;
static PyObject *__pyx_n_s_brlerrno;
static PyObject *__pyx_kp_u_brlerrno_2;
static PyObject *__pyx_n_s_buf;
static PyObject *__pyx_n_s_callbackData;
static PyObject *__pyx_n_s_center;
static PyObject *__pyx_n_s_cfunc;
static PyObject *__pyx_n_s_charset;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_code;
static PyObject *__pyx_n_u_command;
static PyObject *__pyx_kp_u_couldn_t_connect_to;
static PyObject *__pyx_n_s_cursor;
static PyObject *__pyx_n_u_d;
static PyObject *__pyx_n_s_data;
static PyObject *__pyx_n_s_decode;
static PyObject *__pyx_n_s_describeKeyCode;
static PyObject *__pyx_n_s_displayNumber;
static PyObject *__pyx_n_s_displaySize;
static PyObject *__pyx_n_s_dkc;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_driver;
static PyObject *__pyx_n_s_ekc;
static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_errfun;
static PyObject *__pyx_n_s_errno;
static PyObject *__pyx_n_s_error;
static PyObject *__pyx_n_s_errors;
static PyObject *__pyx_n_s_exception;
static PyObject *__pyx_n_s_expandKeyCode;
static PyObject *__pyx_n_s_flag;
static PyObject *__pyx_n_s_flags;
static PyObject *__pyx_n_u_flags;
static PyObject *__pyx_n_s_func;
static PyObject *__pyx_n_s_gaierrno;
static PyObject *__pyx_kp_u_gaierrno_2;
static PyObject *__pyx_n_s_getLibraryVersion;
static PyObject *__pyx_n_s_getstate;
static PyObject *__pyx_n_s_host;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_key_type;
static PyObject *__pyx_n_u_latin1;
static PyObject *__pyx_n_s_libcerrno;
static PyObject *__pyx_kp_u_libcerrno_2;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_major;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_minor;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_msg;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_orMask;
static PyObject *__pyx_n_s_param;
static PyObject *__pyx_n_s_parameter;
static PyObject *__pyx_n_s_path;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_rangeType_all;
static PyObject *__pyx_n_s_rangeType_code;
static PyObject *__pyx_n_s_rangeType_command;
static PyObject *__pyx_n_s_rangeType_key;
static PyObject *__pyx_n_s_rangeType_type;
static PyObject *__pyx_n_s_reduce;
static PyObject *__pyx_n_s_reduce_cython;
static PyObject *__pyx_n_s_reduce_ex;
static PyObject *__pyx_n_s_regionBegin;
static PyObject *__pyx_n_s_regionSize;
static PyObject *__pyx_n_u_replace;
static PyObject *__pyx_n_s_ret;
static PyObject *__pyx_n_s_retval;
static PyObject *__pyx_n_s_revision;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_kp_s_self_h_cannot_be_converted_to_a;
static PyObject *__pyx_n_s_set;
static PyObject *__pyx_n_s_setstate;
static PyObject *__pyx_n_s_setstate_cython;
static PyObject *__pyx_n_s_settings;
static PyObject *__pyx_n_s_size;
static PyObject *__pyx_n_s_str;
static PyObject *__pyx_n_s_str_2;
static PyObject *__pyx_n_s_subparam;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_text;
static PyObject *__pyx_n_s_timeout_ms;
static PyObject *__pyx_n_s_tty;
static PyObject *__pyx_n_u_type;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_wait;
static PyObject *__pyx_n_s_watchParameter_locals_cfunc;
static PyObject *__pyx_kp_u_with_key;
static PyObject *__pyx_n_s_write;
static PyObject *__pyx_n_s_writeArguments;
static PyObject *__pyx_pf_6brlapi_getLibraryVersion(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6brlapi_2expandKeyCode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_code); /* proto */
static PyObject *__pyx_pf_6brlapi_4describeKeyCode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_code); /* proto */
static PyObject *__pyx_pf_6brlapi_14OperationError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6brlapi_14OperationError_2__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6brlapi_15ConnectionError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_host, PyObject *__pyx_v_auth); /* proto */
static PyObject *__pyx_pf_6brlapi_15ConnectionError_2__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6brlapi_15ConnectionError_4host(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6brlapi_15ConnectionError_6auth(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static int __pyx_pf_6brlapi_11WriteStruct___init__(struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6brlapi_11WriteStruct_13displayNumber___get__(struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_self); /* proto */
static int __pyx_pf_6brlapi_11WriteStruct_13displayNumber_2__set__(struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
static PyObject *__pyx_pf_6brlapi_11WriteStruct_11regionBegin___get__(struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_self); /* proto */
static int __pyx_pf_6brlapi_11WriteStruct_11regionBegin_2__set__(struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
static PyObject *__pyx_pf_6brlapi_11WriteStruct_10regionSize___get__(struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_self); /* proto */
static int __pyx_pf_6brlapi_11WriteStruct_10regionSize_2__set__(struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
static PyObject *__pyx_pf_6brlapi_11WriteStruct_4text___get__(struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_self); /* proto */
static int __pyx_pf_6brlapi_11WriteStruct_4text_2__set__(struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
static PyObject *__pyx_pf_6brlapi_11WriteStruct_6cursor___get__(struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_self); /* proto */
static int __pyx_pf_6brlapi_11WriteStruct_6cursor_2__set__(struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
static PyObject *__pyx_pf_6brlapi_11WriteStruct_7charset___get__(struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_self); /* proto */
static int __pyx_pf_6brlapi_11WriteStruct_7charset_2__set__(struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
static PyObject *__pyx_pf_6brlapi_11WriteStruct_7attrAnd___get__(struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_self); /* proto */
static int __pyx_pf_6brlapi_11WriteStruct_7attrAnd_2__set__(struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
static PyObject *__pyx_pf_6brlapi_11WriteStruct_6attrOr___get__(struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_self); /* proto */
static int __pyx_pf_6brlapi_11WriteStruct_6attrOr_2__set__(struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
static PyObject *__pyx_pf_6brlapi_11WriteStruct_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6brlapi_11WriteStruct_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_6brlapi_10Connection___init__(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_host, PyObject *__pyx_v_auth); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_2closeConnection(struct __pyx_obj_6brlapi_Connection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_4__del__(struct __pyx_obj_6brlapi_Connection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_4host___get__(struct __pyx_obj_6brlapi_Connection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_4auth___get__(struct __pyx_obj_6brlapi_Connection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_14fileDescriptor___get__(struct __pyx_obj_6brlapi_Connection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_11displaySize___get__(struct __pyx_obj_6brlapi_Connection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_10driverName___get__(struct __pyx_obj_6brlapi_Connection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_15modelIdentifier___get__(struct __pyx_obj_6brlapi_Connection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_6enterTtyMode(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_tty, PyObject *__pyx_v_driver); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_8enterTtyModeWithPath(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_driver); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_10leaveTtyMode(struct __pyx_obj_6brlapi_Connection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_12setFocus(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_tty); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_14write(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_writeArguments, PyObject *__pyx_v_displayNumber, PyObject *__pyx_v_regionBegin, PyObject *__pyx_v_regionSize, PyObject *__pyx_v_text, PyObject *__pyx_v_andMask, PyObject *__pyx_v_orMask, PyObject *__pyx_v_cursor, PyObject *__pyx_v_charset); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_16writeDots(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_dots); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_18writeText(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_text, PyObject *__pyx_v_cursor); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_20readKey(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_wait); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_22readKeyWithTimeout(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_timeout_ms); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_24expandKeyCode(CYTHON_UNUSED struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_code); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_26ignoreKeys(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_key_type, PyObject *__pyx_v_set); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_28acceptKeys(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_key_type, PyObject *__pyx_v_set); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_30ignoreAllKeys(struct __pyx_obj_6brlapi_Connection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_32acceptAllKeys(struct __pyx_obj_6brlapi_Connection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_34ignoreKeyRanges(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_keys); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_36acceptKeyRanges(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_keys); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_38enterRawMode(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_driver); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_40leaveRawMode(struct __pyx_obj_6brlapi_Connection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_42getParameter(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_param, PyObject *__pyx_v_subparam, PyObject *__pyx_v_flags); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_44setParameter(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_param, PyObject *__pyx_v_subparam, PyObject *__pyx_v_flags, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_14watchParameter_cfunc(PyObject *__pyx_self, PyObject *__pyx_v_param); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_46watchParameter(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_param, PyObject *__pyx_v_subparam, PyObject *__pyx_v_flags, PyObject *__pyx_v_func); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_48unwatchParameter(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_entry); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_50pause(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_timeout_ms); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_52sync(struct __pyx_obj_6brlapi_Connection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_54__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6brlapi_Connection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6brlapi_10Connection_56__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6brlapi_Connection *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_tp_new_6brlapi_WriteStruct(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6brlapi_Connection(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6brlapi___pyx_scope_struct__watchParameter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_5;
static PyObject *__pyx_int_6;
static PyObject *__pyx_int_7;
static PyObject *__pyx_int_8;
static PyObject *__pyx_int_9;
static PyObject *__pyx_int_10;
static PyObject *__pyx_int_11;
static PyObject *__pyx_int_12;
static PyObject *__pyx_int_13;
static PyObject *__pyx_int_14;
static PyObject *__pyx_int_15;
static PyObject *__pyx_int_16;
static PyObject *__pyx_int_17;
static PyObject *__pyx_int_18;
static PyObject *__pyx_int_19;
static PyObject *__pyx_int_20;
static PyObject *__pyx_int_21;
static PyObject *__pyx_int_22;
static PyObject *__pyx_int_23;
static PyObject *__pyx_int_24;
static PyObject *__pyx_int_25;
static PyObject *__pyx_int_26;
static PyObject *__pyx_int_27;
static PyObject *__pyx_int_28;
static PyObject *__pyx_int_29;
static PyObject *__pyx_int_30;
static PyObject *__pyx_int_31;
static PyObject *__pyx_int_32;
static PyObject *__pyx_int_33;
static PyObject *__pyx_int_34;
static PyObject *__pyx_int_35;
static PyObject *__pyx_int_36;
static PyObject *__pyx_int_37;
static PyObject *__pyx_int_38;
static PyObject *__pyx_int_39;
static PyObject *__pyx_int_40;
static PyObject *__pyx_int_41;
static PyObject *__pyx_int_42;
static PyObject *__pyx_int_43;
static PyObject *__pyx_int_44;
static PyObject *__pyx_int_45;
static PyObject *__pyx_int_46;
static PyObject *__pyx_int_47;
static PyObject *__pyx_int_48;
static PyObject *__pyx_int_49;
static PyObject *__pyx_int_50;
static PyObject *__pyx_int_51;
static PyObject *__pyx_int_52;
static PyObject *__pyx_int_53;
static PyObject *__pyx_int_54;
static PyObject *__pyx_int_55;
static PyObject *__pyx_int_56;
static PyObject *__pyx_int_57;
static PyObject *__pyx_int_58;
static PyObject *__pyx_int_59;
static PyObject *__pyx_int_60;
static PyObject *__pyx_int_61;
static PyObject *__pyx_int_62;
static PyObject *__pyx_int_63;
static PyObject *__pyx_int_64;
static PyObject *__pyx_int_65;
static PyObject *__pyx_int_66;
static PyObject *__pyx_int_67;
static PyObject *__pyx_int_68;
static PyObject *__pyx_int_69;
static PyObject *__pyx_int_70;
static PyObject *__pyx_int_71;
static PyObject *__pyx_int_72;
static PyObject *__pyx_int_73;
static PyObject *__pyx_int_74;
static PyObject *__pyx_int_75;
static PyObject *__pyx_int_76;
static PyObject *__pyx_int_77;
static PyObject *__pyx_int_78;
static PyObject *__pyx_int_79;
static PyObject *__pyx_int_80;
static PyObject *__pyx_int_81;
static PyObject *__pyx_int_82;
static PyObject *__pyx_int_83;
static PyObject *__pyx_int_84;
static PyObject *__pyx_int_85;
static PyObject *__pyx_int_86;
static PyObject *__pyx_int_87;
static PyObject *__pyx_int_88;
static PyObject *__pyx_int_89;
static PyObject *__pyx_int_90;
static PyObject *__pyx_int_91;
static PyObject *__pyx_int_92;
static PyObject *__pyx_int_93;
static PyObject *__pyx_int_94;
static PyObject *__pyx_int_95;
static PyObject *__pyx_int_96;
static PyObject *__pyx_int_97;
static PyObject *__pyx_int_98;
static PyObject *__pyx_int_99;
static PyObject *__pyx_int_100;
static PyObject *__pyx_int_101;
static PyObject *__pyx_int_102;
static PyObject *__pyx_int_103;
static PyObject *__pyx_int_104;
static PyObject *__pyx_int_105;
static PyObject *__pyx_int_106;
static PyObject *__pyx_int_107;
static PyObject *__pyx_int_108;
static PyObject *__pyx_int_109;
static PyObject *__pyx_int_110;
static PyObject *__pyx_int_111;
static PyObject *__pyx_int_112;
static PyObject *__pyx_int_113;
static PyObject *__pyx_int_114;
static PyObject *__pyx_int_115;
static PyObject *__pyx_int_116;
static PyObject *__pyx_int_117;
static PyObject *__pyx_int_118;
static PyObject *__pyx_int_119;
static PyObject *__pyx_int_120;
static PyObject *__pyx_int_121;
static PyObject *__pyx_int_122;
static PyObject *__pyx_int_123;
static PyObject *__pyx_int_124;
static PyObject *__pyx_int_125;
static PyObject *__pyx_int_126;
static PyObject *__pyx_int_127;
static PyObject *__pyx_int_128;
static PyObject *__pyx_int_129;
static PyObject *__pyx_int_130;
static PyObject *__pyx_int_131;
static PyObject *__pyx_int_132;
static PyObject *__pyx_int_133;
static PyObject *__pyx_int_134;
static PyObject *__pyx_int_135;
static PyObject *__pyx_int_136;
static PyObject *__pyx_int_137;
static PyObject *__pyx_int_138;
static PyObject *__pyx_int_139;
static PyObject *__pyx_int_140;
static PyObject *__pyx_int_141;
static PyObject *__pyx_int_142;
static PyObject *__pyx_int_143;
static PyObject *__pyx_int_144;
static PyObject *__pyx_int_145;
static PyObject *__pyx_int_146;
static PyObject *__pyx_int_147;
static PyObject *__pyx_int_148;
static PyObject *__pyx_int_149;
static PyObject *__pyx_int_150;
static PyObject *__pyx_int_151;
static PyObject *__pyx_int_152;
static PyObject *__pyx_int_153;
static PyObject *__pyx_int_154;
static PyObject *__pyx_int_256;
static PyObject *__pyx_int_512;
static PyObject *__pyx_int_1024;
static PyObject *__pyx_int_2048;
static PyObject *__pyx_int_4096;
static PyObject *__pyx_int_8192;
static PyObject *__pyx_int_16384;
static PyObject *__pyx_int_65288;
static PyObject *__pyx_int_65289;
static PyObject *__pyx_int_65293;
static PyObject *__pyx_int_65307;
static PyObject *__pyx_int_65360;
static PyObject *__pyx_int_65361;
static PyObject *__pyx_int_65362;
static PyObject *__pyx_int_65363;
static PyObject *__pyx_int_65364;
static PyObject *__pyx_int_65365;
static PyObject *__pyx_int_65366;
static PyObject *__pyx_int_65367;
static PyObject *__pyx_int_65379;
static PyObject *__pyx_int_65470;
static PyObject *__pyx_int_65471;
static PyObject *__pyx_int_65472;
static PyObject *__pyx_int_65473;
static PyObject *__pyx_int_65474;
static PyObject *__pyx_int_65475;
static PyObject *__pyx_int_65476;
static PyObject *__pyx_int_65477;
static PyObject *__pyx_int_65478;
static PyObject *__pyx_int_65479;
static PyObject *__pyx_int_65480;
static PyObject *__pyx_int_65481;
static PyObject *__pyx_int_65482;
static PyObject *__pyx_int_65483;
static PyObject *__pyx_int_65484;
static PyObject *__pyx_int_65485;
static PyObject *__pyx_int_65486;
static PyObject *__pyx_int_65487;
static PyObject *__pyx_int_65488;
static PyObject *__pyx_int_65489;
static PyObject *__pyx_int_65490;
static PyObject *__pyx_int_65491;
static PyObject *__pyx_int_65492;
static PyObject *__pyx_int_65493;
static PyObject *__pyx_int_65494;
static PyObject *__pyx_int_65495;
static PyObject *__pyx_int_65496;
static PyObject *__pyx_int_65497;
static PyObject *__pyx_int_65498;
static PyObject *__pyx_int_65499;
static PyObject *__pyx_int_65500;
static PyObject *__pyx_int_65501;
static PyObject *__pyx_int_65502;
static PyObject *__pyx_int_65503;
static PyObject *__pyx_int_65504;
static PyObject *__pyx_int_65535;
static PyObject *__pyx_int_16777216;
static PyObject *__pyx_int_536870912;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_k__8;
static PyObject *__pyx_k__9;
static PyObject *__pyx_k__11;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__20;
static PyObject *__pyx_tuple__21;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__31;
static PyObject *__pyx_tuple__33;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__37;
static PyObject *__pyx_codeobj__18;
static PyObject *__pyx_codeobj__22;
static PyObject *__pyx_codeobj__24;
static PyObject *__pyx_codeobj__26;
static PyObject *__pyx_codeobj__28;
static PyObject *__pyx_codeobj__30;
static PyObject *__pyx_codeobj__32;
static PyObject *__pyx_codeobj__34;
static PyObject *__pyx_codeobj__36;
static PyObject *__pyx_codeobj__38;
/* Late includes */

/* "brlapi.pyx":126
 * include "constants.auto.pyx"
 * 
 * def getLibraryVersion():             # <<<<<<<<<<<<<<
 * 	"""Get the BrlAPI version as a three-element list (major, minor, revision).
 * 	See brlapi_getLibraryVersion(3)."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_1getLibraryVersion(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6brlapi_getLibraryVersion[] = "getLibraryVersion()\nGet the BrlAPI version as a three-element list (major, minor, revision).\n\tSee brlapi_getLibraryVersion(3).";
static PyMethodDef __pyx_mdef_6brlapi_1getLibraryVersion = {"getLibraryVersion", (PyCFunction)__pyx_pw_6brlapi_1getLibraryVersion, METH_NOARGS, __pyx_doc_6brlapi_getLibraryVersion};
static PyObject *__pyx_pw_6brlapi_1getLibraryVersion(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getLibraryVersion (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_getLibraryVersion(__pyx_self);

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

static PyObject *__pyx_pf_6brlapi_getLibraryVersion(CYTHON_UNUSED PyObject *__pyx_self) {
  int __pyx_v_major;
  int __pyx_v_minor;
  int __pyx_v_revision;
  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("getLibraryVersion", 0);

  /* "brlapi.pyx":132
 * 	cdef int minor
 * 	cdef int revision
 * 	with nogil:             # <<<<<<<<<<<<<<
 * 		c_brlapi.brlapi_getLibraryVersion(&major, &minor, &revision)
 * 	return (major, minor, revision)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "brlapi.pyx":133
 * 	cdef int revision
 * 	with nogil:
 * 		c_brlapi.brlapi_getLibraryVersion(&major, &minor, &revision)             # <<<<<<<<<<<<<<
 * 	return (major, minor, revision)
 * 
 */
        brlapi_getLibraryVersion((&__pyx_v_major), (&__pyx_v_minor), (&__pyx_v_revision));
      }

      /* "brlapi.pyx":132
 * 	cdef int minor
 * 	cdef int revision
 * 	with nogil:             # <<<<<<<<<<<<<<
 * 		c_brlapi.brlapi_getLibraryVersion(&major, &minor, &revision)
 * 	return (major, minor, revision)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "brlapi.pyx":134
 * 	with nogil:
 * 		c_brlapi.brlapi_getLibraryVersion(&major, &minor, &revision)
 * 	return (major, minor, revision)             # <<<<<<<<<<<<<<
 * 
 * def expandKeyCode(code):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_major); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_minor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_revision); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "brlapi.pyx":126
 * include "constants.auto.pyx"
 * 
 * def getLibraryVersion():             # <<<<<<<<<<<<<<
 * 	"""Get the BrlAPI version as a three-element list (major, minor, revision).
 * 	See brlapi_getLibraryVersion(3)."""
 */

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

/* "brlapi.pyx":136
 * 	return (major, minor, revision)
 * 
 * def expandKeyCode(code):             # <<<<<<<<<<<<<<
 * 	"""Expand a keycode into its individual components.
 * 	See brlapi_expandKeyCode(3)."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_3expandKeyCode(PyObject *__pyx_self, PyObject *__pyx_v_code); /*proto*/
static char __pyx_doc_6brlapi_2expandKeyCode[] = "expandKeyCode(code)\nExpand a keycode into its individual components.\n\tSee brlapi_expandKeyCode(3).";
static PyMethodDef __pyx_mdef_6brlapi_3expandKeyCode = {"expandKeyCode", (PyCFunction)__pyx_pw_6brlapi_3expandKeyCode, METH_O, __pyx_doc_6brlapi_2expandKeyCode};
static PyObject *__pyx_pw_6brlapi_3expandKeyCode(PyObject *__pyx_self, PyObject *__pyx_v_code) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("expandKeyCode (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_2expandKeyCode(__pyx_self, ((PyObject *)__pyx_v_code));

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

static PyObject *__pyx_pf_6brlapi_2expandKeyCode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_code) {
  brlapi_expandedKeyCode_t __pyx_v_ekc;
  int __pyx_v_retval;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  brlapi_keyCode_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("expandKeyCode", 0);

  /* "brlapi.pyx":141
 * 	cdef c_brlapi.brlapi_expandedKeyCode_t ekc
 * 	cdef int retval
 * 	retval = c_brlapi.brlapi_expandKeyCode(code, &ekc)             # <<<<<<<<<<<<<<
 * 	if retval == -1:
 * 		raise OperationError()
 */
  __pyx_t_1 = __Pyx_PyInt_As_brlapi_keyCode_t(__pyx_v_code); if (unlikely((__pyx_t_1 == ((brlapi_keyCode_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L1_error)
  __pyx_v_retval = brlapi_expandKeyCode(__pyx_t_1, (&__pyx_v_ekc));

  /* "brlapi.pyx":142
 * 	cdef int retval
 * 	retval = c_brlapi.brlapi_expandKeyCode(code, &ekc)
 * 	if retval == -1:             # <<<<<<<<<<<<<<
 * 		raise OperationError()
 * 	else:
 */
  __pyx_t_2 = ((__pyx_v_retval == -1L) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "brlapi.pyx":143
 * 	retval = c_brlapi.brlapi_expandKeyCode(code, &ekc)
 * 	if retval == -1:
 * 		raise OperationError()             # <<<<<<<<<<<<<<
 * 	else:
 * 		return {
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_OperationError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __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_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 143, __pyx_L1_error)

    /* "brlapi.pyx":142
 * 	cdef int retval
 * 	retval = c_brlapi.brlapi_expandKeyCode(code, &ekc)
 * 	if retval == -1:             # <<<<<<<<<<<<<<
 * 		raise OperationError()
 * 	else:
 */
  }

  /* "brlapi.pyx":145
 * 		raise OperationError()
 * 	else:
 * 		return {             # <<<<<<<<<<<<<<
 * 			"type": ekc.type,
 * 			"command": ekc.command,
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);

    /* "brlapi.pyx":146
 * 	else:
 * 		return {
 * 			"type": ekc.type,             # <<<<<<<<<<<<<<
 * 			"command": ekc.command,
 * 			"argument": ekc.argument,
 */
    __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_ekc.type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_type, __pyx_t_4) < 0) __PYX_ERR(0, 146, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "brlapi.pyx":147
 * 		return {
 * 			"type": ekc.type,
 * 			"command": ekc.command,             # <<<<<<<<<<<<<<
 * 			"argument": ekc.argument,
 * 			"flags": ekc.flags
 */
    __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_ekc.command); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_command, __pyx_t_4) < 0) __PYX_ERR(0, 146, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "brlapi.pyx":148
 * 			"type": ekc.type,
 * 			"command": ekc.command,
 * 			"argument": ekc.argument,             # <<<<<<<<<<<<<<
 * 			"flags": ekc.flags
 * 		}
 */
    __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_ekc.argument); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_argument, __pyx_t_4) < 0) __PYX_ERR(0, 146, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "brlapi.pyx":149
 * 			"command": ekc.command,
 * 			"argument": ekc.argument,
 * 			"flags": ekc.flags             # <<<<<<<<<<<<<<
 * 		}
 * 
 */
    __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_ekc.flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_flags, __pyx_t_4) < 0) __PYX_ERR(0, 146, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "brlapi.pyx":136
 * 	return (major, minor, revision)
 * 
 * def expandKeyCode(code):             # <<<<<<<<<<<<<<
 * 	"""Expand a keycode into its individual components.
 * 	See brlapi_expandKeyCode(3)."""
 */

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

/* "brlapi.pyx":152
 * 		}
 * 
 * def describeKeyCode(code):             # <<<<<<<<<<<<<<
 * 	"""Describe the individual components of a keycode symbolically.
 * 	See brlapi_describeKeyCode(3)."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_5describeKeyCode(PyObject *__pyx_self, PyObject *__pyx_v_code); /*proto*/
static char __pyx_doc_6brlapi_4describeKeyCode[] = "describeKeyCode(code)\nDescribe the individual components of a keycode symbolically.\n\tSee brlapi_describeKeyCode(3).";
static PyMethodDef __pyx_mdef_6brlapi_5describeKeyCode = {"describeKeyCode", (PyCFunction)__pyx_pw_6brlapi_5describeKeyCode, METH_O, __pyx_doc_6brlapi_4describeKeyCode};
static PyObject *__pyx_pw_6brlapi_5describeKeyCode(PyObject *__pyx_self, PyObject *__pyx_v_code) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("describeKeyCode (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_4describeKeyCode(__pyx_self, ((PyObject *)__pyx_v_code));

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

static PyObject *__pyx_pf_6brlapi_4describeKeyCode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_code) {
  brlapi_describedKeyCode_t __pyx_v_dkc;
  int __pyx_v_retval;
  PyObject *__pyx_v_flags = NULL;
  unsigned int __pyx_v_flag;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  brlapi_keyCode_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  unsigned int __pyx_t_7;
  unsigned int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("describeKeyCode", 0);

  /* "brlapi.pyx":157
 * 	cdef c_brlapi.brlapi_describedKeyCode_t dkc
 * 	cdef int retval
 * 	retval = c_brlapi.brlapi_describeKeyCode(code, &dkc)             # <<<<<<<<<<<<<<
 * 	if retval == -1:
 * 		raise OperationError()
 */
  __pyx_t_1 = __Pyx_PyInt_As_brlapi_keyCode_t(__pyx_v_code); if (unlikely((__pyx_t_1 == ((brlapi_keyCode_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 157, __pyx_L1_error)
  __pyx_v_retval = brlapi_describeKeyCode(__pyx_t_1, (&__pyx_v_dkc));

  /* "brlapi.pyx":158
 * 	cdef int retval
 * 	retval = c_brlapi.brlapi_describeKeyCode(code, &dkc)
 * 	if retval == -1:             # <<<<<<<<<<<<<<
 * 		raise OperationError()
 * 	else:
 */
  __pyx_t_2 = ((__pyx_v_retval == -1L) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "brlapi.pyx":159
 * 	retval = c_brlapi.brlapi_describeKeyCode(code, &dkc)
 * 	if retval == -1:
 * 		raise OperationError()             # <<<<<<<<<<<<<<
 * 	else:
 * 		flags = ()
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_OperationError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __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_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 159, __pyx_L1_error)

    /* "brlapi.pyx":158
 * 	cdef int retval
 * 	retval = c_brlapi.brlapi_describeKeyCode(code, &dkc)
 * 	if retval == -1:             # <<<<<<<<<<<<<<
 * 		raise OperationError()
 * 	else:
 */
  }

  /* "brlapi.pyx":161
 * 		raise OperationError()
 * 	else:
 * 		flags = ()             # <<<<<<<<<<<<<<
 * 		for flag in range(dkc.flags):
 * 			flags += (dkc.flag[flag], )
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_empty_tuple);
    __pyx_v_flags = __pyx_empty_tuple;

    /* "brlapi.pyx":162
 * 	else:
 * 		flags = ()
 * 		for flag in range(dkc.flags):             # <<<<<<<<<<<<<<
 * 			flags += (dkc.flag[flag], )
 * 		return {
 */
    __pyx_t_6 = __pyx_v_dkc.flags;
    __pyx_t_7 = __pyx_t_6;
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
      __pyx_v_flag = __pyx_t_8;

      /* "brlapi.pyx":163
 * 		flags = ()
 * 		for flag in range(dkc.flags):
 * 			flags += (dkc.flag[flag], )             # <<<<<<<<<<<<<<
 * 		return {
 * 			"type": dkc.type,
 */
      __pyx_t_3 = __Pyx_PyBytes_FromString((__pyx_v_dkc.flag[__pyx_v_flag])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_flags, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_flags, __pyx_t_3);
      __pyx_t_3 = 0;
    }

    /* "brlapi.pyx":164
 * 		for flag in range(dkc.flags):
 * 			flags += (dkc.flag[flag], )
 * 		return {             # <<<<<<<<<<<<<<
 * 			"type": dkc.type,
 * 			"command": dkc.command,
 */
    __Pyx_XDECREF(__pyx_r);

    /* "brlapi.pyx":165
 * 			flags += (dkc.flag[flag], )
 * 		return {
 * 			"type": dkc.type,             # <<<<<<<<<<<<<<
 * 			"command": dkc.command,
 * 			"argument": dkc.argument,
 */
    __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_dkc.type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_type, __pyx_t_4) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "brlapi.pyx":166
 * 		return {
 * 			"type": dkc.type,
 * 			"command": dkc.command,             # <<<<<<<<<<<<<<
 * 			"argument": dkc.argument,
 * 			"flags": flags
 */
    __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_dkc.command); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_command, __pyx_t_4) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "brlapi.pyx":167
 * 			"type": dkc.type,
 * 			"command": dkc.command,
 * 			"argument": dkc.argument,             # <<<<<<<<<<<<<<
 * 			"flags": flags
 * 		}
 */
    __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_dkc.argument); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_argument, __pyx_t_4) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "brlapi.pyx":168
 * 			"command": dkc.command,
 * 			"argument": dkc.argument,
 * 			"flags": flags             # <<<<<<<<<<<<<<
 * 		}
 * 
 */
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_flags, __pyx_v_flags) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "brlapi.pyx":152
 * 		}
 * 
 * def describeKeyCode(code):             # <<<<<<<<<<<<<<
 * 	"""Describe the individual components of a keycode symbolically.
 * 	See brlapi_describeKeyCode(3)."""
 */

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

/* "brlapi.pyx":171
 * 		}
 * 
 * cdef object _parameterToPython(c_brlapi.brlapi_param_t c_param, const void *c_value, size_t size):             # <<<<<<<<<<<<<<
 * 	cdef const c_brlapi.brlapi_param_properties_t *props
 * 
 */

static PyObject *__pyx_f_6brlapi__parameterToPython(brlapi_param_t __pyx_v_c_param, void const *__pyx_v_c_value, size_t __pyx_v_size) {
  brlapi_param_properties_t const *__pyx_v_props;
  char *__pyx_v_string;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_v_ret = NULL;
  uint8_t *__pyx_v_values8;
  uint16_t *__pyx_v_values16;
  uint32_t *__pyx_v_values32;
  uint64_t *__pyx_v_values64;
  size_t __pyx_7genexpr__pyx_v_i;
  size_t __pyx_8genexpr1__pyx_v_i;
  size_t __pyx_8genexpr2__pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  size_t __pyx_t_6;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_parameterToPython", 0);

  /* "brlapi.pyx":174
 * 	cdef const c_brlapi.brlapi_param_properties_t *props
 * 
 * 	with nogil:             # <<<<<<<<<<<<<<
 * 		props = c_brlapi.brlapi_getParameterProperties(c_param)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "brlapi.pyx":175
 * 
 * 	with nogil:
 * 		props = c_brlapi.brlapi_getParameterProperties(c_param)             # <<<<<<<<<<<<<<
 * 
 * 	if props == NULL:
 */
        __pyx_v_props = brlapi_getParameterProperties(__pyx_v_c_param);
      }

      /* "brlapi.pyx":174
 * 	cdef const c_brlapi.brlapi_param_properties_t *props
 * 
 * 	with nogil:             # <<<<<<<<<<<<<<
 * 		props = c_brlapi.brlapi_getParameterProperties(c_param)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "brlapi.pyx":177
 * 		props = c_brlapi.brlapi_getParameterProperties(c_param)
 * 
 * 	if props == NULL:             # <<<<<<<<<<<<<<
 * 		raise OperationError()
 * 
 */
  __pyx_t_1 = ((__pyx_v_props == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "brlapi.pyx":178
 * 
 * 	if props == NULL:
 * 		raise OperationError()             # <<<<<<<<<<<<<<
 * 
 * 	if props.type == PARAM_TYPE_STRING:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_OperationError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_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, 178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 178, __pyx_L1_error)

    /* "brlapi.pyx":177
 * 		props = c_brlapi.brlapi_getParameterProperties(c_param)
 * 
 * 	if props == NULL:             # <<<<<<<<<<<<<<
 * 		raise OperationError()
 * 
 */
  }

  /* "brlapi.pyx":180
 * 		raise OperationError()
 * 
 * 	if props.type == PARAM_TYPE_STRING:             # <<<<<<<<<<<<<<
 * 		string = <char *>c_value
 * 		s = string[:size]
 */
  __pyx_t_2 = __Pyx_PyInt_From_brlapi_param_type_t(__pyx_v_props->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PARAM_TYPE_STRING); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_1) {

    /* "brlapi.pyx":181
 * 
 * 	if props.type == PARAM_TYPE_STRING:
 * 		string = <char *>c_value             # <<<<<<<<<<<<<<
 * 		s = string[:size]
 * 		ret = s.decode("UTF-8")
 */
    __pyx_v_string = ((char *)__pyx_v_c_value);

    /* "brlapi.pyx":182
 * 	if props.type == PARAM_TYPE_STRING:
 * 		string = <char *>c_value
 * 		s = string[:size]             # <<<<<<<<<<<<<<
 * 		ret = s.decode("UTF-8")
 * 	elif props.type == PARAM_TYPE_BOOLEAN:
 */
    __pyx_t_4 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_string + 0, __pyx_v_size - 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_s = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "brlapi.pyx":183
 * 		string = <char *>c_value
 * 		s = string[:size]
 * 		ret = s.decode("UTF-8")             # <<<<<<<<<<<<<<
 * 	elif props.type == PARAM_TYPE_BOOLEAN:
 * 		values8 = <uint8_t *>c_value
 */
    __pyx_t_4 = __Pyx_decode_bytes(__pyx_v_s, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_ret = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "brlapi.pyx":180
 * 		raise OperationError()
 * 
 * 	if props.type == PARAM_TYPE_STRING:             # <<<<<<<<<<<<<<
 * 		string = <char *>c_value
 * 		s = string[:size]
 */
    goto __pyx_L7;
  }

  /* "brlapi.pyx":184
 * 		s = string[:size]
 * 		ret = s.decode("UTF-8")
 * 	elif props.type == PARAM_TYPE_BOOLEAN:             # <<<<<<<<<<<<<<
 * 		values8 = <uint8_t *>c_value
 * 		ret = values8[0] != 0
 */
  __pyx_t_4 = __Pyx_PyInt_From_brlapi_param_type_t(__pyx_v_props->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PARAM_TYPE_BOOLEAN); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 184, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "brlapi.pyx":185
 * 		ret = s.decode("UTF-8")
 * 	elif props.type == PARAM_TYPE_BOOLEAN:
 * 		values8 = <uint8_t *>c_value             # <<<<<<<<<<<<<<
 * 		ret = values8[0] != 0
 * 	elif props.type == PARAM_TYPE_UINT8:
 */
    __pyx_v_values8 = ((uint8_t *)__pyx_v_c_value);

    /* "brlapi.pyx":186
 * 	elif props.type == PARAM_TYPE_BOOLEAN:
 * 		values8 = <uint8_t *>c_value
 * 		ret = values8[0] != 0             # <<<<<<<<<<<<<<
 * 	elif props.type == PARAM_TYPE_UINT8:
 * 		if props.isArray:
 */
    __pyx_t_2 = __Pyx_PyBool_FromLong(((__pyx_v_values8[0]) != 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_ret = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "brlapi.pyx":184
 * 		s = string[:size]
 * 		ret = s.decode("UTF-8")
 * 	elif props.type == PARAM_TYPE_BOOLEAN:             # <<<<<<<<<<<<<<
 * 		values8 = <uint8_t *>c_value
 * 		ret = values8[0] != 0
 */
    goto __pyx_L7;
  }

  /* "brlapi.pyx":187
 * 		values8 = <uint8_t *>c_value
 * 		ret = values8[0] != 0
 * 	elif props.type == PARAM_TYPE_UINT8:             # <<<<<<<<<<<<<<
 * 		if props.isArray:
 * 			values8 = <uint8_t *>c_value
 */
  __pyx_t_2 = __Pyx_PyInt_From_brlapi_param_type_t(__pyx_v_props->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PARAM_TYPE_UINT8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_1) {

    /* "brlapi.pyx":188
 * 		ret = values8[0] != 0
 * 	elif props.type == PARAM_TYPE_UINT8:
 * 		if props.isArray:             # <<<<<<<<<<<<<<
 * 			values8 = <uint8_t *>c_value
 * 			ret = values8[:size]
 */
    __pyx_t_1 = (__pyx_v_props->isArray != 0);
    if (__pyx_t_1) {

      /* "brlapi.pyx":189
 * 	elif props.type == PARAM_TYPE_UINT8:
 * 		if props.isArray:
 * 			values8 = <uint8_t *>c_value             # <<<<<<<<<<<<<<
 * 			ret = values8[:size]
 * 		else:
 */
      __pyx_v_values8 = ((uint8_t *)__pyx_v_c_value);

      /* "brlapi.pyx":190
 * 		if props.isArray:
 * 			values8 = <uint8_t *>c_value
 * 			ret = values8[:size]             # <<<<<<<<<<<<<<
 * 		else:
 * 			values8 = <uint8_t *>c_value
 */
      __pyx_t_4 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_values8) + 0, __pyx_v_size - 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_ret = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "brlapi.pyx":188
 * 		ret = values8[0] != 0
 * 	elif props.type == PARAM_TYPE_UINT8:
 * 		if props.isArray:             # <<<<<<<<<<<<<<
 * 			values8 = <uint8_t *>c_value
 * 			ret = values8[:size]
 */
      goto __pyx_L8;
    }

    /* "brlapi.pyx":192
 * 			ret = values8[:size]
 * 		else:
 * 			values8 = <uint8_t *>c_value             # <<<<<<<<<<<<<<
 * 			ret = values8[0]
 * 	elif props.type == PARAM_TYPE_UINT16:
 */
    /*else*/ {
      __pyx_v_values8 = ((uint8_t *)__pyx_v_c_value);

      /* "brlapi.pyx":193
 * 		else:
 * 			values8 = <uint8_t *>c_value
 * 			ret = values8[0]             # <<<<<<<<<<<<<<
 * 	elif props.type == PARAM_TYPE_UINT16:
 * 		if props.isArray:
 */
      __pyx_t_4 = __Pyx_PyInt_From_uint8_t((__pyx_v_values8[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_ret = __pyx_t_4;
      __pyx_t_4 = 0;
    }
    __pyx_L8:;

    /* "brlapi.pyx":187
 * 		values8 = <uint8_t *>c_value
 * 		ret = values8[0] != 0
 * 	elif props.type == PARAM_TYPE_UINT8:             # <<<<<<<<<<<<<<
 * 		if props.isArray:
 * 			values8 = <uint8_t *>c_value
 */
    goto __pyx_L7;
  }

  /* "brlapi.pyx":194
 * 			values8 = <uint8_t *>c_value
 * 			ret = values8[0]
 * 	elif props.type == PARAM_TYPE_UINT16:             # <<<<<<<<<<<<<<
 * 		if props.isArray:
 * 			values16 = <uint16_t *>c_value
 */
  __pyx_t_4 = __Pyx_PyInt_From_brlapi_param_type_t(__pyx_v_props->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PARAM_TYPE_UINT16); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 194, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "brlapi.pyx":195
 * 			ret = values8[0]
 * 	elif props.type == PARAM_TYPE_UINT16:
 * 		if props.isArray:             # <<<<<<<<<<<<<<
 * 			values16 = <uint16_t *>c_value
 * 			ret = [values16[i] for i in range(size//2)]
 */
    __pyx_t_1 = (__pyx_v_props->isArray != 0);
    if (__pyx_t_1) {

      /* "brlapi.pyx":196
 * 	elif props.type == PARAM_TYPE_UINT16:
 * 		if props.isArray:
 * 			values16 = <uint16_t *>c_value             # <<<<<<<<<<<<<<
 * 			ret = [values16[i] for i in range(size//2)]
 * 		else:
 */
      __pyx_v_values16 = ((uint16_t *)__pyx_v_c_value);

      /* "brlapi.pyx":197
 * 		if props.isArray:
 * 			values16 = <uint16_t *>c_value
 * 			ret = [values16[i] for i in range(size//2)]             # <<<<<<<<<<<<<<
 * 		else:
 * 			values16 = <uint16_t *>c_value
 */
      { /* enter inner scope */
        __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_5 = (__pyx_v_size / 2);
        __pyx_t_6 = __pyx_t_5;
        for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
          __pyx_7genexpr__pyx_v_i = __pyx_t_7;
          __pyx_t_3 = __Pyx_PyInt_From_uint16_t((__pyx_v_values16[__pyx_7genexpr__pyx_v_i])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 197, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
      } /* exit inner scope */
      __pyx_v_ret = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "brlapi.pyx":195
 * 			ret = values8[0]
 * 	elif props.type == PARAM_TYPE_UINT16:
 * 		if props.isArray:             # <<<<<<<<<<<<<<
 * 			values16 = <uint16_t *>c_value
 * 			ret = [values16[i] for i in range(size//2)]
 */
      goto __pyx_L9;
    }

    /* "brlapi.pyx":199
 * 			ret = [values16[i] for i in range(size//2)]
 * 		else:
 * 			values16 = <uint16_t *>c_value             # <<<<<<<<<<<<<<
 * 			ret = values16[0]
 * 	elif props.type == PARAM_TYPE_UINT32:
 */
    /*else*/ {
      __pyx_v_values16 = ((uint16_t *)__pyx_v_c_value);

      /* "brlapi.pyx":200
 * 		else:
 * 			values16 = <uint16_t *>c_value
 * 			ret = values16[0]             # <<<<<<<<<<<<<<
 * 	elif props.type == PARAM_TYPE_UINT32:
 * 		if props.isArray:
 */
      __pyx_t_2 = __Pyx_PyInt_From_uint16_t((__pyx_v_values16[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_ret = __pyx_t_2;
      __pyx_t_2 = 0;
    }
    __pyx_L9:;

    /* "brlapi.pyx":194
 * 			values8 = <uint8_t *>c_value
 * 			ret = values8[0]
 * 	elif props.type == PARAM_TYPE_UINT16:             # <<<<<<<<<<<<<<
 * 		if props.isArray:
 * 			values16 = <uint16_t *>c_value
 */
    goto __pyx_L7;
  }

  /* "brlapi.pyx":201
 * 			values16 = <uint16_t *>c_value
 * 			ret = values16[0]
 * 	elif props.type == PARAM_TYPE_UINT32:             # <<<<<<<<<<<<<<
 * 		if props.isArray:
 * 			values32 = <uint32_t *>c_value
 */
  __pyx_t_2 = __Pyx_PyInt_From_brlapi_param_type_t(__pyx_v_props->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PARAM_TYPE_UINT32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_1) {

    /* "brlapi.pyx":202
 * 			ret = values16[0]
 * 	elif props.type == PARAM_TYPE_UINT32:
 * 		if props.isArray:             # <<<<<<<<<<<<<<
 * 			values32 = <uint32_t *>c_value
 * 			ret = [values32[i] for i in range(size//4)]
 */
    __pyx_t_1 = (__pyx_v_props->isArray != 0);
    if (__pyx_t_1) {

      /* "brlapi.pyx":203
 * 	elif props.type == PARAM_TYPE_UINT32:
 * 		if props.isArray:
 * 			values32 = <uint32_t *>c_value             # <<<<<<<<<<<<<<
 * 			ret = [values32[i] for i in range(size//4)]
 * 		else:
 */
      __pyx_v_values32 = ((uint32_t *)__pyx_v_c_value);

      /* "brlapi.pyx":204
 * 		if props.isArray:
 * 			values32 = <uint32_t *>c_value
 * 			ret = [values32[i] for i in range(size//4)]             # <<<<<<<<<<<<<<
 * 		else:
 * 			values32 = <uint32_t *>c_value
 */
      { /* enter inner scope */
        __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = (__pyx_v_size / 4);
        __pyx_t_6 = __pyx_t_5;
        for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
          __pyx_8genexpr1__pyx_v_i = __pyx_t_7;
          __pyx_t_3 = __Pyx_PyInt_From_uint32_t((__pyx_v_values32[__pyx_8genexpr1__pyx_v_i])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 204, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
      } /* exit inner scope */
      __pyx_v_ret = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "brlapi.pyx":202
 * 			ret = values16[0]
 * 	elif props.type == PARAM_TYPE_UINT32:
 * 		if props.isArray:             # <<<<<<<<<<<<<<
 * 			values32 = <uint32_t *>c_value
 * 			ret = [values32[i] for i in range(size//4)]
 */
      goto __pyx_L12;
    }

    /* "brlapi.pyx":206
 * 			ret = [values32[i] for i in range(size//4)]
 * 		else:
 * 			values32 = <uint32_t *>c_value             # <<<<<<<<<<<<<<
 * 			ret = values32[0]
 * 	elif props.type == PARAM_TYPE_UINT64:
 */
    /*else*/ {
      __pyx_v_values32 = ((uint32_t *)__pyx_v_c_value);

      /* "brlapi.pyx":207
 * 		else:
 * 			values32 = <uint32_t *>c_value
 * 			ret = values32[0]             # <<<<<<<<<<<<<<
 * 	elif props.type == PARAM_TYPE_UINT64:
 * 		if props.isArray:
 */
      __pyx_t_4 = __Pyx_PyInt_From_uint32_t((__pyx_v_values32[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_ret = __pyx_t_4;
      __pyx_t_4 = 0;
    }
    __pyx_L12:;

    /* "brlapi.pyx":201
 * 			values16 = <uint16_t *>c_value
 * 			ret = values16[0]
 * 	elif props.type == PARAM_TYPE_UINT32:             # <<<<<<<<<<<<<<
 * 		if props.isArray:
 * 			values32 = <uint32_t *>c_value
 */
    goto __pyx_L7;
  }

  /* "brlapi.pyx":208
 * 			values32 = <uint32_t *>c_value
 * 			ret = values32[0]
 * 	elif props.type == PARAM_TYPE_UINT64:             # <<<<<<<<<<<<<<
 * 		if props.isArray:
 * 			values64 = <uint64_t *>c_value
 */
  __pyx_t_4 = __Pyx_PyInt_From_brlapi_param_type_t(__pyx_v_props->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PARAM_TYPE_UINT64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 208, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(__pyx_t_1)) {

    /* "brlapi.pyx":209
 * 			ret = values32[0]
 * 	elif props.type == PARAM_TYPE_UINT64:
 * 		if props.isArray:             # <<<<<<<<<<<<<<
 * 			values64 = <uint64_t *>c_value
 * 			ret = [values64[i] for i in range(size//8)]
 */
    __pyx_t_1 = (__pyx_v_props->isArray != 0);
    if (__pyx_t_1) {

      /* "brlapi.pyx":210
 * 	elif props.type == PARAM_TYPE_UINT64:
 * 		if props.isArray:
 * 			values64 = <uint64_t *>c_value             # <<<<<<<<<<<<<<
 * 			ret = [values64[i] for i in range(size//8)]
 * 		else:
 */
      __pyx_v_values64 = ((uint64_t *)__pyx_v_c_value);

      /* "brlapi.pyx":211
 * 		if props.isArray:
 * 			values64 = <uint64_t *>c_value
 * 			ret = [values64[i] for i in range(size//8)]             # <<<<<<<<<<<<<<
 * 		else:
 * 			values64 = <uint64_t *>c_value
 */
      { /* enter inner scope */
        __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_5 = (__pyx_v_size / 8);
        __pyx_t_6 = __pyx_t_5;
        for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
          __pyx_8genexpr2__pyx_v_i = __pyx_t_7;
          __pyx_t_3 = __Pyx_PyInt_From_uint64_t((__pyx_v_values64[__pyx_8genexpr2__pyx_v_i])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 211, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
      } /* exit inner scope */
      __pyx_v_ret = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "brlapi.pyx":209
 * 			ret = values32[0]
 * 	elif props.type == PARAM_TYPE_UINT64:
 * 		if props.isArray:             # <<<<<<<<<<<<<<
 * 			values64 = <uint64_t *>c_value
 * 			ret = [values64[i] for i in range(size//8)]
 */
      goto __pyx_L15;
    }

    /* "brlapi.pyx":213
 * 			ret = [values64[i] for i in range(size//8)]
 * 		else:
 * 			values64 = <uint64_t *>c_value             # <<<<<<<<<<<<<<
 * 			ret = values64[0]
 * 	else:
 */
    /*else*/ {
      __pyx_v_values64 = ((uint64_t *)__pyx_v_c_value);

      /* "brlapi.pyx":214
 * 		else:
 * 			values64 = <uint64_t *>c_value
 * 			ret = values64[0]             # <<<<<<<<<<<<<<
 * 	else:
 * 		raise ValueError("Unsupported parameter type")
 */
      __pyx_t_2 = __Pyx_PyInt_From_uint64_t((__pyx_v_values64[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_ret = __pyx_t_2;
      __pyx_t_2 = 0;
    }
    __pyx_L15:;

    /* "brlapi.pyx":208
 * 			values32 = <uint32_t *>c_value
 * 			ret = values32[0]
 * 	elif props.type == PARAM_TYPE_UINT64:             # <<<<<<<<<<<<<<
 * 		if props.isArray:
 * 			values64 = <uint64_t *>c_value
 */
    goto __pyx_L7;
  }

  /* "brlapi.pyx":216
 * 			ret = values64[0]
 * 	else:
 * 		raise ValueError("Unsupported parameter type")             # <<<<<<<<<<<<<<
 * 
 * 	return ret
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __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, 216, __pyx_L1_error)
  }
  __pyx_L7:;

  /* "brlapi.pyx":218
 * 		raise ValueError("Unsupported parameter type")
 * 
 * 	return ret             # <<<<<<<<<<<<<<
 * 
 * class OperationError(Exception):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  /* "brlapi.pyx":171
 * 		}
 * 
 * cdef object _parameterToPython(c_brlapi.brlapi_param_t c_param, const void *c_value, size_t size):             # <<<<<<<<<<<<<<
 * 	cdef const c_brlapi.brlapi_param_properties_t *props
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("brlapi._parameterToPython", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":222
 * class OperationError(Exception):
 * 	"""Error while performing some operation"""
 * 	def __init__(self):             # <<<<<<<<<<<<<<
 * 		cdef char *exception
 * 		exception = c_brlapi.brlapi_protocolException()
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_14OperationError_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6brlapi_14OperationError___init__[] = "OperationError.__init__(self)";
static PyMethodDef __pyx_mdef_6brlapi_14OperationError_1__init__ = {"__init__", (PyCFunction)__pyx_pw_6brlapi_14OperationError_1__init__, METH_O, __pyx_doc_6brlapi_14OperationError___init__};
static PyObject *__pyx_pw_6brlapi_14OperationError_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_14OperationError___init__(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "brlapi.pyx":224
 * 	def __init__(self):
 * 		cdef char *exception
 * 		exception = c_brlapi.brlapi_protocolException()             # <<<<<<<<<<<<<<
 * 		if (exception):
 * 			self.exception = exception
 */
  __pyx_v_exception = brlapi_protocolException();

  /* "brlapi.pyx":225
 * 		cdef char *exception
 * 		exception = c_brlapi.brlapi_protocolException()
 * 		if (exception):             # <<<<<<<<<<<<<<
 * 			self.exception = exception
 * 			c_brlapi.free(exception)
 */
  __pyx_t_1 = (__pyx_v_exception != 0);
  if (__pyx_t_1) {

    /* "brlapi.pyx":226
 * 		exception = c_brlapi.brlapi_protocolException()
 * 		if (exception):
 * 			self.exception = exception             # <<<<<<<<<<<<<<
 * 			c_brlapi.free(exception)
 * 		else:
 */
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_exception, __pyx_t_2) < 0) __PYX_ERR(0, 226, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "brlapi.pyx":227
 * 		if (exception):
 * 			self.exception = exception
 * 			c_brlapi.free(exception)             # <<<<<<<<<<<<<<
 * 		else:
 * 			self.exception = None
 */
    free(__pyx_v_exception);

    /* "brlapi.pyx":225
 * 		cdef char *exception
 * 		exception = c_brlapi.brlapi_protocolException()
 * 		if (exception):             # <<<<<<<<<<<<<<
 * 			self.exception = exception
 * 			c_brlapi.free(exception)
 */
    goto __pyx_L3;
  }

  /* "brlapi.pyx":229
 * 			c_brlapi.free(exception)
 * 		else:
 * 			self.exception = None             # <<<<<<<<<<<<<<
 * 			self.brlerrno = c_brlapi.brlapi_error.brlerrno
 * 			self.libcerrno = c_brlapi.brlapi_error.libcerrno
 */
  /*else*/ {
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_exception, Py_None) < 0) __PYX_ERR(0, 229, __pyx_L1_error)

    /* "brlapi.pyx":230
 * 		else:
 * 			self.exception = None
 * 			self.brlerrno = c_brlapi.brlapi_error.brlerrno             # <<<<<<<<<<<<<<
 * 			self.libcerrno = c_brlapi.brlapi_error.libcerrno
 * 			self.gaierrno = c_brlapi.brlapi_error.gaierrno
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(brlapi_error.brlerrno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_brlerrno, __pyx_t_2) < 0) __PYX_ERR(0, 230, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "brlapi.pyx":231
 * 			self.exception = None
 * 			self.brlerrno = c_brlapi.brlapi_error.brlerrno
 * 			self.libcerrno = c_brlapi.brlapi_error.libcerrno             # <<<<<<<<<<<<<<
 * 			self.gaierrno = c_brlapi.brlapi_error.gaierrno
 * 			if (c_brlapi.brlapi_error.errfun):
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(brlapi_error.libcerrno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_libcerrno, __pyx_t_2) < 0) __PYX_ERR(0, 231, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "brlapi.pyx":232
 * 			self.brlerrno = c_brlapi.brlapi_error.brlerrno
 * 			self.libcerrno = c_brlapi.brlapi_error.libcerrno
 * 			self.gaierrno = c_brlapi.brlapi_error.gaierrno             # <<<<<<<<<<<<<<
 * 			if (c_brlapi.brlapi_error.errfun):
 * 				self.errfun = c_brlapi.brlapi_error.errfun
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(brlapi_error.gaierrno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_gaierrno, __pyx_t_2) < 0) __PYX_ERR(0, 232, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "brlapi.pyx":233
 * 			self.libcerrno = c_brlapi.brlapi_error.libcerrno
 * 			self.gaierrno = c_brlapi.brlapi_error.gaierrno
 * 			if (c_brlapi.brlapi_error.errfun):             # <<<<<<<<<<<<<<
 * 				self.errfun = c_brlapi.brlapi_error.errfun
 * 			else:
 */
    __pyx_t_1 = (brlapi_error.errfun != 0);
    if (__pyx_t_1) {

      /* "brlapi.pyx":234
 * 			self.gaierrno = c_brlapi.brlapi_error.gaierrno
 * 			if (c_brlapi.brlapi_error.errfun):
 * 				self.errfun = c_brlapi.brlapi_error.errfun             # <<<<<<<<<<<<<<
 * 			else:
 * 				self.errfun = b""
 */
      __pyx_t_2 = __Pyx_PyBytes_FromString(brlapi_error.errfun); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_errfun, __pyx_t_2) < 0) __PYX_ERR(0, 234, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "brlapi.pyx":233
 * 			self.libcerrno = c_brlapi.brlapi_error.libcerrno
 * 			self.gaierrno = c_brlapi.brlapi_error.gaierrno
 * 			if (c_brlapi.brlapi_error.errfun):             # <<<<<<<<<<<<<<
 * 				self.errfun = c_brlapi.brlapi_error.errfun
 * 			else:
 */
      goto __pyx_L4;
    }

    /* "brlapi.pyx":236
 * 				self.errfun = c_brlapi.brlapi_error.errfun
 * 			else:
 * 				self.errfun = b""             # <<<<<<<<<<<<<<
 * 
 * 	def __str__(self):
 */
    /*else*/ {
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_errfun, __pyx_kp_b__2) < 0) __PYX_ERR(0, 236, __pyx_L1_error)
    }
    __pyx_L4:;
  }
  __pyx_L3:;

  /* "brlapi.pyx":222
 * class OperationError(Exception):
 * 	"""Error while performing some operation"""
 * 	def __init__(self):             # <<<<<<<<<<<<<<
 * 		cdef char *exception
 * 		exception = c_brlapi.brlapi_protocolException()
 */

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

/* "brlapi.pyx":238
 * 				self.errfun = b""
 * 
 * 	def __str__(self):             # <<<<<<<<<<<<<<
 * 		cdef c_brlapi.brlapi_error_t error
 * 		cdef c_brlapi.size_t size
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_14OperationError_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6brlapi_14OperationError_2__str__[] = "OperationError.__str__(self)";
static PyMethodDef __pyx_mdef_6brlapi_14OperationError_3__str__ = {"__str__", (PyCFunction)__pyx_pw_6brlapi_14OperationError_3__str__, METH_O, __pyx_doc_6brlapi_14OperationError_2__str__};
static PyObject *__pyx_pw_6brlapi_14OperationError_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_14OperationError_2__str__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6brlapi_14OperationError_2__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  brlapi_error_t __pyx_v_error;
  size_t __pyx_v_size;
  char *__pyx_v_buf;
  PyObject *__pyx_v_str = NULL;
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  char *__pyx_t_4;
  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("__str__", 0);

  /* "brlapi.pyx":242
 * 		cdef c_brlapi.size_t size
 * 		cdef char *buf
 * 		if self.exception:             # <<<<<<<<<<<<<<
 * 			return self.exception
 * 		error.brlerrno = self.brlerrno
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 242, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "brlapi.pyx":243
 * 		cdef char *buf
 * 		if self.exception:
 * 			return self.exception             # <<<<<<<<<<<<<<
 * 		error.brlerrno = self.brlerrno
 * 		error.libcerrno = self.libcerrno
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "brlapi.pyx":242
 * 		cdef c_brlapi.size_t size
 * 		cdef char *buf
 * 		if self.exception:             # <<<<<<<<<<<<<<
 * 			return self.exception
 * 		error.brlerrno = self.brlerrno
 */
  }

  /* "brlapi.pyx":244
 * 		if self.exception:
 * 			return self.exception
 * 		error.brlerrno = self.brlerrno             # <<<<<<<<<<<<<<
 * 		error.libcerrno = self.libcerrno
 * 		error.gaierrno = self.gaierrno
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_brlerrno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 244, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_error.brlerrno = __pyx_t_3;

  /* "brlapi.pyx":245
 * 			return self.exception
 * 		error.brlerrno = self.brlerrno
 * 		error.libcerrno = self.libcerrno             # <<<<<<<<<<<<<<
 * 		error.gaierrno = self.gaierrno
 * 		str = self.errfun
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_libcerrno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 245, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_error.libcerrno = __pyx_t_3;

  /* "brlapi.pyx":246
 * 		error.brlerrno = self.brlerrno
 * 		error.libcerrno = self.libcerrno
 * 		error.gaierrno = self.gaierrno             # <<<<<<<<<<<<<<
 * 		str = self.errfun
 * 		error.errfun = str
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_gaierrno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 246, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_error.gaierrno = __pyx_t_3;

  /* "brlapi.pyx":247
 * 		error.libcerrno = self.libcerrno
 * 		error.gaierrno = self.gaierrno
 * 		str = self.errfun             # <<<<<<<<<<<<<<
 * 		error.errfun = str
 * 		size = c_brlapi.brlapi_strerror_r(&error, NULL, 0)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_errfun); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_str = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "brlapi.pyx":248
 * 		error.gaierrno = self.gaierrno
 * 		str = self.errfun
 * 		error.errfun = str             # <<<<<<<<<<<<<<
 * 		size = c_brlapi.brlapi_strerror_r(&error, NULL, 0)
 * 		buf = <char*>c_brlapi.malloc(size+1)
 */
  __pyx_t_4 = __Pyx_PyObject_AsWritableString(__pyx_v_str); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 248, __pyx_L1_error)
  __pyx_v_error.errfun = __pyx_t_4;

  /* "brlapi.pyx":249
 * 		str = self.errfun
 * 		error.errfun = str
 * 		size = c_brlapi.brlapi_strerror_r(&error, NULL, 0)             # <<<<<<<<<<<<<<
 * 		buf = <char*>c_brlapi.malloc(size+1)
 * 		c_brlapi.brlapi_strerror_r(&error, buf, size+1)
 */
  __pyx_v_size = brlapi_strerror_r((&__pyx_v_error), NULL, 0);

  /* "brlapi.pyx":250
 * 		error.errfun = str
 * 		size = c_brlapi.brlapi_strerror_r(&error, NULL, 0)
 * 		buf = <char*>c_brlapi.malloc(size+1)             # <<<<<<<<<<<<<<
 * 		c_brlapi.brlapi_strerror_r(&error, buf, size+1)
 * 		ret = buf.decode("ASCII", errors="replace")
 */
  __pyx_v_buf = ((char *)malloc((__pyx_v_size + 1)));

  /* "brlapi.pyx":251
 * 		size = c_brlapi.brlapi_strerror_r(&error, NULL, 0)
 * 		buf = <char*>c_brlapi.malloc(size+1)
 * 		c_brlapi.brlapi_strerror_r(&error, buf, size+1)             # <<<<<<<<<<<<<<
 * 		ret = buf.decode("ASCII", errors="replace")
 * 		c_brlapi.free(buf)
 */
  (void)(brlapi_strerror_r((&__pyx_v_error), __pyx_v_buf, (__pyx_v_size + 1)));

  /* "brlapi.pyx":252
 * 		buf = <char*>c_brlapi.malloc(size+1)
 * 		c_brlapi.brlapi_strerror_r(&error, buf, size+1)
 * 		ret = buf.decode("ASCII", errors="replace")             # <<<<<<<<<<<<<<
 * 		c_brlapi.free(buf)
 * 		return ret
 */
  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_decode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_errors, __pyx_n_u_replace) < 0) __PYX_ERR(0, 252, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__3, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __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_v_ret = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "brlapi.pyx":253
 * 		c_brlapi.brlapi_strerror_r(&error, buf, size+1)
 * 		ret = buf.decode("ASCII", errors="replace")
 * 		c_brlapi.free(buf)             # <<<<<<<<<<<<<<
 * 		return ret
 * 
 */
  free(__pyx_v_buf);

  /* "brlapi.pyx":254
 * 		ret = buf.decode("ASCII", errors="replace")
 * 		c_brlapi.free(buf)
 * 		return ret             # <<<<<<<<<<<<<<
 * 
 * class ConnectionError(OperationError):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  /* "brlapi.pyx":238
 * 				self.errfun = b""
 * 
 * 	def __str__(self):             # <<<<<<<<<<<<<<
 * 		cdef c_brlapi.brlapi_error_t error
 * 		cdef c_brlapi.size_t size
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("brlapi.OperationError.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_str);
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":259
 * 	"""Error while connecting to BrlTTY"""
 * 
 * 	def __init__(self, host, auth):             # <<<<<<<<<<<<<<
 * 		OperationError.__init__(self)
 * 		self.host = host
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_15ConnectionError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6brlapi_15ConnectionError___init__[] = "ConnectionError.__init__(self, host, auth)";
static PyMethodDef __pyx_mdef_6brlapi_15ConnectionError_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6brlapi_15ConnectionError_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6brlapi_15ConnectionError___init__};
static PyObject *__pyx_pw_6brlapi_15ConnectionError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_host = 0;
  PyObject *__pyx_v_auth = 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_host,&__pyx_n_s_auth,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_host)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 259, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_auth)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 259, __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, 259, __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_host = values[1];
    __pyx_v_auth = 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, 259, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("brlapi.ConnectionError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6brlapi_15ConnectionError___init__(__pyx_self, __pyx_v_self, __pyx_v_host, __pyx_v_auth);

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

static PyObject *__pyx_pf_6brlapi_15ConnectionError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_host, PyObject *__pyx_v_auth) {
  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);

  /* "brlapi.pyx":260
 * 
 * 	def __init__(self, host, auth):
 * 		OperationError.__init__(self)             # <<<<<<<<<<<<<<
 * 		self.host = host
 * 		self.auth = auth
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_OperationError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_self) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "brlapi.pyx":261
 * 	def __init__(self, host, auth):
 * 		OperationError.__init__(self)
 * 		self.host = host             # <<<<<<<<<<<<<<
 * 		self.auth = auth
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_host, __pyx_v_host) < 0) __PYX_ERR(0, 261, __pyx_L1_error)

  /* "brlapi.pyx":262
 * 		OperationError.__init__(self)
 * 		self.host = host
 * 		self.auth = auth             # <<<<<<<<<<<<<<
 * 
 * 	def __str__(self):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_auth, __pyx_v_auth) < 0) __PYX_ERR(0, 262, __pyx_L1_error)

  /* "brlapi.pyx":259
 * 	"""Error while connecting to BrlTTY"""
 * 
 * 	def __init__(self, host, auth):             # <<<<<<<<<<<<<<
 * 		OperationError.__init__(self)
 * 		self.host = host
 */

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

/* "brlapi.pyx":264
 * 		self.auth = auth
 * 
 * 	def __str__(self):             # <<<<<<<<<<<<<<
 * 		msg = "couldn't connect to %s with key %s: %s" % (self.host,self.auth,OperationError.__str__(self))
 * 		msg = msg + "\n(brlerrno %d, libcerrno %d, gaierrno %d)" % (self.brlerrno, self.libcerrno, self.gaierrno)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_15ConnectionError_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6brlapi_15ConnectionError_2__str__[] = "ConnectionError.__str__(self)";
static PyMethodDef __pyx_mdef_6brlapi_15ConnectionError_3__str__ = {"__str__", (PyCFunction)__pyx_pw_6brlapi_15ConnectionError_3__str__, METH_O, __pyx_doc_6brlapi_15ConnectionError_2__str__};
static PyObject *__pyx_pw_6brlapi_15ConnectionError_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_15ConnectionError_2__str__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6brlapi_15ConnectionError_2__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_msg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  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_RefNannySetupContext("__str__", 0);

  /* "brlapi.pyx":265
 * 
 * 	def __str__(self):
 * 		msg = "couldn't connect to %s with key %s: %s" % (self.host,self.auth,OperationError.__str__(self))             # <<<<<<<<<<<<<<
 * 		msg = msg + "\n(brlerrno %d, libcerrno %d, gaierrno %d)" % (self.brlerrno, self.libcerrno, self.gaierrno)
 * 		if self.brlerrno == ERROR_CONNREFUSED:
 */
  __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u_couldn_t_connect_to);
  __pyx_t_2 += 20;
  __Pyx_GIVEREF(__pyx_kp_u_couldn_t_connect_to);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_couldn_t_connect_to);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_host); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u_with_key);
  __pyx_t_2 += 10;
  __Pyx_GIVEREF(__pyx_kp_u_with_key);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_with_key);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_auth); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __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__4);
  __pyx_t_2 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__4);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__4);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_OperationError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_str); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_self) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_self);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_1, 6, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_msg = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "brlapi.pyx":266
 * 	def __str__(self):
 * 		msg = "couldn't connect to %s with key %s: %s" % (self.host,self.auth,OperationError.__str__(self))
 * 		msg = msg + "\n(brlerrno %d, libcerrno %d, gaierrno %d)" % (self.brlerrno, self.libcerrno, self.gaierrno)             # <<<<<<<<<<<<<<
 * 		if self.brlerrno == ERROR_CONNREFUSED:
 * 			msg = msg + "\nBRLTTY is too busy..."
 */
  __pyx_t_6 = PyTuple_New(7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u_brlerrno_2);
  __pyx_t_2 += 11;
  __Pyx_GIVEREF(__pyx_kp_u_brlerrno_2);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u_brlerrno_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_brlerrno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_IntOrLong(__pyx_t_1), __pyx_n_u_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_libcerrno_2);
  __pyx_t_2 += 12;
  __Pyx_GIVEREF(__pyx_kp_u_libcerrno_2);
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u_libcerrno_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_libcerrno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_IntOrLong(__pyx_t_4), __pyx_n_u_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u_gaierrno_2);
  __pyx_t_2 += 11;
  __Pyx_GIVEREF(__pyx_kp_u_gaierrno_2);
  PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_kp_u_gaierrno_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_gaierrno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_IntOrLong(__pyx_t_1), __pyx_n_u_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__5);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__5);
  PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_kp_u__5);
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_6, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_v_msg, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_6));
  __pyx_t_6 = 0;

  /* "brlapi.pyx":267
 * 		msg = "couldn't connect to %s with key %s: %s" % (self.host,self.auth,OperationError.__str__(self))
 * 		msg = msg + "\n(brlerrno %d, libcerrno %d, gaierrno %d)" % (self.brlerrno, self.libcerrno, self.gaierrno)
 * 		if self.brlerrno == ERROR_CONNREFUSED:             # <<<<<<<<<<<<<<
 * 			msg = msg + "\nBRLTTY is too busy..."
 * 		elif self.brlerrno == ERROR_AUTHENTICATION:
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_brlerrno); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ERROR_CONNREFUSED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 267, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_7) {

    /* "brlapi.pyx":268
 * 		msg = msg + "\n(brlerrno %d, libcerrno %d, gaierrno %d)" % (self.brlerrno, self.libcerrno, self.gaierrno)
 * 		if self.brlerrno == ERROR_CONNREFUSED:
 * 			msg = msg + "\nBRLTTY is too busy..."             # <<<<<<<<<<<<<<
 * 		elif self.brlerrno == ERROR_AUTHENTICATION:
 * 			msg = msg + "\nAuthentication failed. Please check you can read %s and it is not empty." % self.auth
 */
    __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_v_msg, __pyx_kp_u_BRLTTY_is_too_busy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "brlapi.pyx":267
 * 		msg = "couldn't connect to %s with key %s: %s" % (self.host,self.auth,OperationError.__str__(self))
 * 		msg = msg + "\n(brlerrno %d, libcerrno %d, gaierrno %d)" % (self.brlerrno, self.libcerrno, self.gaierrno)
 * 		if self.brlerrno == ERROR_CONNREFUSED:             # <<<<<<<<<<<<<<
 * 			msg = msg + "\nBRLTTY is too busy..."
 * 		elif self.brlerrno == ERROR_AUTHENTICATION:
 */
    goto __pyx_L3;
  }

  /* "brlapi.pyx":269
 * 		if self.brlerrno == ERROR_CONNREFUSED:
 * 			msg = msg + "\nBRLTTY is too busy..."
 * 		elif self.brlerrno == ERROR_AUTHENTICATION:             # <<<<<<<<<<<<<<
 * 			msg = msg + "\nAuthentication failed. Please check you can read %s and it is not empty." % self.auth
 * 		elif self.brlerrno == ERROR_LIBCERR and (self.libcerrno == errno.ECONNREFUSED or self.libcerrno == errno.ENOENT):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_brlerrno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ERROR_AUTHENTICATION); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 269, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 269, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_7) {

    /* "brlapi.pyx":270
 * 			msg = msg + "\nBRLTTY is too busy..."
 * 		elif self.brlerrno == ERROR_AUTHENTICATION:
 * 			msg = msg + "\nAuthentication failed. Please check you can read %s and it is not empty." % self.auth             # <<<<<<<<<<<<<<
 * 		elif self.brlerrno == ERROR_LIBCERR and (self.libcerrno == errno.ECONNREFUSED or self.libcerrno == errno.ENOENT):
 * 			msg = msg + "\nIs BRLTTY really running?"
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_auth); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Authentication_failed_Please_ch, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_v_msg, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "brlapi.pyx":269
 * 		if self.brlerrno == ERROR_CONNREFUSED:
 * 			msg = msg + "\nBRLTTY is too busy..."
 * 		elif self.brlerrno == ERROR_AUTHENTICATION:             # <<<<<<<<<<<<<<
 * 			msg = msg + "\nAuthentication failed. Please check you can read %s and it is not empty." % self.auth
 * 		elif self.brlerrno == ERROR_LIBCERR and (self.libcerrno == errno.ECONNREFUSED or self.libcerrno == errno.ENOENT):
 */
    goto __pyx_L3;
  }

  /* "brlapi.pyx":271
 * 		elif self.brlerrno == ERROR_AUTHENTICATION:
 * 			msg = msg + "\nAuthentication failed. Please check you can read %s and it is not empty." % self.auth
 * 		elif self.brlerrno == ERROR_LIBCERR and (self.libcerrno == errno.ECONNREFUSED or self.libcerrno == errno.ENOENT):             # <<<<<<<<<<<<<<
 * 			msg = msg + "\nIs BRLTTY really running?"
 * 		return msg
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_brlerrno); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ERROR_LIBCERR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_8) {
  } else {
    __pyx_t_7 = __pyx_t_8;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_libcerrno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_errno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ECONNREFUSED); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!__pyx_t_8) {
  } else {
    __pyx_t_7 = __pyx_t_8;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_libcerrno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_errno); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ENOENT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_7 = __pyx_t_8;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_7) {

    /* "brlapi.pyx":272
 * 			msg = msg + "\nAuthentication failed. Please check you can read %s and it is not empty." % self.auth
 * 		elif self.brlerrno == ERROR_LIBCERR and (self.libcerrno == errno.ECONNREFUSED or self.libcerrno == errno.ENOENT):
 * 			msg = msg + "\nIs BRLTTY really running?"             # <<<<<<<<<<<<<<
 * 		return msg
 * 
 */
    __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_v_msg, __pyx_kp_u_Is_BRLTTY_really_running); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "brlapi.pyx":271
 * 		elif self.brlerrno == ERROR_AUTHENTICATION:
 * 			msg = msg + "\nAuthentication failed. Please check you can read %s and it is not empty." % self.auth
 * 		elif self.brlerrno == ERROR_LIBCERR and (self.libcerrno == errno.ECONNREFUSED or self.libcerrno == errno.ENOENT):             # <<<<<<<<<<<<<<
 * 			msg = msg + "\nIs BRLTTY really running?"
 * 		return msg
 */
  }
  __pyx_L3:;

  /* "brlapi.pyx":273
 * 		elif self.brlerrno == ERROR_LIBCERR and (self.libcerrno == errno.ECONNREFUSED or self.libcerrno == errno.ENOENT):
 * 			msg = msg + "\nIs BRLTTY really running?"
 * 		return msg             # <<<<<<<<<<<<<<
 * 
 * 	def host(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_msg);
  __pyx_r = __pyx_v_msg;
  goto __pyx_L0;

  /* "brlapi.pyx":264
 * 		self.auth = auth
 * 
 * 	def __str__(self):             # <<<<<<<<<<<<<<
 * 		msg = "couldn't connect to %s with key %s: %s" % (self.host,self.auth,OperationError.__str__(self))
 * 		msg = msg + "\n(brlerrno %d, libcerrno %d, gaierrno %d)" % (self.brlerrno, self.libcerrno, self.gaierrno)
 */

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

/* "brlapi.pyx":275
 * 		return msg
 * 
 * 	def host(self):             # <<<<<<<<<<<<<<
 * 		"""Host of BRLTTY server"""
 * 		return self.settings.host
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_15ConnectionError_5host(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6brlapi_15ConnectionError_4host[] = "ConnectionError.host(self)\nHost of BRLTTY server";
static PyMethodDef __pyx_mdef_6brlapi_15ConnectionError_5host = {"host", (PyCFunction)__pyx_pw_6brlapi_15ConnectionError_5host, METH_O, __pyx_doc_6brlapi_15ConnectionError_4host};
static PyObject *__pyx_pw_6brlapi_15ConnectionError_5host(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("host (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_15ConnectionError_4host(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "brlapi.pyx":277
 * 	def host(self):
 * 		"""Host of BRLTTY server"""
 * 		return self.settings.host             # <<<<<<<<<<<<<<
 * 
 * 	def auth(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_host); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "brlapi.pyx":275
 * 		return msg
 * 
 * 	def host(self):             # <<<<<<<<<<<<<<
 * 		"""Host of BRLTTY server"""
 * 		return self.settings.host
 */

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

/* "brlapi.pyx":279
 * 		return self.settings.host
 * 
 * 	def auth(self):             # <<<<<<<<<<<<<<
 * 		"""Authentication method used"""
 * 		return self.settings.auth
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_15ConnectionError_7auth(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6brlapi_15ConnectionError_6auth[] = "ConnectionError.auth(self)\nAuthentication method used";
static PyMethodDef __pyx_mdef_6brlapi_15ConnectionError_7auth = {"auth", (PyCFunction)__pyx_pw_6brlapi_15ConnectionError_7auth, METH_O, __pyx_doc_6brlapi_15ConnectionError_6auth};
static PyObject *__pyx_pw_6brlapi_15ConnectionError_7auth(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("auth (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_15ConnectionError_6auth(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "brlapi.pyx":281
 * 	def auth(self):
 * 		"""Authentication method used"""
 * 		return self.settings.auth             # <<<<<<<<<<<<<<
 * 
 * cdef class WriteStruct:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_auth); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "brlapi.pyx":279
 * 		return self.settings.host
 * 
 * 	def auth(self):             # <<<<<<<<<<<<<<
 * 		"""Authentication method used"""
 * 		return self.settings.auth
 */

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

/* "brlapi.pyx":290
 * 	cdef c_brlapi.brlapi_writeArguments_t props
 * 
 * 	def __init__(self):             # <<<<<<<<<<<<<<
 * 		self.props = c_brlapi.brlapi_writeArguments_initialized
 * 
 */

/* Python wrapper */
static int __pyx_pw_6brlapi_11WriteStruct_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6brlapi_11WriteStruct_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_6brlapi_11WriteStruct___init__(((struct __pyx_obj_6brlapi_WriteStruct *)__pyx_v_self));

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

static int __pyx_pf_6brlapi_11WriteStruct___init__(struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "brlapi.pyx":291
 * 
 * 	def __init__(self):
 * 		self.props = c_brlapi.brlapi_writeArguments_initialized             # <<<<<<<<<<<<<<
 * 
 * 	property displayNumber:
 */
  __pyx_v_self->props = brlapi_writeArguments_initialized;

  /* "brlapi.pyx":290
 * 	cdef c_brlapi.brlapi_writeArguments_t props
 * 
 * 	def __init__(self):             # <<<<<<<<<<<<<<
 * 		self.props = c_brlapi.brlapi_writeArguments_initialized
 * 
 */

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

/* "brlapi.pyx":295
 * 	property displayNumber:
 * 		"""Display number DISPLAY_DEFAULT == unspecified"""
 * 		def __get__(self):             # <<<<<<<<<<<<<<
 * 			return self.props.displayNumber
 * 		def __set__(self, val):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_11WriteStruct_13displayNumber_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6brlapi_11WriteStruct_13displayNumber_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_11WriteStruct_13displayNumber___get__(((struct __pyx_obj_6brlapi_WriteStruct *)__pyx_v_self));

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

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

  /* "brlapi.pyx":296
 * 		"""Display number DISPLAY_DEFAULT == unspecified"""
 * 		def __get__(self):
 * 			return self.props.displayNumber             # <<<<<<<<<<<<<<
 * 		def __set__(self, val):
 * 			self.props.displayNumber = val
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->props.displayNumber); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "brlapi.pyx":295
 * 	property displayNumber:
 * 		"""Display number DISPLAY_DEFAULT == unspecified"""
 * 		def __get__(self):             # <<<<<<<<<<<<<<
 * 			return self.props.displayNumber
 * 		def __set__(self, val):
 */

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

/* "brlapi.pyx":297
 * 		def __get__(self):
 * 			return self.props.displayNumber
 * 		def __set__(self, val):             # <<<<<<<<<<<<<<
 * 			self.props.displayNumber = val
 * 
 */

/* Python wrapper */
static int __pyx_pw_6brlapi_11WriteStruct_13displayNumber_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
static int __pyx_pw_6brlapi_11WriteStruct_13displayNumber_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_11WriteStruct_13displayNumber_2__set__(((struct __pyx_obj_6brlapi_WriteStruct *)__pyx_v_self), ((PyObject *)__pyx_v_val));

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

static int __pyx_pf_6brlapi_11WriteStruct_13displayNumber_2__set__(struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_self, PyObject *__pyx_v_val) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "brlapi.pyx":298
 * 			return self.props.displayNumber
 * 		def __set__(self, val):
 * 			self.props.displayNumber = val             # <<<<<<<<<<<<<<
 * 
 * 	property regionBegin:
 */
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 298, __pyx_L1_error)
  __pyx_v_self->props.displayNumber = __pyx_t_1;

  /* "brlapi.pyx":297
 * 		def __get__(self):
 * 			return self.props.displayNumber
 * 		def __set__(self, val):             # <<<<<<<<<<<<<<
 * 			self.props.displayNumber = val
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("brlapi.WriteStruct.displayNumber.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":302
 * 	property regionBegin:
 * 		"""Region of display to update, 1st character of display is 1"""
 * 		def __get__(self):             # <<<<<<<<<<<<<<
 * 			return self.props.regionBegin
 * 		def __set__(self, val):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_11WriteStruct_11regionBegin_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6brlapi_11WriteStruct_11regionBegin_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_11WriteStruct_11regionBegin___get__(((struct __pyx_obj_6brlapi_WriteStruct *)__pyx_v_self));

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

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

  /* "brlapi.pyx":303
 * 		"""Region of display to update, 1st character of display is 1"""
 * 		def __get__(self):
 * 			return self.props.regionBegin             # <<<<<<<<<<<<<<
 * 		def __set__(self, val):
 * 			self.props.regionBegin = val
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->props.regionBegin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "brlapi.pyx":302
 * 	property regionBegin:
 * 		"""Region of display to update, 1st character of display is 1"""
 * 		def __get__(self):             # <<<<<<<<<<<<<<
 * 			return self.props.regionBegin
 * 		def __set__(self, val):
 */

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

/* "brlapi.pyx":304
 * 		def __get__(self):
 * 			return self.props.regionBegin
 * 		def __set__(self, val):             # <<<<<<<<<<<<<<
 * 			self.props.regionBegin = val
 * 
 */

/* Python wrapper */
static int __pyx_pw_6brlapi_11WriteStruct_11regionBegin_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
static int __pyx_pw_6brlapi_11WriteStruct_11regionBegin_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_11WriteStruct_11regionBegin_2__set__(((struct __pyx_obj_6brlapi_WriteStruct *)__pyx_v_self), ((PyObject *)__pyx_v_val));

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

static int __pyx_pf_6brlapi_11WriteStruct_11regionBegin_2__set__(struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_self, PyObject *__pyx_v_val) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "brlapi.pyx":305
 * 			return self.props.regionBegin
 * 		def __set__(self, val):
 * 			self.props.regionBegin = val             # <<<<<<<<<<<<<<
 * 
 * 	property regionSize:
 */
  __pyx_t_1 = __Pyx_PyInt_As_unsigned_int(__pyx_v_val); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 305, __pyx_L1_error)
  __pyx_v_self->props.regionBegin = __pyx_t_1;

  /* "brlapi.pyx":304
 * 		def __get__(self):
 * 			return self.props.regionBegin
 * 		def __set__(self, val):             # <<<<<<<<<<<<<<
 * 			self.props.regionBegin = val
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("brlapi.WriteStruct.regionBegin.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":309
 * 	property regionSize:
 * 		"""Number of characters held in text, attrAnd and attrOr. For multibytes text, this is the number of multibyte characters. Combining and double-width characters count for 1"""
 * 		def __get__(self):             # <<<<<<<<<<<<<<
 * 			return self.props.regionSize
 * 		def __set__(self, val):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_11WriteStruct_10regionSize_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6brlapi_11WriteStruct_10regionSize_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_11WriteStruct_10regionSize___get__(((struct __pyx_obj_6brlapi_WriteStruct *)__pyx_v_self));

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

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

  /* "brlapi.pyx":310
 * 		"""Number of characters held in text, attrAnd and attrOr. For multibytes text, this is the number of multibyte characters. Combining and double-width characters count for 1"""
 * 		def __get__(self):
 * 			return self.props.regionSize             # <<<<<<<<<<<<<<
 * 		def __set__(self, val):
 * 			self.props.regionSize = val
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->props.regionSize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "brlapi.pyx":309
 * 	property regionSize:
 * 		"""Number of characters held in text, attrAnd and attrOr. For multibytes text, this is the number of multibyte characters. Combining and double-width characters count for 1"""
 * 		def __get__(self):             # <<<<<<<<<<<<<<
 * 			return self.props.regionSize
 * 		def __set__(self, val):
 */

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

/* "brlapi.pyx":311
 * 		def __get__(self):
 * 			return self.props.regionSize
 * 		def __set__(self, val):             # <<<<<<<<<<<<<<
 * 			self.props.regionSize = val
 * 
 */

/* Python wrapper */
static int __pyx_pw_6brlapi_11WriteStruct_10regionSize_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
static int __pyx_pw_6brlapi_11WriteStruct_10regionSize_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_11WriteStruct_10regionSize_2__set__(((struct __pyx_obj_6brlapi_WriteStruct *)__pyx_v_self), ((PyObject *)__pyx_v_val));

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

static int __pyx_pf_6brlapi_11WriteStruct_10regionSize_2__set__(struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_self, PyObject *__pyx_v_val) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "brlapi.pyx":312
 * 			return self.props.regionSize
 * 		def __set__(self, val):
 * 			self.props.regionSize = val             # <<<<<<<<<<<<<<
 * 
 * 	property text:
 */
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error)
  __pyx_v_self->props.regionSize = __pyx_t_1;

  /* "brlapi.pyx":311
 * 		def __get__(self):
 * 			return self.props.regionSize
 * 		def __set__(self, val):             # <<<<<<<<<<<<<<
 * 			self.props.regionSize = val
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("brlapi.WriteStruct.regionSize.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":316
 * 	property text:
 * 		"""Text to display"""
 * 		def __get__(self):             # <<<<<<<<<<<<<<
 * 			if (not self.props.text):
 * 				return None
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_11WriteStruct_4text_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6brlapi_11WriteStruct_4text_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_11WriteStruct_4text___get__(((struct __pyx_obj_6brlapi_WriteStruct *)__pyx_v_self));

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

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

  /* "brlapi.pyx":317
 * 		"""Text to display"""
 * 		def __get__(self):
 * 			if (not self.props.text):             # <<<<<<<<<<<<<<
 * 				return None
 * 			else:
 */
  __pyx_t_1 = ((!(__pyx_v_self->props.text != 0)) != 0);
  if (__pyx_t_1) {

    /* "brlapi.pyx":318
 * 		def __get__(self):
 * 			if (not self.props.text):
 * 				return None             # <<<<<<<<<<<<<<
 * 			else:
 * 				return self.props.text
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "brlapi.pyx":317
 * 		"""Text to display"""
 * 		def __get__(self):
 * 			if (not self.props.text):             # <<<<<<<<<<<<<<
 * 				return None
 * 			else:
 */
  }

  /* "brlapi.pyx":320
 * 				return None
 * 			else:
 * 				return self.props.text             # <<<<<<<<<<<<<<
 * 		def __set__(self, val):
 * 			cdef c_brlapi.size_t size
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->props.text); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 320, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "brlapi.pyx":316
 * 	property text:
 * 		"""Text to display"""
 * 		def __get__(self):             # <<<<<<<<<<<<<<
 * 			if (not self.props.text):
 * 				return None
 */

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

/* "brlapi.pyx":321
 * 			else:
 * 				return self.props.text
 * 		def __set__(self, val):             # <<<<<<<<<<<<<<
 * 			cdef c_brlapi.size_t size
 * 			cdef char *c_val
 */

/* Python wrapper */
static int __pyx_pw_6brlapi_11WriteStruct_4text_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
static int __pyx_pw_6brlapi_11WriteStruct_4text_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_11WriteStruct_4text_2__set__(((struct __pyx_obj_6brlapi_WriteStruct *)__pyx_v_self), ((PyObject *)__pyx_v_val));

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

static int __pyx_pf_6brlapi_11WriteStruct_4text_2__set__(struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_self, PyObject *__pyx_v_val) {
  size_t __pyx_v_size;
  char *__pyx_v_c_val;
  char *__pyx_v_text;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  char *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_val);

  /* "brlapi.pyx":325
 * 			cdef char *c_val
 * 			cdef char *text
 * 			if (type(val) == unicode):             # <<<<<<<<<<<<<<
 * 				val = val.encode('UTF-8')
 * 				self.charset = 'UTF-8'.encode("ASCII")
 */
  __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_val)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 325, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "brlapi.pyx":326
 * 			cdef char *text
 * 			if (type(val) == unicode):
 * 				val = val.encode('UTF-8')             # <<<<<<<<<<<<<<
 * 				self.charset = 'UTF-8'.encode("ASCII")
 * 			if (self.props.text):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 326, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_UTF_8) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_UTF_8);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "brlapi.pyx":327
 * 			if (type(val) == unicode):
 * 				val = val.encode('UTF-8')
 * 				self.charset = 'UTF-8'.encode("ASCII")             # <<<<<<<<<<<<<<
 * 			if (self.props.text):
 * 				c_brlapi.free(<char*>self.props.text)
 */
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_charset, __pyx_kp_b_UTF_8) < 0) __PYX_ERR(0, 327, __pyx_L1_error)

    /* "brlapi.pyx":325
 * 			cdef char *c_val
 * 			cdef char *text
 * 			if (type(val) == unicode):             # <<<<<<<<<<<<<<
 * 				val = val.encode('UTF-8')
 * 				self.charset = 'UTF-8'.encode("ASCII")
 */
  }

  /* "brlapi.pyx":328
 * 				val = val.encode('UTF-8')
 * 				self.charset = 'UTF-8'.encode("ASCII")
 * 			if (self.props.text):             # <<<<<<<<<<<<<<
 * 				c_brlapi.free(<char*>self.props.text)
 * 			if (val):
 */
  __pyx_t_2 = (__pyx_v_self->props.text != 0);
  if (__pyx_t_2) {

    /* "brlapi.pyx":329
 * 				self.charset = 'UTF-8'.encode("ASCII")
 * 			if (self.props.text):
 * 				c_brlapi.free(<char*>self.props.text)             # <<<<<<<<<<<<<<
 * 			if (val):
 * 				size = len(val)
 */
    free(((char *)__pyx_v_self->props.text));

    /* "brlapi.pyx":328
 * 				val = val.encode('UTF-8')
 * 				self.charset = 'UTF-8'.encode("ASCII")
 * 			if (self.props.text):             # <<<<<<<<<<<<<<
 * 				c_brlapi.free(<char*>self.props.text)
 * 			if (val):
 */
  }

  /* "brlapi.pyx":330
 * 			if (self.props.text):
 * 				c_brlapi.free(<char*>self.props.text)
 * 			if (val):             # <<<<<<<<<<<<<<
 * 				size = len(val)
 * 				c_val = val
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_val); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 330, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "brlapi.pyx":331
 * 				c_brlapi.free(<char*>self.props.text)
 * 			if (val):
 * 				size = len(val)             # <<<<<<<<<<<<<<
 * 				c_val = val
 * 				text = <char*>c_brlapi.malloc(size+1)
 */
    __pyx_t_5 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 331, __pyx_L1_error)
    __pyx_v_size = __pyx_t_5;

    /* "brlapi.pyx":332
 * 			if (val):
 * 				size = len(val)
 * 				c_val = val             # <<<<<<<<<<<<<<
 * 				text = <char*>c_brlapi.malloc(size+1)
 * 				c_brlapi.memcpy(<void*>text,<void*>c_val,size)
 */
    __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_val); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 332, __pyx_L1_error)
    __pyx_v_c_val = __pyx_t_6;

    /* "brlapi.pyx":333
 * 				size = len(val)
 * 				c_val = val
 * 				text = <char*>c_brlapi.malloc(size+1)             # <<<<<<<<<<<<<<
 * 				c_brlapi.memcpy(<void*>text,<void*>c_val,size)
 * 				text[size] = 0
 */
    __pyx_v_text = ((char *)malloc((__pyx_v_size + 1)));

    /* "brlapi.pyx":334
 * 				c_val = val
 * 				text = <char*>c_brlapi.malloc(size+1)
 * 				c_brlapi.memcpy(<void*>text,<void*>c_val,size)             # <<<<<<<<<<<<<<
 * 				text[size] = 0
 * 				self.props.text = text
 */
    (void)(memcpy(((void *)__pyx_v_text), ((void *)__pyx_v_c_val), __pyx_v_size));

    /* "brlapi.pyx":335
 * 				text = <char*>c_brlapi.malloc(size+1)
 * 				c_brlapi.memcpy(<void*>text,<void*>c_val,size)
 * 				text[size] = 0             # <<<<<<<<<<<<<<
 * 				self.props.text = text
 * 				self.props.textSize = size
 */
    (__pyx_v_text[__pyx_v_size]) = 0;

    /* "brlapi.pyx":336
 * 				c_brlapi.memcpy(<void*>text,<void*>c_val,size)
 * 				text[size] = 0
 * 				self.props.text = text             # <<<<<<<<<<<<<<
 * 				self.props.textSize = size
 * 			else:
 */
    __pyx_v_self->props.text = __pyx_v_text;

    /* "brlapi.pyx":337
 * 				text[size] = 0
 * 				self.props.text = text
 * 				self.props.textSize = size             # <<<<<<<<<<<<<<
 * 			else:
 * 				self.props.text = NULL
 */
    __pyx_v_self->props.textSize = __pyx_v_size;

    /* "brlapi.pyx":330
 * 			if (self.props.text):
 * 				c_brlapi.free(<char*>self.props.text)
 * 			if (val):             # <<<<<<<<<<<<<<
 * 				size = len(val)
 * 				c_val = val
 */
    goto __pyx_L5;
  }

  /* "brlapi.pyx":339
 * 				self.props.textSize = size
 * 			else:
 * 				self.props.text = NULL             # <<<<<<<<<<<<<<
 * 
 * 	property cursor:
 */
  /*else*/ {
    __pyx_v_self->props.text = NULL;
  }
  __pyx_L5:;

  /* "brlapi.pyx":321
 * 			else:
 * 				return self.props.text
 * 		def __set__(self, val):             # <<<<<<<<<<<<<<
 * 			cdef c_brlapi.size_t size
 * 			cdef char *c_val
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("brlapi.WriteStruct.text.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":343
 * 	property cursor:
 * 		"""CURSOR_LEAVE == don't touch, CURSOR_OFF == turn off, 1 = 1st char of display, ..."""
 * 		def __get__(self):             # <<<<<<<<<<<<<<
 * 			return self.props.cursor
 * 		def __set__(self, val):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_11WriteStruct_6cursor_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6brlapi_11WriteStruct_6cursor_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_11WriteStruct_6cursor___get__(((struct __pyx_obj_6brlapi_WriteStruct *)__pyx_v_self));

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

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

  /* "brlapi.pyx":344
 * 		"""CURSOR_LEAVE == don't touch, CURSOR_OFF == turn off, 1 = 1st char of display, ..."""
 * 		def __get__(self):
 * 			return self.props.cursor             # <<<<<<<<<<<<<<
 * 		def __set__(self, val):
 * 			self.props.cursor = val
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->props.cursor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "brlapi.pyx":343
 * 	property cursor:
 * 		"""CURSOR_LEAVE == don't touch, CURSOR_OFF == turn off, 1 = 1st char of display, ..."""
 * 		def __get__(self):             # <<<<<<<<<<<<<<
 * 			return self.props.cursor
 * 		def __set__(self, val):
 */

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

/* "brlapi.pyx":345
 * 		def __get__(self):
 * 			return self.props.cursor
 * 		def __set__(self, val):             # <<<<<<<<<<<<<<
 * 			self.props.cursor = val
 * 
 */

/* Python wrapper */
static int __pyx_pw_6brlapi_11WriteStruct_6cursor_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
static int __pyx_pw_6brlapi_11WriteStruct_6cursor_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_11WriteStruct_6cursor_2__set__(((struct __pyx_obj_6brlapi_WriteStruct *)__pyx_v_self), ((PyObject *)__pyx_v_val));

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

static int __pyx_pf_6brlapi_11WriteStruct_6cursor_2__set__(struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_self, PyObject *__pyx_v_val) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "brlapi.pyx":346
 * 			return self.props.cursor
 * 		def __set__(self, val):
 * 			self.props.cursor = val             # <<<<<<<<<<<<<<
 * 
 * 	property charset:
 */
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 346, __pyx_L1_error)
  __pyx_v_self->props.cursor = __pyx_t_1;

  /* "brlapi.pyx":345
 * 		def __get__(self):
 * 			return self.props.cursor
 * 		def __set__(self, val):             # <<<<<<<<<<<<<<
 * 			self.props.cursor = val
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("brlapi.WriteStruct.cursor.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":350
 * 	property charset:
 * 		"""Character set of the text"""
 * 		def __get__(self):             # <<<<<<<<<<<<<<
 * 			if (not self.props.charset):
 * 				return None
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_11WriteStruct_7charset_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6brlapi_11WriteStruct_7charset_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_11WriteStruct_7charset___get__(((struct __pyx_obj_6brlapi_WriteStruct *)__pyx_v_self));

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

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

  /* "brlapi.pyx":351
 * 		"""Character set of the text"""
 * 		def __get__(self):
 * 			if (not self.props.charset):             # <<<<<<<<<<<<<<
 * 				return None
 * 			else:
 */
  __pyx_t_1 = ((!(__pyx_v_self->props.charset != 0)) != 0);
  if (__pyx_t_1) {

    /* "brlapi.pyx":352
 * 		def __get__(self):
 * 			if (not self.props.charset):
 * 				return None             # <<<<<<<<<<<<<<
 * 			else:
 * 				return self.props.charset
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "brlapi.pyx":351
 * 		"""Character set of the text"""
 * 		def __get__(self):
 * 			if (not self.props.charset):             # <<<<<<<<<<<<<<
 * 				return None
 * 			else:
 */
  }

  /* "brlapi.pyx":354
 * 				return None
 * 			else:
 * 				return self.props.charset             # <<<<<<<<<<<<<<
 * 		def __set__(self, val):
 * 			cdef c_brlapi.size_t size
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->props.charset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "brlapi.pyx":350
 * 	property charset:
 * 		"""Character set of the text"""
 * 		def __get__(self):             # <<<<<<<<<<<<<<
 * 			if (not self.props.charset):
 * 				return None
 */

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

/* "brlapi.pyx":355
 * 			else:
 * 				return self.props.charset
 * 		def __set__(self, val):             # <<<<<<<<<<<<<<
 * 			cdef c_brlapi.size_t size
 * 			cdef char *c_val
 */

/* Python wrapper */
static int __pyx_pw_6brlapi_11WriteStruct_7charset_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
static int __pyx_pw_6brlapi_11WriteStruct_7charset_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_11WriteStruct_7charset_2__set__(((struct __pyx_obj_6brlapi_WriteStruct *)__pyx_v_self), ((PyObject *)__pyx_v_val));

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

static int __pyx_pf_6brlapi_11WriteStruct_7charset_2__set__(struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_self, PyObject *__pyx_v_val) {
  size_t __pyx_v_size;
  char *__pyx_v_c_val;
  char *__pyx_v_charset;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  char *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_val);

  /* "brlapi.pyx":359
 * 			cdef char *c_val
 * 			cdef char *charset
 * 			if (self.props.charset):             # <<<<<<<<<<<<<<
 * 				c_brlapi.free(<char*>self.props.charset)
 * 			if (val):
 */
  __pyx_t_1 = (__pyx_v_self->props.charset != 0);
  if (__pyx_t_1) {

    /* "brlapi.pyx":360
 * 			cdef char *charset
 * 			if (self.props.charset):
 * 				c_brlapi.free(<char*>self.props.charset)             # <<<<<<<<<<<<<<
 * 			if (val):
 * 				if (type(val) == unicode):
 */
    free(((char *)__pyx_v_self->props.charset));

    /* "brlapi.pyx":359
 * 			cdef char *c_val
 * 			cdef char *charset
 * 			if (self.props.charset):             # <<<<<<<<<<<<<<
 * 				c_brlapi.free(<char*>self.props.charset)
 * 			if (val):
 */
  }

  /* "brlapi.pyx":361
 * 			if (self.props.charset):
 * 				c_brlapi.free(<char*>self.props.charset)
 * 			if (val):             # <<<<<<<<<<<<<<
 * 				if (type(val) == unicode):
 * 					val = val.encode('ASCII')
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_val); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 361, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "brlapi.pyx":362
 * 				c_brlapi.free(<char*>self.props.charset)
 * 			if (val):
 * 				if (type(val) == unicode):             # <<<<<<<<<<<<<<
 * 					val = val.encode('ASCII')
 * 				size = len(val)
 */
    __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_val)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 362, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "brlapi.pyx":363
 * 			if (val):
 * 				if (type(val) == unicode):
 * 					val = val.encode('ASCII')             # <<<<<<<<<<<<<<
 * 				size = len(val)
 * 				c_val = val
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 363, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_n_u_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_n_u_ASCII);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "brlapi.pyx":362
 * 				c_brlapi.free(<char*>self.props.charset)
 * 			if (val):
 * 				if (type(val) == unicode):             # <<<<<<<<<<<<<<
 * 					val = val.encode('ASCII')
 * 				size = len(val)
 */
    }

    /* "brlapi.pyx":364
 * 				if (type(val) == unicode):
 * 					val = val.encode('ASCII')
 * 				size = len(val)             # <<<<<<<<<<<<<<
 * 				c_val = val
 * 				charset = <char*>c_brlapi.malloc(size+1)
 */
    __pyx_t_5 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 364, __pyx_L1_error)
    __pyx_v_size = __pyx_t_5;

    /* "brlapi.pyx":365
 * 					val = val.encode('ASCII')
 * 				size = len(val)
 * 				c_val = val             # <<<<<<<<<<<<<<
 * 				charset = <char*>c_brlapi.malloc(size+1)
 * 				c_brlapi.memcpy(<void*>charset,<void*>c_val,size)
 */
    __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_val); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 365, __pyx_L1_error)
    __pyx_v_c_val = __pyx_t_6;

    /* "brlapi.pyx":366
 * 				size = len(val)
 * 				c_val = val
 * 				charset = <char*>c_brlapi.malloc(size+1)             # <<<<<<<<<<<<<<
 * 				c_brlapi.memcpy(<void*>charset,<void*>c_val,size)
 * 				charset[size] = 0
 */
    __pyx_v_charset = ((char *)malloc((__pyx_v_size + 1)));

    /* "brlapi.pyx":367
 * 				c_val = val
 * 				charset = <char*>c_brlapi.malloc(size+1)
 * 				c_brlapi.memcpy(<void*>charset,<void*>c_val,size)             # <<<<<<<<<<<<<<
 * 				charset[size] = 0
 * 				self.props.charset = charset
 */
    (void)(memcpy(((void *)__pyx_v_charset), ((void *)__pyx_v_c_val), __pyx_v_size));

    /* "brlapi.pyx":368
 * 				charset = <char*>c_brlapi.malloc(size+1)
 * 				c_brlapi.memcpy(<void*>charset,<void*>c_val,size)
 * 				charset[size] = 0             # <<<<<<<<<<<<<<
 * 				self.props.charset = charset
 * 			else:
 */
    (__pyx_v_charset[__pyx_v_size]) = 0;

    /* "brlapi.pyx":369
 * 				c_brlapi.memcpy(<void*>charset,<void*>c_val,size)
 * 				charset[size] = 0
 * 				self.props.charset = charset             # <<<<<<<<<<<<<<
 * 			else:
 * 				self.props.charset = NULL
 */
    __pyx_v_self->props.charset = __pyx_v_charset;

    /* "brlapi.pyx":361
 * 			if (self.props.charset):
 * 				c_brlapi.free(<char*>self.props.charset)
 * 			if (val):             # <<<<<<<<<<<<<<
 * 				if (type(val) == unicode):
 * 					val = val.encode('ASCII')
 */
    goto __pyx_L4;
  }

  /* "brlapi.pyx":371
 * 				self.props.charset = charset
 * 			else:
 * 				self.props.charset = NULL             # <<<<<<<<<<<<<<
 * 
 * 	property attrAnd:
 */
  /*else*/ {
    __pyx_v_self->props.charset = NULL;
  }
  __pyx_L4:;

  /* "brlapi.pyx":355
 * 			else:
 * 				return self.props.charset
 * 		def __set__(self, val):             # <<<<<<<<<<<<<<
 * 			cdef c_brlapi.size_t size
 * 			cdef char *c_val
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("brlapi.WriteStruct.charset.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":375
 * 	property attrAnd:
 * 		"""And attributes; applied first"""
 * 		def __get__(self):             # <<<<<<<<<<<<<<
 * 			cdef char *c_val
 * 			if (not self.props.andMask):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_11WriteStruct_7attrAnd_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6brlapi_11WriteStruct_7attrAnd_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_11WriteStruct_7attrAnd___get__(((struct __pyx_obj_6brlapi_WriteStruct *)__pyx_v_self));

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

static PyObject *__pyx_pf_6brlapi_11WriteStruct_7attrAnd___get__(struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_self) {
  char *__pyx_v_c_val;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "brlapi.pyx":377
 * 		def __get__(self):
 * 			cdef char *c_val
 * 			if (not self.props.andMask):             # <<<<<<<<<<<<<<
 * 				return None
 * 			else:
 */
  __pyx_t_1 = ((!(__pyx_v_self->props.andMask != 0)) != 0);
  if (__pyx_t_1) {

    /* "brlapi.pyx":378
 * 			cdef char *c_val
 * 			if (not self.props.andMask):
 * 				return None             # <<<<<<<<<<<<<<
 * 			else:
 * 				c_val = <char*>self.props.andMask
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "brlapi.pyx":377
 * 		def __get__(self):
 * 			cdef char *c_val
 * 			if (not self.props.andMask):             # <<<<<<<<<<<<<<
 * 				return None
 * 			else:
 */
  }

  /* "brlapi.pyx":380
 * 				return None
 * 			else:
 * 				c_val = <char*>self.props.andMask             # <<<<<<<<<<<<<<
 * 				return c_val[:self.regionSize]
 * 		def __set__(self, val):
 */
  /*else*/ {
    __pyx_v_c_val = ((char *)__pyx_v_self->props.andMask);

    /* "brlapi.pyx":381
 * 			else:
 * 				c_val = <char*>self.props.andMask
 * 				return c_val[:self.regionSize]             # <<<<<<<<<<<<<<
 * 		def __set__(self, val):
 * 			cdef c_brlapi.size_t size
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_regionSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = (__pyx_t_2 == Py_None);
    if (__pyx_t_1) {
      __pyx_t_3 = PY_SSIZE_T_MAX;
    } else {
      __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 381, __pyx_L1_error)
      __pyx_t_3 = __pyx_t_4;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_c_val + 0, __pyx_t_3 - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "brlapi.pyx":375
 * 	property attrAnd:
 * 		"""And attributes; applied first"""
 * 		def __get__(self):             # <<<<<<<<<<<<<<
 * 			cdef char *c_val
 * 			if (not self.props.andMask):
 */

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

/* "brlapi.pyx":382
 * 				c_val = <char*>self.props.andMask
 * 				return c_val[:self.regionSize]
 * 		def __set__(self, val):             # <<<<<<<<<<<<<<
 * 			cdef c_brlapi.size_t size
 * 			cdef char *c_val
 */

/* Python wrapper */
static int __pyx_pw_6brlapi_11WriteStruct_7attrAnd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
static int __pyx_pw_6brlapi_11WriteStruct_7attrAnd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_11WriteStruct_7attrAnd_2__set__(((struct __pyx_obj_6brlapi_WriteStruct *)__pyx_v_self), ((PyObject *)__pyx_v_val));

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

static int __pyx_pf_6brlapi_11WriteStruct_7attrAnd_2__set__(struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_self, PyObject *__pyx_v_val) {
  size_t __pyx_v_size;
  char *__pyx_v_c_val;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  char *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_val);

  /* "brlapi.pyx":385
 * 			cdef c_brlapi.size_t size
 * 			cdef char *c_val
 * 			if (self.props.andMask):             # <<<<<<<<<<<<<<
 * 				c_brlapi.free(<char*>self.props.andMask)
 * 			if (val):
 */
  __pyx_t_1 = (__pyx_v_self->props.andMask != 0);
  if (__pyx_t_1) {

    /* "brlapi.pyx":386
 * 			cdef char *c_val
 * 			if (self.props.andMask):
 * 				c_brlapi.free(<char*>self.props.andMask)             # <<<<<<<<<<<<<<
 * 			if (val):
 * 				if (type(val) == unicode):
 */
    free(((char *)__pyx_v_self->props.andMask));

    /* "brlapi.pyx":385
 * 			cdef c_brlapi.size_t size
 * 			cdef char *c_val
 * 			if (self.props.andMask):             # <<<<<<<<<<<<<<
 * 				c_brlapi.free(<char*>self.props.andMask)
 * 			if (val):
 */
  }

  /* "brlapi.pyx":387
 * 			if (self.props.andMask):
 * 				c_brlapi.free(<char*>self.props.andMask)
 * 			if (val):             # <<<<<<<<<<<<<<
 * 				if (type(val) == unicode):
 * 					val = val.encode('latin1')
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_val); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 387, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "brlapi.pyx":388
 * 				c_brlapi.free(<char*>self.props.andMask)
 * 			if (val):
 * 				if (type(val) == unicode):             # <<<<<<<<<<<<<<
 * 					val = val.encode('latin1')
 * 				size = len(val)
 */
    __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_val)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 388, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "brlapi.pyx":389
 * 			if (val):
 * 				if (type(val) == unicode):
 * 					val = val.encode('latin1')             # <<<<<<<<<<<<<<
 * 				size = len(val)
 * 				c_val = val
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 389, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_n_u_latin1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_n_u_latin1);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "brlapi.pyx":388
 * 				c_brlapi.free(<char*>self.props.andMask)
 * 			if (val):
 * 				if (type(val) == unicode):             # <<<<<<<<<<<<<<
 * 					val = val.encode('latin1')
 * 				size = len(val)
 */
    }

    /* "brlapi.pyx":390
 * 				if (type(val) == unicode):
 * 					val = val.encode('latin1')
 * 				size = len(val)             # <<<<<<<<<<<<<<
 * 				c_val = val
 * 				self.props.andMask = <unsigned char*>c_brlapi.malloc(size)
 */
    __pyx_t_5 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 390, __pyx_L1_error)
    __pyx_v_size = __pyx_t_5;

    /* "brlapi.pyx":391
 * 					val = val.encode('latin1')
 * 				size = len(val)
 * 				c_val = val             # <<<<<<<<<<<<<<
 * 				self.props.andMask = <unsigned char*>c_brlapi.malloc(size)
 * 				c_brlapi.memcpy(<void*>self.props.andMask,<void*>c_val,size)
 */
    __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_val); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 391, __pyx_L1_error)
    __pyx_v_c_val = __pyx_t_6;

    /* "brlapi.pyx":392
 * 				size = len(val)
 * 				c_val = val
 * 				self.props.andMask = <unsigned char*>c_brlapi.malloc(size)             # <<<<<<<<<<<<<<
 * 				c_brlapi.memcpy(<void*>self.props.andMask,<void*>c_val,size)
 * 			else:
 */
    __pyx_v_self->props.andMask = ((unsigned char *)malloc(__pyx_v_size));

    /* "brlapi.pyx":393
 * 				c_val = val
 * 				self.props.andMask = <unsigned char*>c_brlapi.malloc(size)
 * 				c_brlapi.memcpy(<void*>self.props.andMask,<void*>c_val,size)             # <<<<<<<<<<<<<<
 * 			else:
 * 				self.props.andMask = NULL
 */
    (void)(memcpy(((void *)__pyx_v_self->props.andMask), ((void *)__pyx_v_c_val), __pyx_v_size));

    /* "brlapi.pyx":387
 * 			if (self.props.andMask):
 * 				c_brlapi.free(<char*>self.props.andMask)
 * 			if (val):             # <<<<<<<<<<<<<<
 * 				if (type(val) == unicode):
 * 					val = val.encode('latin1')
 */
    goto __pyx_L4;
  }

  /* "brlapi.pyx":395
 * 				c_brlapi.memcpy(<void*>self.props.andMask,<void*>c_val,size)
 * 			else:
 * 				self.props.andMask = NULL             # <<<<<<<<<<<<<<
 * 
 * 	property attrOr:
 */
  /*else*/ {
    __pyx_v_self->props.andMask = NULL;
  }
  __pyx_L4:;

  /* "brlapi.pyx":382
 * 				c_val = <char*>self.props.andMask
 * 				return c_val[:self.regionSize]
 * 		def __set__(self, val):             # <<<<<<<<<<<<<<
 * 			cdef c_brlapi.size_t size
 * 			cdef char *c_val
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("brlapi.WriteStruct.attrAnd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":399
 * 	property attrOr:
 * 		"""Or attributes; applied after ANDing"""
 * 		def __get__(self):             # <<<<<<<<<<<<<<
 * 			cdef char *c_val
 * 			if (not self.props.orMask):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_11WriteStruct_6attrOr_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6brlapi_11WriteStruct_6attrOr_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_11WriteStruct_6attrOr___get__(((struct __pyx_obj_6brlapi_WriteStruct *)__pyx_v_self));

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

static PyObject *__pyx_pf_6brlapi_11WriteStruct_6attrOr___get__(struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_self) {
  char *__pyx_v_c_val;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "brlapi.pyx":401
 * 		def __get__(self):
 * 			cdef char *c_val
 * 			if (not self.props.orMask):             # <<<<<<<<<<<<<<
 * 				return None
 * 			else:
 */
  __pyx_t_1 = ((!(__pyx_v_self->props.orMask != 0)) != 0);
  if (__pyx_t_1) {

    /* "brlapi.pyx":402
 * 			cdef char *c_val
 * 			if (not self.props.orMask):
 * 				return None             # <<<<<<<<<<<<<<
 * 			else:
 * 				c_val = <char*>self.props.orMask
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "brlapi.pyx":401
 * 		def __get__(self):
 * 			cdef char *c_val
 * 			if (not self.props.orMask):             # <<<<<<<<<<<<<<
 * 				return None
 * 			else:
 */
  }

  /* "brlapi.pyx":404
 * 				return None
 * 			else:
 * 				c_val = <char*>self.props.orMask             # <<<<<<<<<<<<<<
 * 				return c_val[:self.regionSize]
 * 		def __set__(self, val):
 */
  /*else*/ {
    __pyx_v_c_val = ((char *)__pyx_v_self->props.orMask);

    /* "brlapi.pyx":405
 * 			else:
 * 				c_val = <char*>self.props.orMask
 * 				return c_val[:self.regionSize]             # <<<<<<<<<<<<<<
 * 		def __set__(self, val):
 * 			cdef c_brlapi.size_t size
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_regionSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = (__pyx_t_2 == Py_None);
    if (__pyx_t_1) {
      __pyx_t_3 = PY_SSIZE_T_MAX;
    } else {
      __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 405, __pyx_L1_error)
      __pyx_t_3 = __pyx_t_4;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_c_val + 0, __pyx_t_3 - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "brlapi.pyx":399
 * 	property attrOr:
 * 		"""Or attributes; applied after ANDing"""
 * 		def __get__(self):             # <<<<<<<<<<<<<<
 * 			cdef char *c_val
 * 			if (not self.props.orMask):
 */

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

/* "brlapi.pyx":406
 * 				c_val = <char*>self.props.orMask
 * 				return c_val[:self.regionSize]
 * 		def __set__(self, val):             # <<<<<<<<<<<<<<
 * 			cdef c_brlapi.size_t size
 * 			cdef char *c_val
 */

/* Python wrapper */
static int __pyx_pw_6brlapi_11WriteStruct_6attrOr_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
static int __pyx_pw_6brlapi_11WriteStruct_6attrOr_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_11WriteStruct_6attrOr_2__set__(((struct __pyx_obj_6brlapi_WriteStruct *)__pyx_v_self), ((PyObject *)__pyx_v_val));

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

static int __pyx_pf_6brlapi_11WriteStruct_6attrOr_2__set__(struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_self, PyObject *__pyx_v_val) {
  size_t __pyx_v_size;
  char *__pyx_v_c_val;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  char *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_val);

  /* "brlapi.pyx":409
 * 			cdef c_brlapi.size_t size
 * 			cdef char *c_val
 * 			if (self.props.orMask):             # <<<<<<<<<<<<<<
 * 				c_brlapi.free(<char*>self.props.orMask)
 * 			if (val):
 */
  __pyx_t_1 = (__pyx_v_self->props.orMask != 0);
  if (__pyx_t_1) {

    /* "brlapi.pyx":410
 * 			cdef char *c_val
 * 			if (self.props.orMask):
 * 				c_brlapi.free(<char*>self.props.orMask)             # <<<<<<<<<<<<<<
 * 			if (val):
 * 				if (type(val) == unicode):
 */
    free(((char *)__pyx_v_self->props.orMask));

    /* "brlapi.pyx":409
 * 			cdef c_brlapi.size_t size
 * 			cdef char *c_val
 * 			if (self.props.orMask):             # <<<<<<<<<<<<<<
 * 				c_brlapi.free(<char*>self.props.orMask)
 * 			if (val):
 */
  }

  /* "brlapi.pyx":411
 * 			if (self.props.orMask):
 * 				c_brlapi.free(<char*>self.props.orMask)
 * 			if (val):             # <<<<<<<<<<<<<<
 * 				if (type(val) == unicode):
 * 					val = val.encode('latin1')
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_val); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 411, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "brlapi.pyx":412
 * 				c_brlapi.free(<char*>self.props.orMask)
 * 			if (val):
 * 				if (type(val) == unicode):             # <<<<<<<<<<<<<<
 * 					val = val.encode('latin1')
 * 				size = len(val)
 */
    __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_val)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 412, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "brlapi.pyx":413
 * 			if (val):
 * 				if (type(val) == unicode):
 * 					val = val.encode('latin1')             # <<<<<<<<<<<<<<
 * 				size = len(val)
 * 				c_val = val
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 413, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_n_u_latin1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_n_u_latin1);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 413, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "brlapi.pyx":412
 * 				c_brlapi.free(<char*>self.props.orMask)
 * 			if (val):
 * 				if (type(val) == unicode):             # <<<<<<<<<<<<<<
 * 					val = val.encode('latin1')
 * 				size = len(val)
 */
    }

    /* "brlapi.pyx":414
 * 				if (type(val) == unicode):
 * 					val = val.encode('latin1')
 * 				size = len(val)             # <<<<<<<<<<<<<<
 * 				c_val = val
 * 				self.props.orMask = <unsigned char*>c_brlapi.malloc(size)
 */
    __pyx_t_5 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 414, __pyx_L1_error)
    __pyx_v_size = __pyx_t_5;

    /* "brlapi.pyx":415
 * 					val = val.encode('latin1')
 * 				size = len(val)
 * 				c_val = val             # <<<<<<<<<<<<<<
 * 				self.props.orMask = <unsigned char*>c_brlapi.malloc(size)
 * 				c_brlapi.memcpy(<void*>self.props.orMask,<void*>c_val,size)
 */
    __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_val); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 415, __pyx_L1_error)
    __pyx_v_c_val = __pyx_t_6;

    /* "brlapi.pyx":416
 * 				size = len(val)
 * 				c_val = val
 * 				self.props.orMask = <unsigned char*>c_brlapi.malloc(size)             # <<<<<<<<<<<<<<
 * 				c_brlapi.memcpy(<void*>self.props.orMask,<void*>c_val,size)
 * 			else:
 */
    __pyx_v_self->props.orMask = ((unsigned char *)malloc(__pyx_v_size));

    /* "brlapi.pyx":417
 * 				c_val = val
 * 				self.props.orMask = <unsigned char*>c_brlapi.malloc(size)
 * 				c_brlapi.memcpy(<void*>self.props.orMask,<void*>c_val,size)             # <<<<<<<<<<<<<<
 * 			else:
 * 				self.props.orMask = NULL
 */
    (void)(memcpy(((void *)__pyx_v_self->props.orMask), ((void *)__pyx_v_c_val), __pyx_v_size));

    /* "brlapi.pyx":411
 * 			if (self.props.orMask):
 * 				c_brlapi.free(<char*>self.props.orMask)
 * 			if (val):             # <<<<<<<<<<<<<<
 * 				if (type(val) == unicode):
 * 					val = val.encode('latin1')
 */
    goto __pyx_L4;
  }

  /* "brlapi.pyx":419
 * 				c_brlapi.memcpy(<void*>self.props.orMask,<void*>c_val,size)
 * 			else:
 * 				self.props.orMask = NULL             # <<<<<<<<<<<<<<
 * 
 * cdef class Connection:
 */
  /*else*/ {
    __pyx_v_self->props.orMask = NULL;
  }
  __pyx_L4:;

  /* "brlapi.pyx":406
 * 				c_val = <char*>self.props.orMask
 * 				return c_val[:self.regionSize]
 * 		def __set__(self, val):             # <<<<<<<<<<<<<<
 * 			cdef c_brlapi.size_t size
 * 			cdef char *c_val
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("brlapi.WriteStruct.attrOr.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("Pickling of struct members such as self.props must be explicitly requested with @auto_pickle(True)")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_11WriteStruct_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6brlapi_11WriteStruct_2__reduce_cython__[] = "WriteStruct.__reduce_cython__(self)";
static PyObject *__pyx_pw_6brlapi_11WriteStruct_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_11WriteStruct_2__reduce_cython__(((struct __pyx_obj_6brlapi_WriteStruct *)__pyx_v_self));

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

static PyObject *__pyx_pf_6brlapi_11WriteStruct_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6brlapi_WriteStruct *__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("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("Pickling of struct members such as self.props must be explicitly requested with @auto_pickle(True)")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("Pickling of struct members such as self.props must be explicitly requested with @auto_pickle(True)")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("Pickling of struct members such as self.props must be explicitly requested with @auto_pickle(True)")
 * def __setstate_cython__(self, __pyx_state):
 */

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("Pickling of struct members such as self.props must be explicitly requested with @auto_pickle(True)")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("Pickling of struct members such as self.props must be explicitly requested with @auto_pickle(True)")
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_11WriteStruct_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_6brlapi_11WriteStruct_4__setstate_cython__[] = "WriteStruct.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_6brlapi_11WriteStruct_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_11WriteStruct_4__setstate_cython__(((struct __pyx_obj_6brlapi_WriteStruct *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("Pickling of struct members such as self.props must be explicitly requested with @auto_pickle(True)")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("Pickling of struct members such as self.props must be explicitly requested with @auto_pickle(True)")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("Pickling of struct members such as self.props must be explicitly requested with @auto_pickle(True)")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("Pickling of struct members such as self.props must be explicitly requested with @auto_pickle(True)")
 */

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

/* "brlapi.pyx":428
 * 	cdef int fd
 * 
 * 	def __init__(self, host = None, auth = None):             # <<<<<<<<<<<<<<
 * 		"""Connect your program to BrlTTY using settings
 * 
 */

/* Python wrapper */
static int __pyx_pw_6brlapi_10Connection_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6brlapi_10Connection___init__[] = "Connect your program to BrlTTY using settings\n\n\t\tSee brlapi_openConnection(3)\n\t\t\n\t\tSetting host to None defaults it to localhost, using the local installation's default TCP port, or to the content of the BRLAPI_HOST environment variable, if it exists.\n\t\tNote: Please check that resolving this name works before complaining.\n\n\t\tSetting auth to None defaults it to local installation setup or to the content of the BRLAPI_AUTH environment variable, if it exists.";
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_6brlapi_10Connection___init__;
#endif
static int __pyx_pw_6brlapi_10Connection_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_host = 0;
  PyObject *__pyx_v_auth = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_host,&__pyx_n_s_auth,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_host);
          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_auth);
          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, 428, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_host = values[0];
    __pyx_v_auth = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 428, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("brlapi.Connection.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6brlapi_10Connection___init__(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self), __pyx_v_host, __pyx_v_auth);

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

static int __pyx_pf_6brlapi_10Connection___init__(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_host, PyObject *__pyx_v_auth) {
  brlapi_connectionSettings_t __pyx_v_client;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  char *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "brlapi.pyx":439
 * 		cdef c_brlapi.brlapi_connectionSettings_t client
 * 
 * 		if auth:             # <<<<<<<<<<<<<<
 * 			client.auth = auth
 * 		else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_auth); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 439, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "brlapi.pyx":440
 * 
 * 		if auth:
 * 			client.auth = auth             # <<<<<<<<<<<<<<
 * 		else:
 * 			client.auth = NULL
 */
    __pyx_t_2 = __Pyx_PyObject_AsWritableString(__pyx_v_auth); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L1_error)
    __pyx_v_client.auth = __pyx_t_2;

    /* "brlapi.pyx":439
 * 		cdef c_brlapi.brlapi_connectionSettings_t client
 * 
 * 		if auth:             # <<<<<<<<<<<<<<
 * 			client.auth = auth
 * 		else:
 */
    goto __pyx_L3;
  }

  /* "brlapi.pyx":442
 * 			client.auth = auth
 * 		else:
 * 			client.auth = NULL             # <<<<<<<<<<<<<<
 * 
 * 		if host:
 */
  /*else*/ {
    __pyx_v_client.auth = NULL;
  }
  __pyx_L3:;

  /* "brlapi.pyx":444
 * 			client.auth = NULL
 * 
 * 		if host:             # <<<<<<<<<<<<<<
 * 			client.host = host
 * 		else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_host); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 444, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "brlapi.pyx":445
 * 
 * 		if host:
 * 			client.host = host             # <<<<<<<<<<<<<<
 * 		else:
 * 			client.host = NULL
 */
    __pyx_t_2 = __Pyx_PyObject_AsWritableString(__pyx_v_host); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 445, __pyx_L1_error)
    __pyx_v_client.host = __pyx_t_2;

    /* "brlapi.pyx":444
 * 			client.auth = NULL
 * 
 * 		if host:             # <<<<<<<<<<<<<<
 * 			client.host = host
 * 		else:
 */
    goto __pyx_L4;
  }

  /* "brlapi.pyx":447
 * 			client.host = host
 * 		else:
 * 			client.host = NULL             # <<<<<<<<<<<<<<
 * 
 * 		self.h = <c_brlapi.brlapi_handle_t*> c_brlapi.malloc(c_brlapi.brlapi_getHandleSize())
 */
  /*else*/ {
    __pyx_v_client.host = NULL;
  }
  __pyx_L4:;

  /* "brlapi.pyx":449
 * 			client.host = NULL
 * 
 * 		self.h = <c_brlapi.brlapi_handle_t*> c_brlapi.malloc(c_brlapi.brlapi_getHandleSize())             # <<<<<<<<<<<<<<
 * 
 * 		with nogil:
 */
  __pyx_v_self->h = ((brlapi_handle_t *)malloc(brlapi_getHandleSize()));

  /* "brlapi.pyx":451
 * 		self.h = <c_brlapi.brlapi_handle_t*> c_brlapi.malloc(c_brlapi.brlapi_getHandleSize())
 * 
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			self.fd = <int>c_brlapi.brlapi__openConnection(self.h, &client, &self.settings)
 * 		c_brlapi.brlapi_protocolExceptionInit(self.h)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "brlapi.pyx":452
 * 
 * 		with nogil:
 * 			self.fd = <int>c_brlapi.brlapi__openConnection(self.h, &client, &self.settings)             # <<<<<<<<<<<<<<
 * 		c_brlapi.brlapi_protocolExceptionInit(self.h)
 * 		if self.fd == -1:
 */
        __pyx_v_self->fd = ((int)brlapi__openConnection(__pyx_v_self->h, (&__pyx_v_client), (&__pyx_v_self->settings)));
      }

      /* "brlapi.pyx":451
 * 		self.h = <c_brlapi.brlapi_handle_t*> c_brlapi.malloc(c_brlapi.brlapi_getHandleSize())
 * 
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			self.fd = <int>c_brlapi.brlapi__openConnection(self.h, &client, &self.settings)
 * 		c_brlapi.brlapi_protocolExceptionInit(self.h)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
  }

  /* "brlapi.pyx":453
 * 		with nogil:
 * 			self.fd = <int>c_brlapi.brlapi__openConnection(self.h, &client, &self.settings)
 * 		c_brlapi.brlapi_protocolExceptionInit(self.h)             # <<<<<<<<<<<<<<
 * 		if self.fd == -1:
 * 			c_brlapi.free(self.h)
 */
  brlapi_protocolExceptionInit(__pyx_v_self->h);

  /* "brlapi.pyx":454
 * 			self.fd = <int>c_brlapi.brlapi__openConnection(self.h, &client, &self.settings)
 * 		c_brlapi.brlapi_protocolExceptionInit(self.h)
 * 		if self.fd == -1:             # <<<<<<<<<<<<<<
 * 			c_brlapi.free(self.h)
 * 			raise ConnectionError(self.settings.host, self.settings.auth)
 */
  __pyx_t_1 = ((__pyx_v_self->fd == -1L) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "brlapi.pyx":455
 * 		c_brlapi.brlapi_protocolExceptionInit(self.h)
 * 		if self.fd == -1:
 * 			c_brlapi.free(self.h)             # <<<<<<<<<<<<<<
 * 			raise ConnectionError(self.settings.host, self.settings.auth)
 * 
 */
    free(__pyx_v_self->h);

    /* "brlapi.pyx":456
 * 		if self.fd == -1:
 * 			c_brlapi.free(self.h)
 * 			raise ConnectionError(self.settings.host, self.settings.auth)             # <<<<<<<<<<<<<<
 * 
 * 	def closeConnection(self):
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ConnectionError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 456, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->settings.host); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 456, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->settings.auth); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_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_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 456, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_6);
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 456, __pyx_L1_error)

    /* "brlapi.pyx":454
 * 			self.fd = <int>c_brlapi.brlapi__openConnection(self.h, &client, &self.settings)
 * 		c_brlapi.brlapi_protocolExceptionInit(self.h)
 * 		if self.fd == -1:             # <<<<<<<<<<<<<<
 * 			c_brlapi.free(self.h)
 * 			raise ConnectionError(self.settings.host, self.settings.auth)
 */
  }

  /* "brlapi.pyx":428
 * 	cdef int fd
 * 
 * 	def __init__(self, host = None, auth = None):             # <<<<<<<<<<<<<<
 * 		"""Connect your program to BrlTTY using settings
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("brlapi.Connection.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":458
 * 			raise ConnectionError(self.settings.host, self.settings.auth)
 * 
 * 	def closeConnection(self):             # <<<<<<<<<<<<<<
 * 		"""Close the BrlAPI connection"""
 * 		if self.fd != -1:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_3closeConnection(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6brlapi_10Connection_2closeConnection[] = "Connection.closeConnection(self)\nClose the BrlAPI connection";
static PyObject *__pyx_pw_6brlapi_10Connection_3closeConnection(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("closeConnection (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_10Connection_2closeConnection(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self));

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

static PyObject *__pyx_pf_6brlapi_10Connection_2closeConnection(struct __pyx_obj_6brlapi_Connection *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("closeConnection", 0);

  /* "brlapi.pyx":460
 * 	def closeConnection(self):
 * 		"""Close the BrlAPI connection"""
 * 		if self.fd != -1:             # <<<<<<<<<<<<<<
 * 			c_brlapi.brlapi__closeConnection(self.h)
 * 			self.fd = -1
 */
  __pyx_t_1 = ((__pyx_v_self->fd != -1L) != 0);
  if (__pyx_t_1) {

    /* "brlapi.pyx":461
 * 		"""Close the BrlAPI connection"""
 * 		if self.fd != -1:
 * 			c_brlapi.brlapi__closeConnection(self.h)             # <<<<<<<<<<<<<<
 * 			self.fd = -1
 * 
 */
    brlapi__closeConnection(__pyx_v_self->h);

    /* "brlapi.pyx":462
 * 		if self.fd != -1:
 * 			c_brlapi.brlapi__closeConnection(self.h)
 * 			self.fd = -1             # <<<<<<<<<<<<<<
 * 
 * 	def __del__(self):
 */
    __pyx_v_self->fd = -1;

    /* "brlapi.pyx":460
 * 	def closeConnection(self):
 * 		"""Close the BrlAPI connection"""
 * 		if self.fd != -1:             # <<<<<<<<<<<<<<
 * 			c_brlapi.brlapi__closeConnection(self.h)
 * 			self.fd = -1
 */
  }

  /* "brlapi.pyx":458
 * 			raise ConnectionError(self.settings.host, self.settings.auth)
 * 
 * 	def closeConnection(self):             # <<<<<<<<<<<<<<
 * 		"""Close the BrlAPI connection"""
 * 		if self.fd != -1:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":464
 * 			self.fd = -1
 * 
 * 	def __del__(self):             # <<<<<<<<<<<<<<
 * 		"""Release resources used by the connection"""
 * 		if self.fd != -1:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_5__del__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6brlapi_10Connection_4__del__[] = "Connection.__del__(self)\nRelease resources used by the connection";
static PyObject *__pyx_pw_6brlapi_10Connection_5__del__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_10Connection_4__del__(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self));

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

static PyObject *__pyx_pf_6brlapi_10Connection_4__del__(struct __pyx_obj_6brlapi_Connection *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__del__", 0);

  /* "brlapi.pyx":466
 * 	def __del__(self):
 * 		"""Release resources used by the connection"""
 * 		if self.fd != -1:             # <<<<<<<<<<<<<<
 * 			c_brlapi.brlapi__closeConnection(self.h)
 * 		c_brlapi.free(self.h)
 */
  __pyx_t_1 = ((__pyx_v_self->fd != -1L) != 0);
  if (__pyx_t_1) {

    /* "brlapi.pyx":467
 * 		"""Release resources used by the connection"""
 * 		if self.fd != -1:
 * 			c_brlapi.brlapi__closeConnection(self.h)             # <<<<<<<<<<<<<<
 * 		c_brlapi.free(self.h)
 * 
 */
    brlapi__closeConnection(__pyx_v_self->h);

    /* "brlapi.pyx":466
 * 	def __del__(self):
 * 		"""Release resources used by the connection"""
 * 		if self.fd != -1:             # <<<<<<<<<<<<<<
 * 			c_brlapi.brlapi__closeConnection(self.h)
 * 		c_brlapi.free(self.h)
 */
  }

  /* "brlapi.pyx":468
 * 		if self.fd != -1:
 * 			c_brlapi.brlapi__closeConnection(self.h)
 * 		c_brlapi.free(self.h)             # <<<<<<<<<<<<<<
 * 
 * 	property host:
 */
  free(__pyx_v_self->h);

  /* "brlapi.pyx":464
 * 			self.fd = -1
 * 
 * 	def __del__(self):             # <<<<<<<<<<<<<<
 * 		"""Release resources used by the connection"""
 * 		if self.fd != -1:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":472
 * 	property host:
 * 		"""To get authorized to connect, libbrlapi has to tell the BrlAPI server a secret key, for security reasons. This is the path to the file which holds it; it will hence have to be readable by the application."""
 * 		def __get__(self):             # <<<<<<<<<<<<<<
 * 			return self.settings.host
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_4host_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6brlapi_10Connection_4host_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_10Connection_4host___get__(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self));

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

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

  /* "brlapi.pyx":473
 * 		"""To get authorized to connect, libbrlapi has to tell the BrlAPI server a secret key, for security reasons. This is the path to the file which holds it; it will hence have to be readable by the application."""
 * 		def __get__(self):
 * 			return self.settings.host             # <<<<<<<<<<<<<<
 * 
 * 	property auth:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->settings.host); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "brlapi.pyx":472
 * 	property host:
 * 		"""To get authorized to connect, libbrlapi has to tell the BrlAPI server a secret key, for security reasons. This is the path to the file which holds it; it will hence have to be readable by the application."""
 * 		def __get__(self):             # <<<<<<<<<<<<<<
 * 			return self.settings.host
 * 
 */

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

/* "brlapi.pyx":477
 * 	property auth:
 * 		"""This tells where the BrlAPI server resides : it might be listening on another computer, on any TCP port. It should look like "foo:1", which means TCP port number BRLAPI_SOCKETPORTNUM+1 on computer called "foo"."""
 * 		def __get__(self):             # <<<<<<<<<<<<<<
 * 			return self.settings.auth
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_4auth_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6brlapi_10Connection_4auth_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_10Connection_4auth___get__(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self));

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

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

  /* "brlapi.pyx":478
 * 		"""This tells where the BrlAPI server resides : it might be listening on another computer, on any TCP port. It should look like "foo:1", which means TCP port number BRLAPI_SOCKETPORTNUM+1 on computer called "foo"."""
 * 		def __get__(self):
 * 			return self.settings.auth             # <<<<<<<<<<<<<<
 * 
 * 	property fileDescriptor:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->settings.auth); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "brlapi.pyx":477
 * 	property auth:
 * 		"""This tells where the BrlAPI server resides : it might be listening on another computer, on any TCP port. It should look like "foo:1", which means TCP port number BRLAPI_SOCKETPORTNUM+1 on computer called "foo"."""
 * 		def __get__(self):             # <<<<<<<<<<<<<<
 * 			return self.settings.auth
 * 
 */

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

/* "brlapi.pyx":482
 * 	property fileDescriptor:
 * 		"""Returns the Unix file descriptor that the connection uses"""
 * 		def __get__(self):             # <<<<<<<<<<<<<<
 * 			return self.fd
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_14fileDescriptor_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6brlapi_10Connection_14fileDescriptor_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_10Connection_14fileDescriptor___get__(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self));

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

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

  /* "brlapi.pyx":483
 * 		"""Returns the Unix file descriptor that the connection uses"""
 * 		def __get__(self):
 * 			return self.fd             # <<<<<<<<<<<<<<
 * 
 * 	property displaySize:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->fd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "brlapi.pyx":482
 * 	property fileDescriptor:
 * 		"""Returns the Unix file descriptor that the connection uses"""
 * 		def __get__(self):             # <<<<<<<<<<<<<<
 * 			return self.fd
 * 
 */

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

/* "brlapi.pyx":488
 * 		"""Get the size of the braille display
 * 		See brlapi_getDisplaySize(3)."""
 * 		def __get__(self):             # <<<<<<<<<<<<<<
 * 			cdef unsigned int x
 * 			cdef unsigned int y
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_11displaySize_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6brlapi_10Connection_11displaySize_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_10Connection_11displaySize___get__(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self));

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

static PyObject *__pyx_pf_6brlapi_10Connection_11displaySize___get__(struct __pyx_obj_6brlapi_Connection *__pyx_v_self) {
  unsigned int __pyx_v_x;
  unsigned int __pyx_v_y;
  int __pyx_v_retval;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "brlapi.pyx":492
 * 			cdef unsigned int y
 * 			cdef int retval
 * 			with nogil:             # <<<<<<<<<<<<<<
 * 				retval = c_brlapi.brlapi__getDisplaySize(self.h, &x, &y)
 * 			if retval == -1:
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "brlapi.pyx":493
 * 			cdef int retval
 * 			with nogil:
 * 				retval = c_brlapi.brlapi__getDisplaySize(self.h, &x, &y)             # <<<<<<<<<<<<<<
 * 			if retval == -1:
 * 				raise OperationError()
 */
        __pyx_v_retval = brlapi__getDisplaySize(__pyx_v_self->h, (&__pyx_v_x), (&__pyx_v_y));
      }

      /* "brlapi.pyx":492
 * 			cdef unsigned int y
 * 			cdef int retval
 * 			with nogil:             # <<<<<<<<<<<<<<
 * 				retval = c_brlapi.brlapi__getDisplaySize(self.h, &x, &y)
 * 			if retval == -1:
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "brlapi.pyx":494
 * 			with nogil:
 * 				retval = c_brlapi.brlapi__getDisplaySize(self.h, &x, &y)
 * 			if retval == -1:             # <<<<<<<<<<<<<<
 * 				raise OperationError()
 * 			else:
 */
  __pyx_t_1 = ((__pyx_v_retval == -1L) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "brlapi.pyx":495
 * 				retval = c_brlapi.brlapi__getDisplaySize(self.h, &x, &y)
 * 			if retval == -1:
 * 				raise OperationError()             # <<<<<<<<<<<<<<
 * 			else:
 * 				return (x, y)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_OperationError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_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, 495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 495, __pyx_L1_error)

    /* "brlapi.pyx":494
 * 			with nogil:
 * 				retval = c_brlapi.brlapi__getDisplaySize(self.h, &x, &y)
 * 			if retval == -1:             # <<<<<<<<<<<<<<
 * 				raise OperationError()
 * 			else:
 */
  }

  /* "brlapi.pyx":497
 * 				raise OperationError()
 * 			else:
 * 				return (x, y)             # <<<<<<<<<<<<<<
 * 
 * 	property driverName:
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 497, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 497, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 497, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "brlapi.pyx":488
 * 		"""Get the size of the braille display
 * 		See brlapi_getDisplaySize(3)."""
 * 		def __get__(self):             # <<<<<<<<<<<<<<
 * 			cdef unsigned int x
 * 			cdef unsigned int y
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("brlapi.Connection.displaySize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":502
 * 		"""Get the complete name of the driver used by BrlTTY
 * 		See brlapi_getDriverName(3)."""
 * 		def __get__(self):             # <<<<<<<<<<<<<<
 * 			cdef char name[21]
 * 			cdef int retval
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_10driverName_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6brlapi_10Connection_10driverName_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_10Connection_10driverName___get__(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self));

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

static PyObject *__pyx_pf_6brlapi_10Connection_10driverName___get__(struct __pyx_obj_6brlapi_Connection *__pyx_v_self) {
  char __pyx_v_name[21];
  int __pyx_v_retval;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "brlapi.pyx":505
 * 			cdef char name[21]
 * 			cdef int retval
 * 			with nogil:             # <<<<<<<<<<<<<<
 * 				retval = c_brlapi.brlapi__getDriverName(self.h, name, sizeof(name))
 * 			if retval == -1:
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "brlapi.pyx":506
 * 			cdef int retval
 * 			with nogil:
 * 				retval = c_brlapi.brlapi__getDriverName(self.h, name, sizeof(name))             # <<<<<<<<<<<<<<
 * 			if retval == -1:
 * 				raise OperationError()
 */
        __pyx_v_retval = brlapi__getDriverName(__pyx_v_self->h, __pyx_v_name, (sizeof(__pyx_v_name)));
      }

      /* "brlapi.pyx":505
 * 			cdef char name[21]
 * 			cdef int retval
 * 			with nogil:             # <<<<<<<<<<<<<<
 * 				retval = c_brlapi.brlapi__getDriverName(self.h, name, sizeof(name))
 * 			if retval == -1:
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "brlapi.pyx":507
 * 			with nogil:
 * 				retval = c_brlapi.brlapi__getDriverName(self.h, name, sizeof(name))
 * 			if retval == -1:             # <<<<<<<<<<<<<<
 * 				raise OperationError()
 * 			else:
 */
  __pyx_t_1 = ((__pyx_v_retval == -1L) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "brlapi.pyx":508
 * 				retval = c_brlapi.brlapi__getDriverName(self.h, name, sizeof(name))
 * 			if retval == -1:
 * 				raise OperationError()             # <<<<<<<<<<<<<<
 * 			else:
 * 				return name
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_OperationError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_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, 508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 508, __pyx_L1_error)

    /* "brlapi.pyx":507
 * 			with nogil:
 * 				retval = c_brlapi.brlapi__getDriverName(self.h, name, sizeof(name))
 * 			if retval == -1:             # <<<<<<<<<<<<<<
 * 				raise OperationError()
 * 			else:
 */
  }

  /* "brlapi.pyx":510
 * 				raise OperationError()
 * 			else:
 * 				return name             # <<<<<<<<<<<<<<
 * 
 * 	property modelIdentifier:
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_FromString(__pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 510, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "brlapi.pyx":502
 * 		"""Get the complete name of the driver used by BrlTTY
 * 		See brlapi_getDriverName(3)."""
 * 		def __get__(self):             # <<<<<<<<<<<<<<
 * 			cdef char name[21]
 * 			cdef int retval
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("brlapi.Connection.driverName.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":515
 * 		"""Get the identifier for the model of the braille display
 * 		See brlapi_getModelIdentifier(3)."""
 * 		def __get__(self):             # <<<<<<<<<<<<<<
 * 			cdef char identifier[21]
 * 			cdef int retval
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_15modelIdentifier_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6brlapi_10Connection_15modelIdentifier_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_10Connection_15modelIdentifier___get__(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self));

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

static PyObject *__pyx_pf_6brlapi_10Connection_15modelIdentifier___get__(struct __pyx_obj_6brlapi_Connection *__pyx_v_self) {
  char __pyx_v_identifier[21];
  int __pyx_v_retval;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "brlapi.pyx":518
 * 			cdef char identifier[21]
 * 			cdef int retval
 * 			with nogil:             # <<<<<<<<<<<<<<
 * 				retval = c_brlapi.brlapi__getModelIdentifier(self.h, identifier, sizeof(identifier))
 * 			if retval == -1:
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "brlapi.pyx":519
 * 			cdef int retval
 * 			with nogil:
 * 				retval = c_brlapi.brlapi__getModelIdentifier(self.h, identifier, sizeof(identifier))             # <<<<<<<<<<<<<<
 * 			if retval == -1:
 * 				raise OperationError()
 */
        __pyx_v_retval = brlapi__getModelIdentifier(__pyx_v_self->h, __pyx_v_identifier, (sizeof(__pyx_v_identifier)));
      }

      /* "brlapi.pyx":518
 * 			cdef char identifier[21]
 * 			cdef int retval
 * 			with nogil:             # <<<<<<<<<<<<<<
 * 				retval = c_brlapi.brlapi__getModelIdentifier(self.h, identifier, sizeof(identifier))
 * 			if retval == -1:
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "brlapi.pyx":520
 * 			with nogil:
 * 				retval = c_brlapi.brlapi__getModelIdentifier(self.h, identifier, sizeof(identifier))
 * 			if retval == -1:             # <<<<<<<<<<<<<<
 * 				raise OperationError()
 * 			else:
 */
  __pyx_t_1 = ((__pyx_v_retval == -1L) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "brlapi.pyx":521
 * 				retval = c_brlapi.brlapi__getModelIdentifier(self.h, identifier, sizeof(identifier))
 * 			if retval == -1:
 * 				raise OperationError()             # <<<<<<<<<<<<<<
 * 			else:
 * 				return identifier
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_OperationError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 521, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_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, 521, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 521, __pyx_L1_error)

    /* "brlapi.pyx":520
 * 			with nogil:
 * 				retval = c_brlapi.brlapi__getModelIdentifier(self.h, identifier, sizeof(identifier))
 * 			if retval == -1:             # <<<<<<<<<<<<<<
 * 				raise OperationError()
 * 			else:
 */
  }

  /* "brlapi.pyx":523
 * 				raise OperationError()
 * 			else:
 * 				return identifier             # <<<<<<<<<<<<<<
 * 
 * 	def enterTtyMode(self, tty = TTY_DEFAULT, driver = None):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_FromString(__pyx_v_identifier); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 523, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "brlapi.pyx":515
 * 		"""Get the identifier for the model of the braille display
 * 		See brlapi_getModelIdentifier(3)."""
 * 		def __get__(self):             # <<<<<<<<<<<<<<
 * 			cdef char identifier[21]
 * 			cdef int retval
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("brlapi.Connection.modelIdentifier.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":525
 * 				return identifier
 * 
 * 	def enterTtyMode(self, tty = TTY_DEFAULT, driver = None):             # <<<<<<<<<<<<<<
 * 		"""Ask for some tty, with some key mechanism
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_7enterTtyMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6brlapi_10Connection_6enterTtyMode[] = "Connection.enterTtyMode(self, tty=TTY_DEFAULT, driver=None)\nAsk for some tty, with some key mechanism\n\n\t\tSee brlapi_enterTtyMode(3).\n\n\t\t* tty : If tty >= 0, application takes control of the specified tty\n\t\t\tIf tty == TTY_DEFAULT, the library first tries to get the tty number from the WINDOWID environment variable (form xterm case), then the CONTROLVT variable, and at last reads /proc/self/stat (on linux)\n\t\t* driver : Tells how the application wants readKey() to return key presses. None or \"\" means BrlTTY commands are required, whereas a driver name means that raw key codes returned by this driver are expected.";
static PyObject *__pyx_pw_6brlapi_10Connection_7enterTtyMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_tty = 0;
  PyObject *__pyx_v_driver = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("enterTtyMode (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tty,&__pyx_n_s_driver,0};
    PyObject* values[2] = {0,0};
    values[0] = __pyx_k__8;
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tty);
          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_driver);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "enterTtyMode") < 0)) __PYX_ERR(0, 525, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_tty = values[0];
    __pyx_v_driver = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("enterTtyMode", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 525, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("brlapi.Connection.enterTtyMode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6brlapi_10Connection_6enterTtyMode(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self), __pyx_v_tty, __pyx_v_driver);

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

static PyObject *__pyx_pf_6brlapi_10Connection_6enterTtyMode(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_tty, PyObject *__pyx_v_driver) {
  int __pyx_v_retval;
  int __pyx_v_c_tty;
  char *__pyx_v_c_driver;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  char *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("enterTtyMode", 0);
  __Pyx_INCREF(__pyx_v_driver);

  /* "brlapi.pyx":536
 * 		cdef int c_tty
 * 		cdef char *c_driver
 * 		c_tty = tty             # <<<<<<<<<<<<<<
 * 		if not driver:
 * 			c_driver = NULL
 */
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_tty); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 536, __pyx_L1_error)
  __pyx_v_c_tty = __pyx_t_1;

  /* "brlapi.pyx":537
 * 		cdef char *c_driver
 * 		c_tty = tty
 * 		if not driver:             # <<<<<<<<<<<<<<
 * 			c_driver = NULL
 * 		else:
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_driver); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 537, __pyx_L1_error)
  __pyx_t_3 = ((!__pyx_t_2) != 0);
  if (__pyx_t_3) {

    /* "brlapi.pyx":538
 * 		c_tty = tty
 * 		if not driver:
 * 			c_driver = NULL             # <<<<<<<<<<<<<<
 * 		else:
 * 			if (type(driver) == unicode):
 */
    __pyx_v_c_driver = NULL;

    /* "brlapi.pyx":537
 * 		cdef char *c_driver
 * 		c_tty = tty
 * 		if not driver:             # <<<<<<<<<<<<<<
 * 			c_driver = NULL
 * 		else:
 */
    goto __pyx_L3;
  }

  /* "brlapi.pyx":540
 * 			c_driver = NULL
 * 		else:
 * 			if (type(driver) == unicode):             # <<<<<<<<<<<<<<
 * 				driver = driver.encode('ASCII')
 * 			c_driver = driver
 */
  /*else*/ {
    __pyx_t_4 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_driver)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 540, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "brlapi.pyx":541
 * 		else:
 * 			if (type(driver) == unicode):
 * 				driver = driver.encode('ASCII')             # <<<<<<<<<<<<<<
 * 			c_driver = driver
 * 		with nogil:
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_driver, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 541, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_u_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_u_ASCII);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_driver, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "brlapi.pyx":540
 * 			c_driver = NULL
 * 		else:
 * 			if (type(driver) == unicode):             # <<<<<<<<<<<<<<
 * 				driver = driver.encode('ASCII')
 * 			c_driver = driver
 */
    }

    /* "brlapi.pyx":542
 * 			if (type(driver) == unicode):
 * 				driver = driver.encode('ASCII')
 * 			c_driver = driver             # <<<<<<<<<<<<<<
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__enterTtyMode(self.h, c_tty, c_driver)
 */
    __pyx_t_7 = __Pyx_PyObject_AsWritableString(__pyx_v_driver); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 542, __pyx_L1_error)
    __pyx_v_c_driver = __pyx_t_7;
  }
  __pyx_L3:;

  /* "brlapi.pyx":543
 * 				driver = driver.encode('ASCII')
 * 			c_driver = driver
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__enterTtyMode(self.h, c_tty, c_driver)
 * 		if retval == -1:
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "brlapi.pyx":544
 * 			c_driver = driver
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__enterTtyMode(self.h, c_tty, c_driver)             # <<<<<<<<<<<<<<
 * 		if retval == -1:
 * 			raise OperationError()
 */
        __pyx_v_retval = brlapi__enterTtyMode(__pyx_v_self->h, __pyx_v_c_tty, __pyx_v_c_driver);
      }

      /* "brlapi.pyx":543
 * 				driver = driver.encode('ASCII')
 * 			c_driver = driver
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__enterTtyMode(self.h, c_tty, c_driver)
 * 		if retval == -1:
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
  }

  /* "brlapi.pyx":545
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__enterTtyMode(self.h, c_tty, c_driver)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 		else:
 */
  __pyx_t_3 = ((__pyx_v_retval == -1L) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "brlapi.pyx":546
 * 			retval = c_brlapi.brlapi__enterTtyMode(self.h, c_tty, c_driver)
 * 		if retval == -1:
 * 			raise OperationError()             # <<<<<<<<<<<<<<
 * 		else:
 * 			return retval
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_OperationError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 546, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_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, 546, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 546, __pyx_L1_error)

    /* "brlapi.pyx":545
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__enterTtyMode(self.h, c_tty, c_driver)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 		else:
 */
  }

  /* "brlapi.pyx":548
 * 			raise OperationError()
 * 		else:
 * 			return retval             # <<<<<<<<<<<<<<
 * 
 * 	def enterTtyModeWithPath(self, path = [], driver = None):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_retval); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "brlapi.pyx":525
 * 				return identifier
 * 
 * 	def enterTtyMode(self, tty = TTY_DEFAULT, driver = None):             # <<<<<<<<<<<<<<
 * 		"""Ask for some tty, with some key mechanism
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("brlapi.Connection.enterTtyMode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_driver);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":550
 * 			return retval
 * 
 * 	def enterTtyModeWithPath(self, path = [], driver = None):             # <<<<<<<<<<<<<<
 * 		"""Ask for some tty, with some key mechanism
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_9enterTtyModeWithPath(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6brlapi_10Connection_8enterTtyModeWithPath[] = "Connection.enterTtyModeWithPath(self, path=[], driver=None)\nAsk for some tty, with some key mechanism\n\n\t\tSee brlapi_enterTtyModeWithPath(3).\n\n\t\t* tty is an array of ttys representing the tty path to be got. Can be None.\n\t\t* driver : has the same meaning as in enterTtyMode.\n\t\t\n\t\tProviding an empty array or None means to get the root.";
static PyObject *__pyx_pw_6brlapi_10Connection_9enterTtyModeWithPath(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_driver = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("enterTtyModeWithPath (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_driver,0};
    PyObject* values[2] = {0,0};
    values[0] = __pyx_k__9;
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path);
          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_driver);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "enterTtyModeWithPath") < 0)) __PYX_ERR(0, 550, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    __pyx_v_driver = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("enterTtyModeWithPath", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 550, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("brlapi.Connection.enterTtyModeWithPath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6brlapi_10Connection_8enterTtyModeWithPath(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self), __pyx_v_path, __pyx_v_driver);

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

static PyObject *__pyx_pf_6brlapi_10Connection_8enterTtyModeWithPath(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_driver) {
  int __pyx_v_retval;
  int *__pyx_v_c_ttys;
  int __pyx_v_c_nttys;
  char *__pyx_v_c_driver;
  long __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  char *__pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("enterTtyModeWithPath", 0);
  __Pyx_INCREF(__pyx_v_driver);

  /* "brlapi.pyx":563
 * 		cdef int c_nttys
 * 		cdef char *c_driver
 * 		if not path:             # <<<<<<<<<<<<<<
 * 			c_ttys = NULL
 * 			c_nttys = 0
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_path); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 563, __pyx_L1_error)
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "brlapi.pyx":564
 * 		cdef char *c_driver
 * 		if not path:
 * 			c_ttys = NULL             # <<<<<<<<<<<<<<
 * 			c_nttys = 0
 * 		else:
 */
    __pyx_v_c_ttys = NULL;

    /* "brlapi.pyx":565
 * 		if not path:
 * 			c_ttys = NULL
 * 			c_nttys = 0             # <<<<<<<<<<<<<<
 * 		else:
 * 			c_nttys = len(path)
 */
    __pyx_v_c_nttys = 0;

    /* "brlapi.pyx":563
 * 		cdef int c_nttys
 * 		cdef char *c_driver
 * 		if not path:             # <<<<<<<<<<<<<<
 * 			c_ttys = NULL
 * 			c_nttys = 0
 */
    goto __pyx_L3;
  }

  /* "brlapi.pyx":567
 * 			c_nttys = 0
 * 		else:
 * 			c_nttys = len(path)             # <<<<<<<<<<<<<<
 * 			c_ttys = <int*>c_brlapi.malloc(c_nttys * sizeof(int))
 * 			for i from 0 <= i < c_nttys:
 */
  /*else*/ {
    __pyx_t_3 = PyObject_Length(__pyx_v_path); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 567, __pyx_L1_error)
    __pyx_v_c_nttys = __pyx_t_3;

    /* "brlapi.pyx":568
 * 		else:
 * 			c_nttys = len(path)
 * 			c_ttys = <int*>c_brlapi.malloc(c_nttys * sizeof(int))             # <<<<<<<<<<<<<<
 * 			for i from 0 <= i < c_nttys:
 * 				c_ttys[i] = path[i]
 */
    __pyx_v_c_ttys = ((int *)malloc((__pyx_v_c_nttys * (sizeof(int)))));

    /* "brlapi.pyx":569
 * 			c_nttys = len(path)
 * 			c_ttys = <int*>c_brlapi.malloc(c_nttys * sizeof(int))
 * 			for i from 0 <= i < c_nttys:             # <<<<<<<<<<<<<<
 * 				c_ttys[i] = path[i]
 * 		if not driver:
 */
    __pyx_t_4 = __pyx_v_c_nttys;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

      /* "brlapi.pyx":570
 * 			c_ttys = <int*>c_brlapi.malloc(c_nttys * sizeof(int))
 * 			for i from 0 <= i < c_nttys:
 * 				c_ttys[i] = path[i]             # <<<<<<<<<<<<<<
 * 		if not driver:
 * 			c_driver = NULL
 */
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_path, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 570, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 570, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      (__pyx_v_c_ttys[__pyx_v_i]) = __pyx_t_6;
    }
  }
  __pyx_L3:;

  /* "brlapi.pyx":571
 * 			for i from 0 <= i < c_nttys:
 * 				c_ttys[i] = path[i]
 * 		if not driver:             # <<<<<<<<<<<<<<
 * 			c_driver = NULL
 * 		else:
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_driver); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 571, __pyx_L1_error)
  __pyx_t_1 = ((!__pyx_t_2) != 0);
  if (__pyx_t_1) {

    /* "brlapi.pyx":572
 * 				c_ttys[i] = path[i]
 * 		if not driver:
 * 			c_driver = NULL             # <<<<<<<<<<<<<<
 * 		else:
 * 			if (type(driver) == unicode):
 */
    __pyx_v_c_driver = NULL;

    /* "brlapi.pyx":571
 * 			for i from 0 <= i < c_nttys:
 * 				c_ttys[i] = path[i]
 * 		if not driver:             # <<<<<<<<<<<<<<
 * 			c_driver = NULL
 * 		else:
 */
    goto __pyx_L6;
  }

  /* "brlapi.pyx":574
 * 			c_driver = NULL
 * 		else:
 * 			if (type(driver) == unicode):             # <<<<<<<<<<<<<<
 * 				driver = driver.encode('ASCII')
 * 			c_driver = driver
 */
  /*else*/ {
    __pyx_t_5 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_driver)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 574, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 574, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_1) {

      /* "brlapi.pyx":575
 * 		else:
 * 			if (type(driver) == unicode):
 * 				driver = driver.encode('ASCII')             # <<<<<<<<<<<<<<
 * 			c_driver = driver
 * 		with nogil:
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_driver, __pyx_n_s_encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 575, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_n_u_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_n_u_ASCII);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 575, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF_SET(__pyx_v_driver, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "brlapi.pyx":574
 * 			c_driver = NULL
 * 		else:
 * 			if (type(driver) == unicode):             # <<<<<<<<<<<<<<
 * 				driver = driver.encode('ASCII')
 * 			c_driver = driver
 */
    }

    /* "brlapi.pyx":576
 * 			if (type(driver) == unicode):
 * 				driver = driver.encode('ASCII')
 * 			c_driver = driver             # <<<<<<<<<<<<<<
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__enterTtyModeWithPath(self.h, c_ttys, c_nttys, c_driver)
 */
    __pyx_t_9 = __Pyx_PyObject_AsWritableString(__pyx_v_driver); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 576, __pyx_L1_error)
    __pyx_v_c_driver = __pyx_t_9;
  }
  __pyx_L6:;

  /* "brlapi.pyx":577
 * 				driver = driver.encode('ASCII')
 * 			c_driver = driver
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__enterTtyModeWithPath(self.h, c_ttys, c_nttys, c_driver)
 * 		if (c_ttys):
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "brlapi.pyx":578
 * 			c_driver = driver
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__enterTtyModeWithPath(self.h, c_ttys, c_nttys, c_driver)             # <<<<<<<<<<<<<<
 * 		if (c_ttys):
 * 			c_brlapi.free(c_ttys)
 */
        __pyx_v_retval = brlapi__enterTtyModeWithPath(__pyx_v_self->h, __pyx_v_c_ttys, __pyx_v_c_nttys, __pyx_v_c_driver);
      }

      /* "brlapi.pyx":577
 * 				driver = driver.encode('ASCII')
 * 			c_driver = driver
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__enterTtyModeWithPath(self.h, c_ttys, c_nttys, c_driver)
 * 		if (c_ttys):
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L10;
        }
        __pyx_L10:;
      }
  }

  /* "brlapi.pyx":579
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__enterTtyModeWithPath(self.h, c_ttys, c_nttys, c_driver)
 * 		if (c_ttys):             # <<<<<<<<<<<<<<
 * 			c_brlapi.free(c_ttys)
 * 		if retval == -1:
 */
  __pyx_t_1 = (__pyx_v_c_ttys != 0);
  if (__pyx_t_1) {

    /* "brlapi.pyx":580
 * 			retval = c_brlapi.brlapi__enterTtyModeWithPath(self.h, c_ttys, c_nttys, c_driver)
 * 		if (c_ttys):
 * 			c_brlapi.free(c_ttys)             # <<<<<<<<<<<<<<
 * 		if retval == -1:
 * 			raise OperationError()
 */
    free(__pyx_v_c_ttys);

    /* "brlapi.pyx":579
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__enterTtyModeWithPath(self.h, c_ttys, c_nttys, c_driver)
 * 		if (c_ttys):             # <<<<<<<<<<<<<<
 * 			c_brlapi.free(c_ttys)
 * 		if retval == -1:
 */
  }

  /* "brlapi.pyx":581
 * 		if (c_ttys):
 * 			c_brlapi.free(c_ttys)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 		else:
 */
  __pyx_t_1 = ((__pyx_v_retval == -1L) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "brlapi.pyx":582
 * 			c_brlapi.free(c_ttys)
 * 		if retval == -1:
 * 			raise OperationError()             # <<<<<<<<<<<<<<
 * 		else:
 * 			return retval
 */
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_OperationError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __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_5 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 582, __pyx_L1_error)

    /* "brlapi.pyx":581
 * 		if (c_ttys):
 * 			c_brlapi.free(c_ttys)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 		else:
 */
  }

  /* "brlapi.pyx":584
 * 			raise OperationError()
 * 		else:
 * 			return retval             # <<<<<<<<<<<<<<
 * 
 * 	def leaveTtyMode(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_retval); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }

  /* "brlapi.pyx":550
 * 			return retval
 * 
 * 	def enterTtyModeWithPath(self, path = [], driver = None):             # <<<<<<<<<<<<<<
 * 		"""Ask for some tty, with some key mechanism
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("brlapi.Connection.enterTtyModeWithPath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_driver);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":586
 * 			return retval
 * 
 * 	def leaveTtyMode(self):             # <<<<<<<<<<<<<<
 * 		"""Stop controlling the tty
 * 		See brlapi_leaveTtyMode(3)."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_11leaveTtyMode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6brlapi_10Connection_10leaveTtyMode[] = "Connection.leaveTtyMode(self)\nStop controlling the tty\n\t\tSee brlapi_leaveTtyMode(3).";
static PyObject *__pyx_pw_6brlapi_10Connection_11leaveTtyMode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("leaveTtyMode (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_10Connection_10leaveTtyMode(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self));

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

static PyObject *__pyx_pf_6brlapi_10Connection_10leaveTtyMode(struct __pyx_obj_6brlapi_Connection *__pyx_v_self) {
  int __pyx_v_retval;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("leaveTtyMode", 0);

  /* "brlapi.pyx":590
 * 		See brlapi_leaveTtyMode(3)."""
 * 		cdef int retval
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__leaveTtyMode(self.h)
 * 		if retval == -1:
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "brlapi.pyx":591
 * 		cdef int retval
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__leaveTtyMode(self.h)             # <<<<<<<<<<<<<<
 * 		if retval == -1:
 * 			raise OperationError()
 */
        __pyx_v_retval = brlapi__leaveTtyMode(__pyx_v_self->h);
      }

      /* "brlapi.pyx":590
 * 		See brlapi_leaveTtyMode(3)."""
 * 		cdef int retval
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__leaveTtyMode(self.h)
 * 		if retval == -1:
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "brlapi.pyx":592
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__leaveTtyMode(self.h)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 		else:
 */
  __pyx_t_1 = ((__pyx_v_retval == -1L) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "brlapi.pyx":593
 * 			retval = c_brlapi.brlapi__leaveTtyMode(self.h)
 * 		if retval == -1:
 * 			raise OperationError()             # <<<<<<<<<<<<<<
 * 		else:
 * 			return retval
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_OperationError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_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, 593, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 593, __pyx_L1_error)

    /* "brlapi.pyx":592
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__leaveTtyMode(self.h)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 		else:
 */
  }

  /* "brlapi.pyx":595
 * 			raise OperationError()
 * 		else:
 * 			return retval             # <<<<<<<<<<<<<<
 * 
 * 	def setFocus(self, tty):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_retval); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "brlapi.pyx":586
 * 			return retval
 * 
 * 	def leaveTtyMode(self):             # <<<<<<<<<<<<<<
 * 		"""Stop controlling the tty
 * 		See brlapi_leaveTtyMode(3)."""
 */

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

/* "brlapi.pyx":597
 * 			return retval
 * 
 * 	def setFocus(self, tty):             # <<<<<<<<<<<<<<
 * 		"""Tell the current tty to brltty.
 * 		See brlapi_setFocus(3).
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_13setFocus(PyObject *__pyx_v_self, PyObject *__pyx_v_tty); /*proto*/
static char __pyx_doc_6brlapi_10Connection_12setFocus[] = "Connection.setFocus(self, tty)\nTell the current tty to brltty.\n\t\tSee brlapi_setFocus(3).\n\t\tThis is intended for focus tellers, such as brltty, xbrlapi, screen, ... enterTtyMode() must have been called before hand to tell where this focus applies in the tty tree.";
static PyObject *__pyx_pw_6brlapi_10Connection_13setFocus(PyObject *__pyx_v_self, PyObject *__pyx_v_tty) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setFocus (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_10Connection_12setFocus(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self), ((PyObject *)__pyx_v_tty));

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

static PyObject *__pyx_pf_6brlapi_10Connection_12setFocus(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_tty) {
  int __pyx_v_retval;
  int __pyx_v_c_tty;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setFocus", 0);

  /* "brlapi.pyx":603
 * 		cdef int retval
 * 		cdef int c_tty
 * 		c_tty = tty             # <<<<<<<<<<<<<<
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__setFocus(self.h, c_tty)
 */
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_tty); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 603, __pyx_L1_error)
  __pyx_v_c_tty = __pyx_t_1;

  /* "brlapi.pyx":604
 * 		cdef int c_tty
 * 		c_tty = tty
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__setFocus(self.h, c_tty)
 * 		if retval == -1:
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "brlapi.pyx":605
 * 		c_tty = tty
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__setFocus(self.h, c_tty)             # <<<<<<<<<<<<<<
 * 		if retval == -1:
 * 			raise OperationError()
 */
        __pyx_v_retval = brlapi__setFocus(__pyx_v_self->h, __pyx_v_c_tty);
      }

      /* "brlapi.pyx":604
 * 		cdef int c_tty
 * 		c_tty = tty
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__setFocus(self.h, c_tty)
 * 		if retval == -1:
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "brlapi.pyx":606
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__setFocus(self.h, c_tty)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 		else:
 */
  __pyx_t_2 = ((__pyx_v_retval == -1L) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "brlapi.pyx":607
 * 			retval = c_brlapi.brlapi__setFocus(self.h, c_tty)
 * 		if retval == -1:
 * 			raise OperationError()             # <<<<<<<<<<<<<<
 * 		else:
 * 			return retval
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_OperationError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 607, __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_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 607, __pyx_L1_error)

    /* "brlapi.pyx":606
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__setFocus(self.h, c_tty)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 		else:
 */
  }

  /* "brlapi.pyx":609
 * 			raise OperationError()
 * 		else:
 * 			return retval             # <<<<<<<<<<<<<<
 * 
 * 	# The writeArguments parameter must remain first (after self) in order
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_retval); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "brlapi.pyx":597
 * 			return retval
 * 
 * 	def setFocus(self, tty):             # <<<<<<<<<<<<<<
 * 		"""Tell the current tty to brltty.
 * 		See brlapi_setFocus(3).
 */

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

/* "brlapi.pyx":616
 * 	# it once it's no longer being used. New code should supply attributes
 * 	# by specifying the remaining parameters, as needed, by name.
 * 	def write(self, WriteStruct writeArguments = None,             # <<<<<<<<<<<<<<
 * 			displayNumber = None,
 * 			regionBegin = None,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_15write(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6brlapi_10Connection_14write[] = "Connection.write(self, WriteStruct writeArguments=None, displayNumber=None, regionBegin=None, regionSize=None, text=None, andMask=None, orMask=None, cursor=None, charset=None)\nUpdate a specific region of the braille display and apply and/or masks.\n\t\tSee brlapi_write(3).\n\t\t* s : gives information necessary for the update";
static PyObject *__pyx_pw_6brlapi_10Connection_15write(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_writeArguments = 0;
  PyObject *__pyx_v_displayNumber = 0;
  PyObject *__pyx_v_regionBegin = 0;
  PyObject *__pyx_v_regionSize = 0;
  PyObject *__pyx_v_text = 0;
  PyObject *__pyx_v_andMask = 0;
  PyObject *__pyx_v_orMask = 0;
  PyObject *__pyx_v_cursor = 0;
  PyObject *__pyx_v_charset = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_writeArguments,&__pyx_n_s_displayNumber,&__pyx_n_s_regionBegin,&__pyx_n_s_regionSize,&__pyx_n_s_text,&__pyx_n_s_andMask,&__pyx_n_s_orMask,&__pyx_n_s_cursor,&__pyx_n_s_charset,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    values[0] = (PyObject *)((struct __pyx_obj_6brlapi_WriteStruct *)Py_None);

    /* "brlapi.pyx":617
 * 	# by specifying the remaining parameters, as needed, by name.
 * 	def write(self, WriteStruct writeArguments = None,
 * 			displayNumber = None,             # <<<<<<<<<<<<<<
 * 			regionBegin = None,
 * 			regionSize = None,
 */
    values[1] = ((PyObject *)Py_None);

    /* "brlapi.pyx":618
 * 	def write(self, WriteStruct writeArguments = None,
 * 			displayNumber = None,
 * 			regionBegin = None,             # <<<<<<<<<<<<<<
 * 			regionSize = None,
 * 			text = None,
 */
    values[2] = ((PyObject *)Py_None);

    /* "brlapi.pyx":619
 * 			displayNumber = None,
 * 			regionBegin = None,
 * 			regionSize = None,             # <<<<<<<<<<<<<<
 * 			text = None,
 * 			andMask = None,
 */
    values[3] = ((PyObject *)Py_None);

    /* "brlapi.pyx":620
 * 			regionBegin = None,
 * 			regionSize = None,
 * 			text = None,             # <<<<<<<<<<<<<<
 * 			andMask = None,
 * 			orMask = None,
 */
    values[4] = ((PyObject *)Py_None);

    /* "brlapi.pyx":621
 * 			regionSize = None,
 * 			text = None,
 * 			andMask = None,             # <<<<<<<<<<<<<<
 * 			orMask = None,
 * 			cursor = None,
 */
    values[5] = ((PyObject *)Py_None);

    /* "brlapi.pyx":622
 * 			text = None,
 * 			andMask = None,
 * 			orMask = None,             # <<<<<<<<<<<<<<
 * 			cursor = None,
 * 			charset = None):
 */
    values[6] = ((PyObject *)Py_None);

    /* "brlapi.pyx":623
 * 			andMask = None,
 * 			orMask = None,
 * 			cursor = None,             # <<<<<<<<<<<<<<
 * 			charset = None):
 * 		"""Update a specific region of the braille display and apply and/or masks.
 */
    values[7] = ((PyObject *)Py_None);

    /* "brlapi.pyx":624
 * 			orMask = None,
 * 			cursor = None,
 * 			charset = None):             # <<<<<<<<<<<<<<
 * 		"""Update a specific region of the braille display and apply and/or masks.
 * 		See brlapi_write(3).
 */
    values[8] = ((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  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_writeArguments);
          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_displayNumber);
          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_regionBegin);
          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_regionSize);
          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_text);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_andMask);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_orMask);
          if (value) { values[6] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cursor);
          if (value) { values[7] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_charset);
          if (value) { values[8] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write") < 0)) __PYX_ERR(0, 616, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_writeArguments = ((struct __pyx_obj_6brlapi_WriteStruct *)values[0]);
    __pyx_v_displayNumber = values[1];
    __pyx_v_regionBegin = values[2];
    __pyx_v_regionSize = values[3];
    __pyx_v_text = values[4];
    __pyx_v_andMask = values[5];
    __pyx_v_orMask = values[6];
    __pyx_v_cursor = values[7];
    __pyx_v_charset = values[8];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write", 0, 0, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 616, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("brlapi.Connection.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_writeArguments), __pyx_ptype_6brlapi_WriteStruct, 1, "writeArguments", 0))) __PYX_ERR(0, 616, __pyx_L1_error)
  __pyx_r = __pyx_pf_6brlapi_10Connection_14write(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self), __pyx_v_writeArguments, __pyx_v_displayNumber, __pyx_v_regionBegin, __pyx_v_regionSize, __pyx_v_text, __pyx_v_andMask, __pyx_v_orMask, __pyx_v_cursor, __pyx_v_charset);

  /* "brlapi.pyx":616
 * 	# it once it's no longer being used. New code should supply attributes
 * 	# by specifying the remaining parameters, as needed, by name.
 * 	def write(self, WriteStruct writeArguments = None,             # <<<<<<<<<<<<<<
 * 			displayNumber = None,
 * 			regionBegin = None,
 */

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

static PyObject *__pyx_pf_6brlapi_10Connection_14write(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_writeArguments, PyObject *__pyx_v_displayNumber, PyObject *__pyx_v_regionBegin, PyObject *__pyx_v_regionSize, PyObject *__pyx_v_text, PyObject *__pyx_v_andMask, PyObject *__pyx_v_orMask, PyObject *__pyx_v_cursor, PyObject *__pyx_v_charset) {
  int __pyx_v_retval;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_writeArguments);

  /* "brlapi.pyx":629
 * 		* s : gives information necessary for the update"""
 * 		cdef int retval
 * 		if not writeArguments:             # <<<<<<<<<<<<<<
 * 			writeArguments = WriteStruct()
 * 		if displayNumber != None:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_writeArguments)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 629, __pyx_L1_error)
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "brlapi.pyx":630
 * 		cdef int retval
 * 		if not writeArguments:
 * 			writeArguments = WriteStruct()             # <<<<<<<<<<<<<<
 * 		if displayNumber != None:
 * 			writeArguments.displayNumber = displayNumber
 */
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6brlapi_WriteStruct)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 630, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_writeArguments, ((struct __pyx_obj_6brlapi_WriteStruct *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "brlapi.pyx":629
 * 		* s : gives information necessary for the update"""
 * 		cdef int retval
 * 		if not writeArguments:             # <<<<<<<<<<<<<<
 * 			writeArguments = WriteStruct()
 * 		if displayNumber != None:
 */
  }

  /* "brlapi.pyx":631
 * 		if not writeArguments:
 * 			writeArguments = WriteStruct()
 * 		if displayNumber != None:             # <<<<<<<<<<<<<<
 * 			writeArguments.displayNumber = displayNumber
 * 		if regionBegin != None:
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_displayNumber, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 631, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "brlapi.pyx":632
 * 			writeArguments = WriteStruct()
 * 		if displayNumber != None:
 * 			writeArguments.displayNumber = displayNumber             # <<<<<<<<<<<<<<
 * 		if regionBegin != None:
 * 			writeArguments.regionBegin = regionBegin
 */
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_writeArguments), __pyx_n_s_displayNumber, __pyx_v_displayNumber) < 0) __PYX_ERR(0, 632, __pyx_L1_error)

    /* "brlapi.pyx":631
 * 		if not writeArguments:
 * 			writeArguments = WriteStruct()
 * 		if displayNumber != None:             # <<<<<<<<<<<<<<
 * 			writeArguments.displayNumber = displayNumber
 * 		if regionBegin != None:
 */
  }

  /* "brlapi.pyx":633
 * 		if displayNumber != None:
 * 			writeArguments.displayNumber = displayNumber
 * 		if regionBegin != None:             # <<<<<<<<<<<<<<
 * 			writeArguments.regionBegin = regionBegin
 * 		if regionSize != None:
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_regionBegin, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 633, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 633, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "brlapi.pyx":634
 * 			writeArguments.displayNumber = displayNumber
 * 		if regionBegin != None:
 * 			writeArguments.regionBegin = regionBegin             # <<<<<<<<<<<<<<
 * 		if regionSize != None:
 * 			writeArguments.regionSize = regionSize
 */
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_writeArguments), __pyx_n_s_regionBegin, __pyx_v_regionBegin) < 0) __PYX_ERR(0, 634, __pyx_L1_error)

    /* "brlapi.pyx":633
 * 		if displayNumber != None:
 * 			writeArguments.displayNumber = displayNumber
 * 		if regionBegin != None:             # <<<<<<<<<<<<<<
 * 			writeArguments.regionBegin = regionBegin
 * 		if regionSize != None:
 */
  }

  /* "brlapi.pyx":635
 * 		if regionBegin != None:
 * 			writeArguments.regionBegin = regionBegin
 * 		if regionSize != None:             # <<<<<<<<<<<<<<
 * 			writeArguments.regionSize = regionSize
 * 		if text:
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_regionSize, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 635, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 635, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "brlapi.pyx":636
 * 			writeArguments.regionBegin = regionBegin
 * 		if regionSize != None:
 * 			writeArguments.regionSize = regionSize             # <<<<<<<<<<<<<<
 * 		if text:
 * 			writeArguments.text = text
 */
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_writeArguments), __pyx_n_s_regionSize, __pyx_v_regionSize) < 0) __PYX_ERR(0, 636, __pyx_L1_error)

    /* "brlapi.pyx":635
 * 		if regionBegin != None:
 * 			writeArguments.regionBegin = regionBegin
 * 		if regionSize != None:             # <<<<<<<<<<<<<<
 * 			writeArguments.regionSize = regionSize
 * 		if text:
 */
  }

  /* "brlapi.pyx":637
 * 		if regionSize != None:
 * 			writeArguments.regionSize = regionSize
 * 		if text:             # <<<<<<<<<<<<<<
 * 			writeArguments.text = text
 * 		if andMask:
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_text); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 637, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "brlapi.pyx":638
 * 			writeArguments.regionSize = regionSize
 * 		if text:
 * 			writeArguments.text = text             # <<<<<<<<<<<<<<
 * 		if andMask:
 * 			writeArguments.attrAnd = andMask
 */
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_writeArguments), __pyx_n_s_text, __pyx_v_text) < 0) __PYX_ERR(0, 638, __pyx_L1_error)

    /* "brlapi.pyx":637
 * 		if regionSize != None:
 * 			writeArguments.regionSize = regionSize
 * 		if text:             # <<<<<<<<<<<<<<
 * 			writeArguments.text = text
 * 		if andMask:
 */
  }

  /* "brlapi.pyx":639
 * 		if text:
 * 			writeArguments.text = text
 * 		if andMask:             # <<<<<<<<<<<<<<
 * 			writeArguments.attrAnd = andMask
 * 		if orMask:
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_andMask); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 639, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "brlapi.pyx":640
 * 			writeArguments.text = text
 * 		if andMask:
 * 			writeArguments.attrAnd = andMask             # <<<<<<<<<<<<<<
 * 		if orMask:
 * 			writeArguments.attrOr = orMask
 */
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_writeArguments), __pyx_n_s_attrAnd, __pyx_v_andMask) < 0) __PYX_ERR(0, 640, __pyx_L1_error)

    /* "brlapi.pyx":639
 * 		if text:
 * 			writeArguments.text = text
 * 		if andMask:             # <<<<<<<<<<<<<<
 * 			writeArguments.attrAnd = andMask
 * 		if orMask:
 */
  }

  /* "brlapi.pyx":641
 * 		if andMask:
 * 			writeArguments.attrAnd = andMask
 * 		if orMask:             # <<<<<<<<<<<<<<
 * 			writeArguments.attrOr = orMask
 * 		if cursor != None:
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_orMask); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 641, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "brlapi.pyx":642
 * 			writeArguments.attrAnd = andMask
 * 		if orMask:
 * 			writeArguments.attrOr = orMask             # <<<<<<<<<<<<<<
 * 		if cursor != None:
 * 			writeArguments.cursor = cursor
 */
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_writeArguments), __pyx_n_s_attrOr, __pyx_v_orMask) < 0) __PYX_ERR(0, 642, __pyx_L1_error)

    /* "brlapi.pyx":641
 * 		if andMask:
 * 			writeArguments.attrAnd = andMask
 * 		if orMask:             # <<<<<<<<<<<<<<
 * 			writeArguments.attrOr = orMask
 * 		if cursor != None:
 */
  }

  /* "brlapi.pyx":643
 * 		if orMask:
 * 			writeArguments.attrOr = orMask
 * 		if cursor != None:             # <<<<<<<<<<<<<<
 * 			writeArguments.cursor = cursor
 * 		if charset:
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_cursor, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 643, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 643, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "brlapi.pyx":644
 * 			writeArguments.attrOr = orMask
 * 		if cursor != None:
 * 			writeArguments.cursor = cursor             # <<<<<<<<<<<<<<
 * 		if charset:
 * 			writeArguments.charset = charset
 */
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_writeArguments), __pyx_n_s_cursor, __pyx_v_cursor) < 0) __PYX_ERR(0, 644, __pyx_L1_error)

    /* "brlapi.pyx":643
 * 		if orMask:
 * 			writeArguments.attrOr = orMask
 * 		if cursor != None:             # <<<<<<<<<<<<<<
 * 			writeArguments.cursor = cursor
 * 		if charset:
 */
  }

  /* "brlapi.pyx":645
 * 		if cursor != None:
 * 			writeArguments.cursor = cursor
 * 		if charset:             # <<<<<<<<<<<<<<
 * 			writeArguments.charset = charset
 * 		with nogil:
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_charset); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 645, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "brlapi.pyx":646
 * 			writeArguments.cursor = cursor
 * 		if charset:
 * 			writeArguments.charset = charset             # <<<<<<<<<<<<<<
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__write(self.h, &writeArguments.props)
 */
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_writeArguments), __pyx_n_s_charset, __pyx_v_charset) < 0) __PYX_ERR(0, 646, __pyx_L1_error)

    /* "brlapi.pyx":645
 * 		if cursor != None:
 * 			writeArguments.cursor = cursor
 * 		if charset:             # <<<<<<<<<<<<<<
 * 			writeArguments.charset = charset
 * 		with nogil:
 */
  }

  /* "brlapi.pyx":647
 * 		if charset:
 * 			writeArguments.charset = charset
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__write(self.h, &writeArguments.props)
 * 		if retval == -1:
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "brlapi.pyx":648
 * 			writeArguments.charset = charset
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__write(self.h, &writeArguments.props)             # <<<<<<<<<<<<<<
 * 		if retval == -1:
 * 			raise OperationError()
 */
        __pyx_v_retval = brlapi__write(__pyx_v_self->h, (&__pyx_v_writeArguments->props));
      }

      /* "brlapi.pyx":647
 * 		if charset:
 * 			writeArguments.charset = charset
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__write(self.h, &writeArguments.props)
 * 		if retval == -1:
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L14;
        }
        __pyx_L14:;
      }
  }

  /* "brlapi.pyx":649
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__write(self.h, &writeArguments.props)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 		else:
 */
  __pyx_t_2 = ((__pyx_v_retval == -1L) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "brlapi.pyx":650
 * 			retval = c_brlapi.brlapi__write(self.h, &writeArguments.props)
 * 		if retval == -1:
 * 			raise OperationError()             # <<<<<<<<<<<<<<
 * 		else:
 * 			return retval
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_OperationError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 650, __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_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 650, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 650, __pyx_L1_error)

    /* "brlapi.pyx":649
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__write(self.h, &writeArguments.props)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 		else:
 */
  }

  /* "brlapi.pyx":652
 * 			raise OperationError()
 * 		else:
 * 			return retval             # <<<<<<<<<<<<<<
 * 
 * 	def writeDots(self, dots):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_retval); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "brlapi.pyx":616
 * 	# it once it's no longer being used. New code should supply attributes
 * 	# by specifying the remaining parameters, as needed, by name.
 * 	def write(self, WriteStruct writeArguments = None,             # <<<<<<<<<<<<<<
 * 			displayNumber = None,
 * 			regionBegin = None,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("brlapi.Connection.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_writeArguments);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":654
 * 			return retval
 * 
 * 	def writeDots(self, dots):             # <<<<<<<<<<<<<<
 * 		"""Write the given dots array to the display.
 * 		See brlapi_writeDots(3).
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_17writeDots(PyObject *__pyx_v_self, PyObject *__pyx_v_dots); /*proto*/
static char __pyx_doc_6brlapi_10Connection_16writeDots[] = "Connection.writeDots(self, dots)\nWrite the given dots array to the display.\n\t\tSee brlapi_writeDots(3).\n\t\t* dots : points on an array of dot information, one per character. Its size must hence be the same as what displaysize provides.";
static PyObject *__pyx_pw_6brlapi_10Connection_17writeDots(PyObject *__pyx_v_self, PyObject *__pyx_v_dots) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("writeDots (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_10Connection_16writeDots(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self), ((PyObject *)__pyx_v_dots));

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

static PyObject *__pyx_pf_6brlapi_10Connection_16writeDots(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_dots) {
  int __pyx_v_retval;
  char *__pyx_v_c_dots;
  unsigned char *__pyx_v_c_udots;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_v_dispSize = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  char *__pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("writeDots", 0);
  __Pyx_INCREF(__pyx_v_dots);

  /* "brlapi.pyx":661
 * 		cdef char *c_dots
 * 		cdef unsigned char *c_udots
 * 		(x, y) = self.displaySize             # <<<<<<<<<<<<<<
 * 		dispSize = x * y
 * 		if (type(dots) == unicode):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_displaySize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __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, 661, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 661, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 661, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_x = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_y = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "brlapi.pyx":662
 * 		cdef unsigned char *c_udots
 * 		(x, y) = self.displaySize
 * 		dispSize = x * y             # <<<<<<<<<<<<<<
 * 		if (type(dots) == unicode):
 * 			dots = dots.encode('latin1')
 */
  __pyx_t_1 = PyNumber_Multiply(__pyx_v_x, __pyx_v_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_dispSize = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "brlapi.pyx":663
 * 		(x, y) = self.displaySize
 * 		dispSize = x * y
 * 		if (type(dots) == unicode):             # <<<<<<<<<<<<<<
 * 			dots = dots.encode('latin1')
 * 		if (len(dots) < dispSize):
 */
  __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_dots)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 663, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 663, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {

    /* "brlapi.pyx":664
 * 		dispSize = x * y
 * 		if (type(dots) == unicode):
 * 			dots = dots.encode('latin1')             # <<<<<<<<<<<<<<
 * 		if (len(dots) < dispSize):
 * 			dots = dots + b"".center(dispSize - len(dots), b'\0')
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dots, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 664, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_n_u_latin1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_n_u_latin1);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 664, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_dots, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "brlapi.pyx":663
 * 		(x, y) = self.displaySize
 * 		dispSize = x * y
 * 		if (type(dots) == unicode):             # <<<<<<<<<<<<<<
 * 			dots = dots.encode('latin1')
 * 		if (len(dots) < dispSize):
 */
  }

  /* "brlapi.pyx":665
 * 		if (type(dots) == unicode):
 * 			dots = dots.encode('latin1')
 * 		if (len(dots) < dispSize):             # <<<<<<<<<<<<<<
 * 			dots = dots + b"".center(dispSize - len(dots), b'\0')
 * 		c_dots = dots
 */
  __pyx_t_7 = PyObject_Length(__pyx_v_dots); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 665, __pyx_L1_error)
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dispSize, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 665, __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, 665, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_6) {

    /* "brlapi.pyx":666
 * 			dots = dots.encode('latin1')
 * 		if (len(dots) < dispSize):
 * 			dots = dots + b"".center(dispSize - len(dots), b'\0')             # <<<<<<<<<<<<<<
 * 		c_dots = dots
 * 		c_udots = <unsigned char *>c_dots
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_b__2, __pyx_n_s_center); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = PyObject_Length(__pyx_v_dots); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 666, __pyx_L1_error)
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_dispSize, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_4, __pyx_kp_b__10};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 666, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_4, __pyx_kp_b__10};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 666, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 666, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_2) {
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); __pyx_t_2 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_4);
      __Pyx_INCREF(__pyx_kp_b__10);
      __Pyx_GIVEREF(__pyx_kp_b__10);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_kp_b__10);
      __pyx_t_4 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 666, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Add(__pyx_v_dots, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_dots, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "brlapi.pyx":665
 * 		if (type(dots) == unicode):
 * 			dots = dots.encode('latin1')
 * 		if (len(dots) < dispSize):             # <<<<<<<<<<<<<<
 * 			dots = dots + b"".center(dispSize - len(dots), b'\0')
 * 		c_dots = dots
 */
  }

  /* "brlapi.pyx":667
 * 		if (len(dots) < dispSize):
 * 			dots = dots + b"".center(dispSize - len(dots), b'\0')
 * 		c_dots = dots             # <<<<<<<<<<<<<<
 * 		c_udots = <unsigned char *>c_dots
 * 		with nogil:
 */
  __pyx_t_10 = __Pyx_PyObject_AsWritableString(__pyx_v_dots); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 667, __pyx_L1_error)
  __pyx_v_c_dots = __pyx_t_10;

  /* "brlapi.pyx":668
 * 			dots = dots + b"".center(dispSize - len(dots), b'\0')
 * 		c_dots = dots
 * 		c_udots = <unsigned char *>c_dots             # <<<<<<<<<<<<<<
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__writeDots(self.h, c_udots)
 */
  __pyx_v_c_udots = ((unsigned char *)__pyx_v_c_dots);

  /* "brlapi.pyx":669
 * 		c_dots = dots
 * 		c_udots = <unsigned char *>c_dots
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__writeDots(self.h, c_udots)
 * 		if retval == -1:
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "brlapi.pyx":670
 * 		c_udots = <unsigned char *>c_dots
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__writeDots(self.h, c_udots)             # <<<<<<<<<<<<<<
 * 		if retval == -1:
 * 			raise OperationError()
 */
        __pyx_v_retval = brlapi__writeDots(__pyx_v_self->h, __pyx_v_c_udots);
      }

      /* "brlapi.pyx":669
 * 		c_dots = dots
 * 		c_udots = <unsigned char *>c_dots
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__writeDots(self.h, c_udots)
 * 		if retval == -1:
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L9;
        }
        __pyx_L9:;
      }
  }

  /* "brlapi.pyx":671
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__writeDots(self.h, c_udots)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 		else:
 */
  __pyx_t_6 = ((__pyx_v_retval == -1L) != 0);
  if (unlikely(__pyx_t_6)) {

    /* "brlapi.pyx":672
 * 			retval = c_brlapi.brlapi__writeDots(self.h, c_udots)
 * 		if retval == -1:
 * 			raise OperationError()             # <<<<<<<<<<<<<<
 * 		else:
 * 			return retval
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_OperationError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 672, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 672, __pyx_L1_error)

    /* "brlapi.pyx":671
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__writeDots(self.h, c_udots)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 		else:
 */
  }

  /* "brlapi.pyx":674
 * 			raise OperationError()
 * 		else:
 * 			return retval             # <<<<<<<<<<<<<<
 * 
 * 	def writeText(self, text, cursor = CURSOR_OFF):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_retval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 674, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "brlapi.pyx":654
 * 			return retval
 * 
 * 	def writeDots(self, dots):             # <<<<<<<<<<<<<<
 * 		"""Write the given dots array to the display.
 * 		See brlapi_writeDots(3).
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("brlapi.Connection.writeDots", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XDECREF(__pyx_v_dispSize);
  __Pyx_XDECREF(__pyx_v_dots);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":676
 * 			return retval
 * 
 * 	def writeText(self, text, cursor = CURSOR_OFF):             # <<<<<<<<<<<<<<
 * 		"""Write the given \0-terminated string to the braille display.
 * 		See brlapi_writeText(3).
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_19writeText(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6brlapi_10Connection_18writeText[] = "Connection.writeText(self, text, cursor=CURSOR_OFF)\nWrite the given \000-terminated string to the braille display.\n\t\tSee brlapi_writeText(3).\n\t\tIf the string is too long, it is cut. If it's too short, spaces are appended. The current LC_CTYPE locale is considered, unless it is left as default \"C\", in which case the charset is assumed to be 8bits, and the same as the server's.\n\n\t\t* cursor : gives the cursor position; if equal to CURSOR_OFF, no cursor is shown at all; if cursor == CURSOR_LEAVE, the cursor is left where it is\n\t\t* text : points to the string to be displayed";
static PyObject *__pyx_pw_6brlapi_10Connection_19writeText(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_text = 0;
  PyObject *__pyx_v_cursor = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("writeText (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_text,&__pyx_n_s_cursor,0};
    PyObject* values[2] = {0,0};
    values[1] = __pyx_k__11;
    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_text)) != 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_cursor);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "writeText") < 0)) __PYX_ERR(0, 676, __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_text = values[0];
    __pyx_v_cursor = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("writeText", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 676, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("brlapi.Connection.writeText", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6brlapi_10Connection_18writeText(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self), __pyx_v_text, __pyx_v_cursor);

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

static PyObject *__pyx_pf_6brlapi_10Connection_18writeText(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_text, PyObject *__pyx_v_cursor) {
  struct __pyx_obj_6brlapi_WriteStruct *__pyx_v_w = NULL;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_v_dispSize = 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 *);
  Py_ssize_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("writeText", 0);
  __Pyx_INCREF(__pyx_v_text);

  /* "brlapi.pyx":683
 * 		* cursor : gives the cursor position; if equal to CURSOR_OFF, no cursor is shown at all; if cursor == CURSOR_LEAVE, the cursor is left where it is
 * 		* text : points to the string to be displayed"""
 * 		w = WriteStruct()             # <<<<<<<<<<<<<<
 * 		w.cursor = cursor
 * 		if text is not None:
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6brlapi_WriteStruct)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_w = ((struct __pyx_obj_6brlapi_WriteStruct *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "brlapi.pyx":684
 * 		* text : points to the string to be displayed"""
 * 		w = WriteStruct()
 * 		w.cursor = cursor             # <<<<<<<<<<<<<<
 * 		if text is not None:
 * 			(x, y) = self.displaySize
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_w), __pyx_n_s_cursor, __pyx_v_cursor) < 0) __PYX_ERR(0, 684, __pyx_L1_error)

  /* "brlapi.pyx":685
 * 		w = WriteStruct()
 * 		w.cursor = cursor
 * 		if text is not None:             # <<<<<<<<<<<<<<
 * 			(x, y) = self.displaySize
 * 			dispSize = x * y
 */
  __pyx_t_2 = (__pyx_v_text != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "brlapi.pyx":686
 * 		w.cursor = cursor
 * 		if text is not None:
 * 			(x, y) = self.displaySize             # <<<<<<<<<<<<<<
 * 			dispSize = x * y
 * 			if (len(text) < dispSize):
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_displaySize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __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, 686, __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, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 686, __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, 686, __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, 686, __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, 686, __pyx_L1_error)
      __pyx_L5_unpacking_done:;
    }
    __pyx_v_x = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_v_y = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "brlapi.pyx":687
 * 		if text is not None:
 * 			(x, y) = self.displaySize
 * 			dispSize = x * y             # <<<<<<<<<<<<<<
 * 			if (len(text) < dispSize):
 * 				text = text + "".center(dispSize - len(text))
 */
    __pyx_t_1 = PyNumber_Multiply(__pyx_v_x, __pyx_v_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_dispSize = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "brlapi.pyx":688
 * 			(x, y) = self.displaySize
 * 			dispSize = x * y
 * 			if (len(text) < dispSize):             # <<<<<<<<<<<<<<
 * 				text = text + "".center(dispSize - len(text))
 * 			w.regionBegin = 1
 */
    __pyx_t_8 = PyObject_Length(__pyx_v_text); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 688, __pyx_L1_error)
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dispSize, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 688, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 688, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_3) {

      /* "brlapi.pyx":689
 * 			dispSize = x * y
 * 			if (len(text) < dispSize):
 * 				text = text + "".center(dispSize - len(text))             # <<<<<<<<<<<<<<
 * 			w.regionBegin = 1
 * 			w.regionSize = dispSize
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u__2, __pyx_n_s_center); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = PyObject_Length(__pyx_v_text); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 689, __pyx_L1_error)
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 689, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = PyNumber_Subtract(__pyx_v_dispSize, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 689, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_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_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 689, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_Add(__pyx_v_text, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_text, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "brlapi.pyx":688
 * 			(x, y) = self.displaySize
 * 			dispSize = x * y
 * 			if (len(text) < dispSize):             # <<<<<<<<<<<<<<
 * 				text = text + "".center(dispSize - len(text))
 * 			w.regionBegin = 1
 */
    }

    /* "brlapi.pyx":690
 * 			if (len(text) < dispSize):
 * 				text = text + "".center(dispSize - len(text))
 * 			w.regionBegin = 1             # <<<<<<<<<<<<<<
 * 			w.regionSize = dispSize
 * 			w.text = text[0 : dispSize]
 */
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_w), __pyx_n_s_regionBegin, __pyx_int_1) < 0) __PYX_ERR(0, 690, __pyx_L1_error)

    /* "brlapi.pyx":691
 * 				text = text + "".center(dispSize - len(text))
 * 			w.regionBegin = 1
 * 			w.regionSize = dispSize             # <<<<<<<<<<<<<<
 * 			w.text = text[0 : dispSize]
 * 		return self.write(w)
 */
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_w), __pyx_n_s_regionSize, __pyx_v_dispSize) < 0) __PYX_ERR(0, 691, __pyx_L1_error)

    /* "brlapi.pyx":692
 * 			w.regionBegin = 1
 * 			w.regionSize = dispSize
 * 			w.text = text[0 : dispSize]             # <<<<<<<<<<<<<<
 * 		return self.write(w)
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_text, 0, 0, NULL, &__pyx_v_dispSize, NULL, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_w), __pyx_n_s_text, __pyx_t_1) < 0) __PYX_ERR(0, 692, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "brlapi.pyx":685
 * 		w = WriteStruct()
 * 		w.cursor = cursor
 * 		if text is not None:             # <<<<<<<<<<<<<<
 * 			(x, y) = self.displaySize
 * 			dispSize = x * y
 */
  }

  /* "brlapi.pyx":693
 * 			w.regionSize = dispSize
 * 			w.text = text[0 : dispSize]
 * 		return self.write(w)             # <<<<<<<<<<<<<<
 * 
 * 	def readKey(self, wait = True):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, ((PyObject *)__pyx_v_w)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_w));
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "brlapi.pyx":676
 * 			return retval
 * 
 * 	def writeText(self, text, cursor = CURSOR_OFF):             # <<<<<<<<<<<<<<
 * 		"""Write the given \0-terminated string to the braille display.
 * 		See brlapi_writeText(3).
 */

  /* 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("brlapi.Connection.writeText", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_w);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XDECREF(__pyx_v_dispSize);
  __Pyx_XDECREF(__pyx_v_text);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":695
 * 		return self.write(w)
 * 
 * 	def readKey(self, wait = True):             # <<<<<<<<<<<<<<
 * 		"""Read a key from the braille keyboard.
 * 		See brlapi_readKey(3).
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_21readKey(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6brlapi_10Connection_20readKey[] = "Connection.readKey(self, wait=True)\nRead a key from the braille keyboard.\n\t\tSee brlapi_readKey(3).\n\n\t\tThis function returns one key press's code.\n\n\t\tIf None or \"\" was given to enterTtyPath(), a brltty command is returned. It is hence pretty driver-independent, and should be used by default when no other option is possible.\n\n\t\tBy default, all commands but those which restart drivers and switch virtual are returned to the application and not to brltty. If the application doesn't want to see some command events, it should call either ignoreKeys() or ignoreKeyRanges().\n\n\t\tIf some driver name was given to enterTtyMode(), a raw keycode is returned, as specified by the terminal driver. It generally corresponds to the very code that the terminal tells to the driver. This should only be used by applications which are dedicated to a particular braille terminal. Hence, checking the terminal type thanks to a call to drivername before getting tty control is a pretty good idea.\n\n\t\tBy default, all the keypresses will be passed to the client, none will go through brltty, so the application will have to handle console switching itself for instance.";
static PyObject *__pyx_pw_6brlapi_10Connection_21readKey(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_wait = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("readKey (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_wait,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_wait);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "readKey") < 0)) __PYX_ERR(0, 695, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_wait = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("readKey", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 695, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("brlapi.Connection.readKey", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6brlapi_10Connection_20readKey(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self), __pyx_v_wait);

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

static PyObject *__pyx_pf_6brlapi_10Connection_20readKey(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_wait) {
  brlapi_keyCode_t __pyx_v_code;
  int __pyx_v_retval;
  int __pyx_v_c_wait;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("readKey", 0);

  /* "brlapi.pyx":711
 * 		cdef int retval
 * 		cdef int c_wait
 * 		c_wait = wait             # <<<<<<<<<<<<<<
 * 
 * 		while True:
 */
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_wait); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 711, __pyx_L1_error)
  __pyx_v_c_wait = __pyx_t_1;

  /* "brlapi.pyx":713
 * 		c_wait = wait
 * 
 * 		while True:             # <<<<<<<<<<<<<<
 * 			with nogil:
 * 				retval = c_brlapi.brlapi__readKey(self.h, c_wait, <c_brlapi.brlapi_keyCode_t*>&code)
 */
  while (1) {

    /* "brlapi.pyx":714
 * 
 * 		while True:
 * 			with nogil:             # <<<<<<<<<<<<<<
 * 				retval = c_brlapi.brlapi__readKey(self.h, c_wait, <c_brlapi.brlapi_keyCode_t*>&code)
 * 			if retval == -1 and not (c_brlapi.brlapi_error.brlerrno == ERROR_LIBCERR and c_brlapi.brlapi_error.libcerrno == errno.EINTR):
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "brlapi.pyx":715
 * 		while True:
 * 			with nogil:
 * 				retval = c_brlapi.brlapi__readKey(self.h, c_wait, <c_brlapi.brlapi_keyCode_t*>&code)             # <<<<<<<<<<<<<<
 * 			if retval == -1 and not (c_brlapi.brlapi_error.brlerrno == ERROR_LIBCERR and c_brlapi.brlapi_error.libcerrno == errno.EINTR):
 * 				raise OperationError()
 */
          __pyx_v_retval = brlapi__readKey(__pyx_v_self->h, __pyx_v_c_wait, ((brlapi_keyCode_t *)(&__pyx_v_code)));
        }

        /* "brlapi.pyx":714
 * 
 * 		while True:
 * 			with nogil:             # <<<<<<<<<<<<<<
 * 				retval = c_brlapi.brlapi__readKey(self.h, c_wait, <c_brlapi.brlapi_keyCode_t*>&code)
 * 			if retval == -1 and not (c_brlapi.brlapi_error.brlerrno == ERROR_LIBCERR and c_brlapi.brlapi_error.libcerrno == errno.EINTR):
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L9;
          }
          __pyx_L9:;
        }
    }

    /* "brlapi.pyx":716
 * 			with nogil:
 * 				retval = c_brlapi.brlapi__readKey(self.h, c_wait, <c_brlapi.brlapi_keyCode_t*>&code)
 * 			if retval == -1 and not (c_brlapi.brlapi_error.brlerrno == ERROR_LIBCERR and c_brlapi.brlapi_error.libcerrno == errno.EINTR):             # <<<<<<<<<<<<<<
 * 				raise OperationError()
 * 			elif retval <= 0:
 */
    __pyx_t_3 = ((__pyx_v_retval == -1L) != 0);
    if (__pyx_t_3) {
    } else {
      __pyx_t_2 = __pyx_t_3;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_4 = __Pyx_PyInt_From_int(brlapi_error.brlerrno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 716, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ERROR_LIBCERR); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 716, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 716, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 716, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_7) {
    } else {
      __pyx_t_3 = __pyx_t_7;
      goto __pyx_L13_bool_binop_done;
    }
    __pyx_t_6 = __Pyx_PyInt_From_int(brlapi_error.libcerrno); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 716, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 716, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_EINTR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 716, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 716, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 716, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_3 = __pyx_t_7;
    __pyx_L13_bool_binop_done:;
    __pyx_t_7 = ((!__pyx_t_3) != 0);
    __pyx_t_2 = __pyx_t_7;
    __pyx_L11_bool_binop_done:;
    if (unlikely(__pyx_t_2)) {

      /* "brlapi.pyx":717
 * 				retval = c_brlapi.brlapi__readKey(self.h, c_wait, <c_brlapi.brlapi_keyCode_t*>&code)
 * 			if retval == -1 and not (c_brlapi.brlapi_error.brlerrno == ERROR_LIBCERR and c_brlapi.brlapi_error.libcerrno == errno.EINTR):
 * 				raise OperationError()             # <<<<<<<<<<<<<<
 * 			elif retval <= 0:
 * 				if not wait:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_OperationError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 717, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 717, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(0, 717, __pyx_L1_error)

      /* "brlapi.pyx":716
 * 			with nogil:
 * 				retval = c_brlapi.brlapi__readKey(self.h, c_wait, <c_brlapi.brlapi_keyCode_t*>&code)
 * 			if retval == -1 and not (c_brlapi.brlapi_error.brlerrno == ERROR_LIBCERR and c_brlapi.brlapi_error.libcerrno == errno.EINTR):             # <<<<<<<<<<<<<<
 * 				raise OperationError()
 * 			elif retval <= 0:
 */
    }

    /* "brlapi.pyx":718
 * 			if retval == -1 and not (c_brlapi.brlapi_error.brlerrno == ERROR_LIBCERR and c_brlapi.brlapi_error.libcerrno == errno.EINTR):
 * 				raise OperationError()
 * 			elif retval <= 0:             # <<<<<<<<<<<<<<
 * 				if not wait:
 * 					return None
 */
    __pyx_t_2 = ((__pyx_v_retval <= 0) != 0);
    if (__pyx_t_2) {

      /* "brlapi.pyx":719
 * 				raise OperationError()
 * 			elif retval <= 0:
 * 				if not wait:             # <<<<<<<<<<<<<<
 * 					return None
 * 			else:
 */
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_wait); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 719, __pyx_L1_error)
      __pyx_t_7 = ((!__pyx_t_2) != 0);
      if (__pyx_t_7) {

        /* "brlapi.pyx":720
 * 			elif retval <= 0:
 * 				if not wait:
 * 					return None             # <<<<<<<<<<<<<<
 * 			else:
 * 				return code
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        goto __pyx_L0;

        /* "brlapi.pyx":719
 * 				raise OperationError()
 * 			elif retval <= 0:
 * 				if not wait:             # <<<<<<<<<<<<<<
 * 					return None
 * 			else:
 */
      }

      /* "brlapi.pyx":718
 * 			if retval == -1 and not (c_brlapi.brlapi_error.brlerrno == ERROR_LIBCERR and c_brlapi.brlapi_error.libcerrno == errno.EINTR):
 * 				raise OperationError()
 * 			elif retval <= 0:             # <<<<<<<<<<<<<<
 * 				if not wait:
 * 					return None
 */
      goto __pyx_L10;
    }

    /* "brlapi.pyx":722
 * 					return None
 * 			else:
 * 				return code             # <<<<<<<<<<<<<<
 * 
 * 	def readKeyWithTimeout(self, timeout_ms = -1):
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyInt_From_brlapi_keyCode_t(__pyx_v_code); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 722, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L0;
    }
    __pyx_L10:;
  }

  /* "brlapi.pyx":695
 * 		return self.write(w)
 * 
 * 	def readKey(self, wait = True):             # <<<<<<<<<<<<<<
 * 		"""Read a key from the braille keyboard.
 * 		See brlapi_readKey(3).
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("brlapi.Connection.readKey", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":724
 * 				return code
 * 
 * 	def readKeyWithTimeout(self, timeout_ms = -1):             # <<<<<<<<<<<<<<
 * 		"""Read a key from the braille keyboard.
 * 		See brlapi_readKeyWithtimeout(3).
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_23readKeyWithTimeout(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6brlapi_10Connection_22readKeyWithTimeout[] = "Connection.readKeyWithTimeout(self, timeout_ms=-1)\nRead a key from the braille keyboard.\n\t\tSee brlapi_readKeyWithtimeout(3).\n\n                This function works like brlapi_readKey, except that parameter wait is replaced by a timeout_ms parameter.";
static PyObject *__pyx_pw_6brlapi_10Connection_23readKeyWithTimeout(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_timeout_ms = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("readKeyWithTimeout (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout_ms,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_int_neg_1);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout_ms);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "readKeyWithTimeout") < 0)) __PYX_ERR(0, 724, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_timeout_ms = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("readKeyWithTimeout", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 724, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("brlapi.Connection.readKeyWithTimeout", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6brlapi_10Connection_22readKeyWithTimeout(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self), __pyx_v_timeout_ms);

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

static PyObject *__pyx_pf_6brlapi_10Connection_22readKeyWithTimeout(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_timeout_ms) {
  brlapi_keyCode_t __pyx_v_code;
  int __pyx_v_retval;
  int __pyx_v_c_timeout_ms;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("readKeyWithTimeout", 0);

  /* "brlapi.pyx":732
 * 		cdef int retval
 * 		cdef int c_timeout_ms
 * 		c_timeout_ms = timeout_ms             # <<<<<<<<<<<<<<
 * 
 * 		while True:
 */
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_timeout_ms); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 732, __pyx_L1_error)
  __pyx_v_c_timeout_ms = __pyx_t_1;

  /* "brlapi.pyx":734
 * 		c_timeout_ms = timeout_ms
 * 
 * 		while True:             # <<<<<<<<<<<<<<
 * 			with nogil:
 * 				retval = c_brlapi.brlapi__readKeyWithTimeout(self.h, c_timeout_ms, <c_brlapi.brlapi_keyCode_t*>&code)
 */
  while (1) {

    /* "brlapi.pyx":735
 * 
 * 		while True:
 * 			with nogil:             # <<<<<<<<<<<<<<
 * 				retval = c_brlapi.brlapi__readKeyWithTimeout(self.h, c_timeout_ms, <c_brlapi.brlapi_keyCode_t*>&code)
 * 			if retval == -1 and not (c_brlapi.brlapi_error.brlerrno == ERROR_LIBCERR and c_brlapi.brlapi_error.libcerrno == errno.EINTR):
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "brlapi.pyx":736
 * 		while True:
 * 			with nogil:
 * 				retval = c_brlapi.brlapi__readKeyWithTimeout(self.h, c_timeout_ms, <c_brlapi.brlapi_keyCode_t*>&code)             # <<<<<<<<<<<<<<
 * 			if retval == -1 and not (c_brlapi.brlapi_error.brlerrno == ERROR_LIBCERR and c_brlapi.brlapi_error.libcerrno == errno.EINTR):
 * 				raise OperationError()
 */
          __pyx_v_retval = brlapi__readKeyWithTimeout(__pyx_v_self->h, __pyx_v_c_timeout_ms, ((brlapi_keyCode_t *)(&__pyx_v_code)));
        }

        /* "brlapi.pyx":735
 * 
 * 		while True:
 * 			with nogil:             # <<<<<<<<<<<<<<
 * 				retval = c_brlapi.brlapi__readKeyWithTimeout(self.h, c_timeout_ms, <c_brlapi.brlapi_keyCode_t*>&code)
 * 			if retval == -1 and not (c_brlapi.brlapi_error.brlerrno == ERROR_LIBCERR and c_brlapi.brlapi_error.libcerrno == errno.EINTR):
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L9;
          }
          __pyx_L9:;
        }
    }

    /* "brlapi.pyx":737
 * 			with nogil:
 * 				retval = c_brlapi.brlapi__readKeyWithTimeout(self.h, c_timeout_ms, <c_brlapi.brlapi_keyCode_t*>&code)
 * 			if retval == -1 and not (c_brlapi.brlapi_error.brlerrno == ERROR_LIBCERR and c_brlapi.brlapi_error.libcerrno == errno.EINTR):             # <<<<<<<<<<<<<<
 * 				raise OperationError()
 * 			elif retval <= 0:
 */
    __pyx_t_3 = ((__pyx_v_retval == -1L) != 0);
    if (__pyx_t_3) {
    } else {
      __pyx_t_2 = __pyx_t_3;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_4 = __Pyx_PyInt_From_int(brlapi_error.brlerrno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ERROR_LIBCERR); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 737, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 737, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_7) {
    } else {
      __pyx_t_3 = __pyx_t_7;
      goto __pyx_L13_bool_binop_done;
    }
    __pyx_t_6 = __Pyx_PyInt_From_int(brlapi_error.libcerrno); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_EINTR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 737, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 737, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_3 = __pyx_t_7;
    __pyx_L13_bool_binop_done:;
    __pyx_t_7 = ((!__pyx_t_3) != 0);
    __pyx_t_2 = __pyx_t_7;
    __pyx_L11_bool_binop_done:;
    if (unlikely(__pyx_t_2)) {

      /* "brlapi.pyx":738
 * 				retval = c_brlapi.brlapi__readKeyWithTimeout(self.h, c_timeout_ms, <c_brlapi.brlapi_keyCode_t*>&code)
 * 			if retval == -1 and not (c_brlapi.brlapi_error.brlerrno == ERROR_LIBCERR and c_brlapi.brlapi_error.libcerrno == errno.EINTR):
 * 				raise OperationError()             # <<<<<<<<<<<<<<
 * 			elif retval <= 0:
 * 				if timeout_ms >= 0:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_OperationError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 738, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 738, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(0, 738, __pyx_L1_error)

      /* "brlapi.pyx":737
 * 			with nogil:
 * 				retval = c_brlapi.brlapi__readKeyWithTimeout(self.h, c_timeout_ms, <c_brlapi.brlapi_keyCode_t*>&code)
 * 			if retval == -1 and not (c_brlapi.brlapi_error.brlerrno == ERROR_LIBCERR and c_brlapi.brlapi_error.libcerrno == errno.EINTR):             # <<<<<<<<<<<<<<
 * 				raise OperationError()
 * 			elif retval <= 0:
 */
    }

    /* "brlapi.pyx":739
 * 			if retval == -1 and not (c_brlapi.brlapi_error.brlerrno == ERROR_LIBCERR and c_brlapi.brlapi_error.libcerrno == errno.EINTR):
 * 				raise OperationError()
 * 			elif retval <= 0:             # <<<<<<<<<<<<<<
 * 				if timeout_ms >= 0:
 * 					return None
 */
    __pyx_t_2 = ((__pyx_v_retval <= 0) != 0);
    if (__pyx_t_2) {

      /* "brlapi.pyx":740
 * 				raise OperationError()
 * 			elif retval <= 0:
 * 				if timeout_ms >= 0:             # <<<<<<<<<<<<<<
 * 					return None
 * 			else:
 */
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_timeout_ms, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 740, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 740, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_2) {

        /* "brlapi.pyx":741
 * 			elif retval <= 0:
 * 				if timeout_ms >= 0:
 * 					return None             # <<<<<<<<<<<<<<
 * 			else:
 * 				return code
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        goto __pyx_L0;

        /* "brlapi.pyx":740
 * 				raise OperationError()
 * 			elif retval <= 0:
 * 				if timeout_ms >= 0:             # <<<<<<<<<<<<<<
 * 					return None
 * 			else:
 */
      }

      /* "brlapi.pyx":739
 * 			if retval == -1 and not (c_brlapi.brlapi_error.brlerrno == ERROR_LIBCERR and c_brlapi.brlapi_error.libcerrno == errno.EINTR):
 * 				raise OperationError()
 * 			elif retval <= 0:             # <<<<<<<<<<<<<<
 * 				if timeout_ms >= 0:
 * 					return None
 */
      goto __pyx_L10;
    }

    /* "brlapi.pyx":743
 * 					return None
 * 			else:
 * 				return code             # <<<<<<<<<<<<<<
 * 
 * 	def expandKeyCode(self, code):
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyInt_From_brlapi_keyCode_t(__pyx_v_code); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 743, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L0;
    }
    __pyx_L10:;
  }

  /* "brlapi.pyx":724
 * 				return code
 * 
 * 	def readKeyWithTimeout(self, timeout_ms = -1):             # <<<<<<<<<<<<<<
 * 		"""Read a key from the braille keyboard.
 * 		See brlapi_readKeyWithtimeout(3).
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("brlapi.Connection.readKeyWithTimeout", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":745
 * 				return code
 * 
 * 	def expandKeyCode(self, code):             # <<<<<<<<<<<<<<
 * 		"""Expand a keycode into its individual components.
 * 		This is a stub to maintain backward compatibility.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_25expandKeyCode(PyObject *__pyx_v_self, PyObject *__pyx_v_code); /*proto*/
static char __pyx_doc_6brlapi_10Connection_24expandKeyCode[] = "Connection.expandKeyCode(self, code)\nExpand a keycode into its individual components.\n\t\tThis is a stub to maintain backward compatibility.\n\t\tCall brlapi.expandKeyCode(code) instead.";
static PyObject *__pyx_pw_6brlapi_10Connection_25expandKeyCode(PyObject *__pyx_v_self, PyObject *__pyx_v_code) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("expandKeyCode (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_10Connection_24expandKeyCode(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self), ((PyObject *)__pyx_v_code));

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

static PyObject *__pyx_pf_6brlapi_10Connection_24expandKeyCode(CYTHON_UNUSED struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_code) {
  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("expandKeyCode", 0);

  /* "brlapi.pyx":749
 * 		This is a stub to maintain backward compatibility.
 * 		Call brlapi.expandKeyCode(code) instead."""
 * 		return expandKeyCode(code)             # <<<<<<<<<<<<<<
 * 
 * 	def ignoreKeys(self, key_type, set):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_expandKeyCode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 749, __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_code) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_code);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 749, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "brlapi.pyx":745
 * 				return code
 * 
 * 	def expandKeyCode(self, code):             # <<<<<<<<<<<<<<
 * 		"""Expand a keycode into its individual components.
 * 		This is a stub to maintain backward compatibility.
 */

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

/* "brlapi.pyx":751
 * 		return expandKeyCode(code)
 * 
 * 	def ignoreKeys(self, key_type, set):             # <<<<<<<<<<<<<<
 * 		"""Ignore some key presses from the braille keyboard.
 * 		See brlapi_ignoreKeys(3).
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_27ignoreKeys(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6brlapi_10Connection_26ignoreKeys[] = "Connection.ignoreKeys(self, key_type, set)\nIgnore some key presses from the braille keyboard.\n\t\tSee brlapi_ignoreKeys(3).\n\t\t\n\t\tThis function asks the server to give the provided keys to brltty, rather than returning them to the application via brlapi_readKey().\n\t\t\n\t\tThe given codes should be brltty commands (nul or \"\" was given to brlapi_enterTtyMode())";
static PyObject *__pyx_pw_6brlapi_10Connection_27ignoreKeys(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key_type = 0;
  PyObject *__pyx_v_set = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ignoreKeys (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key_type,&__pyx_n_s_set,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_key_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_set)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ignoreKeys", 1, 2, 2, 1); __PYX_ERR(0, 751, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ignoreKeys") < 0)) __PYX_ERR(0, 751, __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_key_type = values[0];
    __pyx_v_set = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ignoreKeys", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 751, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("brlapi.Connection.ignoreKeys", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6brlapi_10Connection_26ignoreKeys(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self), __pyx_v_key_type, __pyx_v_set);

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

static PyObject *__pyx_pf_6brlapi_10Connection_26ignoreKeys(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_key_type, PyObject *__pyx_v_set) {
  int __pyx_v_retval;
  brlapi_rangeType_t __pyx_v_c_type;
  brlapi_keyCode_t *__pyx_v_c_set;
  unsigned int __pyx_v_c_n;
  long __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  brlapi_rangeType_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  unsigned int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  brlapi_keyCode_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ignoreKeys", 0);

  /* "brlapi.pyx":762
 * 		cdef c_brlapi.brlapi_keyCode_t *c_set
 * 		cdef unsigned int c_n
 * 		c_type = key_type             # <<<<<<<<<<<<<<
 * 		c_n = len(set)
 * 		c_set = <c_brlapi.brlapi_keyCode_t*>c_brlapi.malloc(c_n * sizeof(c_brlapi.brlapi_keyCode_t))
 */
  __pyx_t_1 = ((brlapi_rangeType_t)__Pyx_PyInt_As_brlapi_rangeType_t(__pyx_v_key_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 762, __pyx_L1_error)
  __pyx_v_c_type = __pyx_t_1;

  /* "brlapi.pyx":763
 * 		cdef unsigned int c_n
 * 		c_type = key_type
 * 		c_n = len(set)             # <<<<<<<<<<<<<<
 * 		c_set = <c_brlapi.brlapi_keyCode_t*>c_brlapi.malloc(c_n * sizeof(c_brlapi.brlapi_keyCode_t))
 * 		for i from 0 <= i < c_n:
 */
  __pyx_t_2 = PyObject_Length(__pyx_v_set); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 763, __pyx_L1_error)
  __pyx_v_c_n = __pyx_t_2;

  /* "brlapi.pyx":764
 * 		c_type = key_type
 * 		c_n = len(set)
 * 		c_set = <c_brlapi.brlapi_keyCode_t*>c_brlapi.malloc(c_n * sizeof(c_brlapi.brlapi_keyCode_t))             # <<<<<<<<<<<<<<
 * 		for i from 0 <= i < c_n:
 * 			c_set[i] = set[i]
 */
  __pyx_v_c_set = ((brlapi_keyCode_t *)malloc((__pyx_v_c_n * (sizeof(brlapi_keyCode_t)))));

  /* "brlapi.pyx":765
 * 		c_n = len(set)
 * 		c_set = <c_brlapi.brlapi_keyCode_t*>c_brlapi.malloc(c_n * sizeof(c_brlapi.brlapi_keyCode_t))
 * 		for i from 0 <= i < c_n:             # <<<<<<<<<<<<<<
 * 			c_set[i] = set[i]
 * 		with nogil:
 */
  __pyx_t_3 = __pyx_v_c_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {

    /* "brlapi.pyx":766
 * 		c_set = <c_brlapi.brlapi_keyCode_t*>c_brlapi.malloc(c_n * sizeof(c_brlapi.brlapi_keyCode_t))
 * 		for i from 0 <= i < c_n:
 * 			c_set[i] = set[i]             # <<<<<<<<<<<<<<
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__ignoreKeys(self.h, c_type, c_set, c_n)
 */
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_set, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 766, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_As_brlapi_keyCode_t(__pyx_t_4); if (unlikely((__pyx_t_5 == ((brlapi_keyCode_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 766, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    (__pyx_v_c_set[__pyx_v_i]) = __pyx_t_5;
  }

  /* "brlapi.pyx":767
 * 		for i from 0 <= i < c_n:
 * 			c_set[i] = set[i]
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__ignoreKeys(self.h, c_type, c_set, c_n)
 * 		c_brlapi.free(c_set)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "brlapi.pyx":768
 * 			c_set[i] = set[i]
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__ignoreKeys(self.h, c_type, c_set, c_n)             # <<<<<<<<<<<<<<
 * 		c_brlapi.free(c_set)
 * 		if retval == -1:
 */
        __pyx_v_retval = brlapi__ignoreKeys(__pyx_v_self->h, __pyx_v_c_type, __pyx_v_c_set, __pyx_v_c_n);
      }

      /* "brlapi.pyx":767
 * 		for i from 0 <= i < c_n:
 * 			c_set[i] = set[i]
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__ignoreKeys(self.h, c_type, c_set, c_n)
 * 		c_brlapi.free(c_set)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
  }

  /* "brlapi.pyx":769
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__ignoreKeys(self.h, c_type, c_set, c_n)
 * 		c_brlapi.free(c_set)             # <<<<<<<<<<<<<<
 * 		if retval == -1:
 * 			raise OperationError()
 */
  free(__pyx_v_c_set);

  /* "brlapi.pyx":770
 * 			retval = c_brlapi.brlapi__ignoreKeys(self.h, c_type, c_set, c_n)
 * 		c_brlapi.free(c_set)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 		else:
 */
  __pyx_t_6 = ((__pyx_v_retval == -1L) != 0);
  if (unlikely(__pyx_t_6)) {

    /* "brlapi.pyx":771
 * 		c_brlapi.free(c_set)
 * 		if retval == -1:
 * 			raise OperationError()             # <<<<<<<<<<<<<<
 * 		else:
 * 			return retval
 */
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_OperationError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 771, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __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_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 771, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 771, __pyx_L1_error)

    /* "brlapi.pyx":770
 * 			retval = c_brlapi.brlapi__ignoreKeys(self.h, c_type, c_set, c_n)
 * 		c_brlapi.free(c_set)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 		else:
 */
  }

  /* "brlapi.pyx":773
 * 			raise OperationError()
 * 		else:
 * 			return retval             # <<<<<<<<<<<<<<
 * 
 * 	def acceptKeys(self, key_type, set):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_retval); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 773, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "brlapi.pyx":751
 * 		return expandKeyCode(code)
 * 
 * 	def ignoreKeys(self, key_type, set):             # <<<<<<<<<<<<<<
 * 		"""Ignore some key presses from the braille keyboard.
 * 		See brlapi_ignoreKeys(3).
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("brlapi.Connection.ignoreKeys", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":775
 * 			return retval
 * 
 * 	def acceptKeys(self, key_type, set):             # <<<<<<<<<<<<<<
 * 		"""Accept some key presses from the braille keyboard.
 * 		See brlapi_ignoreKeys(3).
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_29acceptKeys(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6brlapi_10Connection_28acceptKeys[] = "Connection.acceptKeys(self, key_type, set)\nAccept some key presses from the braille keyboard.\n\t\tSee brlapi_ignoreKeys(3).\n\t\t\n\t\tThis function asks the server to give the provided keys to the application, and not give them to brltty.\n\n\t\tThe given codes should be brltty commands (nul or \"\" was given to brlapi_enterTtyMode())";
static PyObject *__pyx_pw_6brlapi_10Connection_29acceptKeys(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key_type = 0;
  PyObject *__pyx_v_set = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("acceptKeys (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key_type,&__pyx_n_s_set,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_key_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_set)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("acceptKeys", 1, 2, 2, 1); __PYX_ERR(0, 775, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "acceptKeys") < 0)) __PYX_ERR(0, 775, __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_key_type = values[0];
    __pyx_v_set = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("acceptKeys", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 775, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("brlapi.Connection.acceptKeys", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6brlapi_10Connection_28acceptKeys(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self), __pyx_v_key_type, __pyx_v_set);

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

static PyObject *__pyx_pf_6brlapi_10Connection_28acceptKeys(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_key_type, PyObject *__pyx_v_set) {
  int __pyx_v_retval;
  brlapi_rangeType_t __pyx_v_c_type;
  brlapi_keyCode_t *__pyx_v_c_set;
  unsigned int __pyx_v_c_n;
  long __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  brlapi_rangeType_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  unsigned int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  brlapi_keyCode_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("acceptKeys", 0);

  /* "brlapi.pyx":786
 * 		cdef c_brlapi.brlapi_keyCode_t *c_set
 * 		cdef unsigned int c_n
 * 		c_type = key_type             # <<<<<<<<<<<<<<
 * 		c_n = len(set)
 * 		c_set = <c_brlapi.brlapi_keyCode_t*>c_brlapi.malloc(c_n * sizeof(c_brlapi.brlapi_keyCode_t))
 */
  __pyx_t_1 = ((brlapi_rangeType_t)__Pyx_PyInt_As_brlapi_rangeType_t(__pyx_v_key_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 786, __pyx_L1_error)
  __pyx_v_c_type = __pyx_t_1;

  /* "brlapi.pyx":787
 * 		cdef unsigned int c_n
 * 		c_type = key_type
 * 		c_n = len(set)             # <<<<<<<<<<<<<<
 * 		c_set = <c_brlapi.brlapi_keyCode_t*>c_brlapi.malloc(c_n * sizeof(c_brlapi.brlapi_keyCode_t))
 * 		for i from 0 <= i < c_n:
 */
  __pyx_t_2 = PyObject_Length(__pyx_v_set); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 787, __pyx_L1_error)
  __pyx_v_c_n = __pyx_t_2;

  /* "brlapi.pyx":788
 * 		c_type = key_type
 * 		c_n = len(set)
 * 		c_set = <c_brlapi.brlapi_keyCode_t*>c_brlapi.malloc(c_n * sizeof(c_brlapi.brlapi_keyCode_t))             # <<<<<<<<<<<<<<
 * 		for i from 0 <= i < c_n:
 * 			c_set[i] = set[i]
 */
  __pyx_v_c_set = ((brlapi_keyCode_t *)malloc((__pyx_v_c_n * (sizeof(brlapi_keyCode_t)))));

  /* "brlapi.pyx":789
 * 		c_n = len(set)
 * 		c_set = <c_brlapi.brlapi_keyCode_t*>c_brlapi.malloc(c_n * sizeof(c_brlapi.brlapi_keyCode_t))
 * 		for i from 0 <= i < c_n:             # <<<<<<<<<<<<<<
 * 			c_set[i] = set[i]
 * 		with nogil:
 */
  __pyx_t_3 = __pyx_v_c_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {

    /* "brlapi.pyx":790
 * 		c_set = <c_brlapi.brlapi_keyCode_t*>c_brlapi.malloc(c_n * sizeof(c_brlapi.brlapi_keyCode_t))
 * 		for i from 0 <= i < c_n:
 * 			c_set[i] = set[i]             # <<<<<<<<<<<<<<
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__acceptKeys(self.h, c_type, c_set, c_n)
 */
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_set, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_As_brlapi_keyCode_t(__pyx_t_4); if (unlikely((__pyx_t_5 == ((brlapi_keyCode_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 790, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    (__pyx_v_c_set[__pyx_v_i]) = __pyx_t_5;
  }

  /* "brlapi.pyx":791
 * 		for i from 0 <= i < c_n:
 * 			c_set[i] = set[i]
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__acceptKeys(self.h, c_type, c_set, c_n)
 * 		c_brlapi.free(c_set)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "brlapi.pyx":792
 * 			c_set[i] = set[i]
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__acceptKeys(self.h, c_type, c_set, c_n)             # <<<<<<<<<<<<<<
 * 		c_brlapi.free(c_set)
 * 		if retval == -1:
 */
        __pyx_v_retval = brlapi__acceptKeys(__pyx_v_self->h, __pyx_v_c_type, __pyx_v_c_set, __pyx_v_c_n);
      }

      /* "brlapi.pyx":791
 * 		for i from 0 <= i < c_n:
 * 			c_set[i] = set[i]
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__acceptKeys(self.h, c_type, c_set, c_n)
 * 		c_brlapi.free(c_set)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
  }

  /* "brlapi.pyx":793
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__acceptKeys(self.h, c_type, c_set, c_n)
 * 		c_brlapi.free(c_set)             # <<<<<<<<<<<<<<
 * 		if retval == -1:
 * 			raise OperationError()
 */
  free(__pyx_v_c_set);

  /* "brlapi.pyx":794
 * 			retval = c_brlapi.brlapi__acceptKeys(self.h, c_type, c_set, c_n)
 * 		c_brlapi.free(c_set)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 		else:
 */
  __pyx_t_6 = ((__pyx_v_retval == -1L) != 0);
  if (unlikely(__pyx_t_6)) {

    /* "brlapi.pyx":795
 * 		c_brlapi.free(c_set)
 * 		if retval == -1:
 * 			raise OperationError()             # <<<<<<<<<<<<<<
 * 		else:
 * 			return retval
 */
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_OperationError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 795, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __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_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 795, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 795, __pyx_L1_error)

    /* "brlapi.pyx":794
 * 			retval = c_brlapi.brlapi__acceptKeys(self.h, c_type, c_set, c_n)
 * 		c_brlapi.free(c_set)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 		else:
 */
  }

  /* "brlapi.pyx":797
 * 			raise OperationError()
 * 		else:
 * 			return retval             # <<<<<<<<<<<<<<
 * 
 * 	def ignoreAllKeys(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_retval); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 797, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "brlapi.pyx":775
 * 			return retval
 * 
 * 	def acceptKeys(self, key_type, set):             # <<<<<<<<<<<<<<
 * 		"""Accept some key presses from the braille keyboard.
 * 		See brlapi_ignoreKeys(3).
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("brlapi.Connection.acceptKeys", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":799
 * 			return retval
 * 
 * 	def ignoreAllKeys(self):             # <<<<<<<<<<<<<<
 * 		"""Ignore all key presses from the braille keyboard.
 * 		See brlapi_ignoreAllKeys(3).
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_31ignoreAllKeys(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6brlapi_10Connection_30ignoreAllKeys[] = "Connection.ignoreAllKeys(self)\nIgnore all key presses from the braille keyboard.\n\t\tSee brlapi_ignoreAllKeys(3).\n\t\t\n\t\tThis function asks the server to give all keys to brltty, rather than returning them to the application via brlapi_readKey().";
static PyObject *__pyx_pw_6brlapi_10Connection_31ignoreAllKeys(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ignoreAllKeys (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_10Connection_30ignoreAllKeys(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self));

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

static PyObject *__pyx_pf_6brlapi_10Connection_30ignoreAllKeys(struct __pyx_obj_6brlapi_Connection *__pyx_v_self) {
  int __pyx_v_retval;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ignoreAllKeys", 0);

  /* "brlapi.pyx":805
 * 		This function asks the server to give all keys to brltty, rather than returning them to the application via brlapi_readKey()."""
 * 		cdef int retval
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__ignoreAllKeys(self.h)
 * 		if retval == -1:
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "brlapi.pyx":806
 * 		cdef int retval
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__ignoreAllKeys(self.h)             # <<<<<<<<<<<<<<
 * 		if retval == -1:
 * 			raise OperationError()
 */
        __pyx_v_retval = brlapi__ignoreAllKeys(__pyx_v_self->h);
      }

      /* "brlapi.pyx":805
 * 		This function asks the server to give all keys to brltty, rather than returning them to the application via brlapi_readKey()."""
 * 		cdef int retval
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__ignoreAllKeys(self.h)
 * 		if retval == -1:
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "brlapi.pyx":807
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__ignoreAllKeys(self.h)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 		else:
 */
  __pyx_t_1 = ((__pyx_v_retval == -1L) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "brlapi.pyx":808
 * 			retval = c_brlapi.brlapi__ignoreAllKeys(self.h)
 * 		if retval == -1:
 * 			raise OperationError()             # <<<<<<<<<<<<<<
 * 		else:
 * 			return retval
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_OperationError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 808, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_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, 808, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 808, __pyx_L1_error)

    /* "brlapi.pyx":807
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__ignoreAllKeys(self.h)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 		else:
 */
  }

  /* "brlapi.pyx":810
 * 			raise OperationError()
 * 		else:
 * 			return retval             # <<<<<<<<<<<<<<
 * 
 * 	def acceptAllKeys(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_retval); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 810, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "brlapi.pyx":799
 * 			return retval
 * 
 * 	def ignoreAllKeys(self):             # <<<<<<<<<<<<<<
 * 		"""Ignore all key presses from the braille keyboard.
 * 		See brlapi_ignoreAllKeys(3).
 */

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

/* "brlapi.pyx":812
 * 			return retval
 * 
 * 	def acceptAllKeys(self):             # <<<<<<<<<<<<<<
 * 		"""Accept all key presses from the braille keyboard.
 * 		See brlapi_acceptAllKeys(3).
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_33acceptAllKeys(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6brlapi_10Connection_32acceptAllKeys[] = "Connection.acceptAllKeys(self)\nAccept all key presses from the braille keyboard.\n\t\tSee brlapi_acceptAllKeys(3).\n\t\t\n\t\tThis function asks the server to give all keys to the application, and not give them to brltty.\n\n\t\tWarning: after calling this function, make sure to call brlapi_ignoreKeys() for ignoring important keys like BRL_CMD_SWITCHVT_PREV/NEXT and such.";
static PyObject *__pyx_pw_6brlapi_10Connection_33acceptAllKeys(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("acceptAllKeys (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_10Connection_32acceptAllKeys(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self));

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

static PyObject *__pyx_pf_6brlapi_10Connection_32acceptAllKeys(struct __pyx_obj_6brlapi_Connection *__pyx_v_self) {
  int __pyx_v_retval;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("acceptAllKeys", 0);

  /* "brlapi.pyx":820
 * 		Warning: after calling this function, make sure to call brlapi_ignoreKeys() for ignoring important keys like BRL_CMD_SWITCHVT_PREV/NEXT and such."""
 * 		cdef int retval
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__acceptAllKeys(self.h)
 * 		if retval == -1:
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "brlapi.pyx":821
 * 		cdef int retval
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__acceptAllKeys(self.h)             # <<<<<<<<<<<<<<
 * 		if retval == -1:
 * 			raise OperationError()
 */
        __pyx_v_retval = brlapi__acceptAllKeys(__pyx_v_self->h);
      }

      /* "brlapi.pyx":820
 * 		Warning: after calling this function, make sure to call brlapi_ignoreKeys() for ignoring important keys like BRL_CMD_SWITCHVT_PREV/NEXT and such."""
 * 		cdef int retval
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__acceptAllKeys(self.h)
 * 		if retval == -1:
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "brlapi.pyx":822
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__acceptAllKeys(self.h)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 		else:
 */
  __pyx_t_1 = ((__pyx_v_retval == -1L) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "brlapi.pyx":823
 * 			retval = c_brlapi.brlapi__acceptAllKeys(self.h)
 * 		if retval == -1:
 * 			raise OperationError()             # <<<<<<<<<<<<<<
 * 		else:
 * 			return retval
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_OperationError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 823, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_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, 823, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 823, __pyx_L1_error)

    /* "brlapi.pyx":822
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__acceptAllKeys(self.h)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 		else:
 */
  }

  /* "brlapi.pyx":825
 * 			raise OperationError()
 * 		else:
 * 			return retval             # <<<<<<<<<<<<<<
 * 
 * 	def ignoreKeyRanges(self, keys):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_retval); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 825, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "brlapi.pyx":812
 * 			return retval
 * 
 * 	def acceptAllKeys(self):             # <<<<<<<<<<<<<<
 * 		"""Accept all key presses from the braille keyboard.
 * 		See brlapi_acceptAllKeys(3).
 */

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

/* "brlapi.pyx":827
 * 			return retval
 * 
 * 	def ignoreKeyRanges(self, keys):             # <<<<<<<<<<<<<<
 * 		"""Ignore some key presses from the braille keyboard.
 * 		See brlapi_ignoreKeyRanges(3).
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_35ignoreKeyRanges(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static char __pyx_doc_6brlapi_10Connection_34ignoreKeyRanges[] = "Connection.ignoreKeyRanges(self, keys)\nIgnore some key presses from the braille keyboard.\n\t\tSee brlapi_ignoreKeyRanges(3).\n\t\t\n\t\tThis function asks the server to give the provided key ranges to brltty, rather than returning them to the application via brlapi_readKey().\n\t\t\n\t\tThe given codes should be raw keycodes (i.e. some driver name was given to brlapi_enterTtyMode()) ";
static PyObject *__pyx_pw_6brlapi_10Connection_35ignoreKeyRanges(PyObject *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ignoreKeyRanges (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_10Connection_34ignoreKeyRanges(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self), ((PyObject *)__pyx_v_keys));

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

static PyObject *__pyx_pf_6brlapi_10Connection_34ignoreKeyRanges(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_keys) {
  int __pyx_v_retval;
  brlapi_range_t *__pyx_v_c_keys;
  unsigned int __pyx_v_c_n;
  long __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  unsigned int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  brlapi_keyCode_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ignoreKeyRanges", 0);

  /* "brlapi.pyx":837
 * 		cdef c_brlapi.brlapi_range_t *c_keys
 * 		cdef unsigned int c_n
 * 		c_n = len(keys)             # <<<<<<<<<<<<<<
 * 		c_keys = <c_brlapi.brlapi_range_t*>c_brlapi.malloc(c_n * sizeof(c_brlapi.brlapi_range_t))
 * 		for i from 0 <= i < c_n:
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_keys); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 837, __pyx_L1_error)
  __pyx_v_c_n = __pyx_t_1;

  /* "brlapi.pyx":838
 * 		cdef unsigned int c_n
 * 		c_n = len(keys)
 * 		c_keys = <c_brlapi.brlapi_range_t*>c_brlapi.malloc(c_n * sizeof(c_brlapi.brlapi_range_t))             # <<<<<<<<<<<<<<
 * 		for i from 0 <= i < c_n:
 * 			c_keys[i].first = keys[i][0]
 */
  __pyx_v_c_keys = ((brlapi_range_t *)malloc((__pyx_v_c_n * (sizeof(brlapi_range_t)))));

  /* "brlapi.pyx":839
 * 		c_n = len(keys)
 * 		c_keys = <c_brlapi.brlapi_range_t*>c_brlapi.malloc(c_n * sizeof(c_brlapi.brlapi_range_t))
 * 		for i from 0 <= i < c_n:             # <<<<<<<<<<<<<<
 * 			c_keys[i].first = keys[i][0]
 * 			c_keys[i].last = keys[i][1]
 */
  __pyx_t_2 = __pyx_v_c_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "brlapi.pyx":840
 * 		c_keys = <c_brlapi.brlapi_range_t*>c_brlapi.malloc(c_n * sizeof(c_brlapi.brlapi_range_t))
 * 		for i from 0 <= i < c_n:
 * 			c_keys[i].first = keys[i][0]             # <<<<<<<<<<<<<<
 * 			c_keys[i].last = keys[i][1]
 * 		with nogil:
 */
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_keys, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 840, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 840, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_brlapi_keyCode_t(__pyx_t_4); if (unlikely((__pyx_t_5 == ((brlapi_keyCode_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 840, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    (__pyx_v_c_keys[__pyx_v_i]).first = __pyx_t_5;

    /* "brlapi.pyx":841
 * 		for i from 0 <= i < c_n:
 * 			c_keys[i].first = keys[i][0]
 * 			c_keys[i].last = keys[i][1]             # <<<<<<<<<<<<<<
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__ignoreKeyRanges(self.h, c_keys, c_n)
 */
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_keys, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 841, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 841, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_brlapi_keyCode_t(__pyx_t_3); if (unlikely((__pyx_t_5 == ((brlapi_keyCode_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 841, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    (__pyx_v_c_keys[__pyx_v_i]).last = __pyx_t_5;
  }

  /* "brlapi.pyx":842
 * 			c_keys[i].first = keys[i][0]
 * 			c_keys[i].last = keys[i][1]
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__ignoreKeyRanges(self.h, c_keys, c_n)
 * 		c_brlapi.free(c_keys)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "brlapi.pyx":843
 * 			c_keys[i].last = keys[i][1]
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__ignoreKeyRanges(self.h, c_keys, c_n)             # <<<<<<<<<<<<<<
 * 		c_brlapi.free(c_keys)
 * 		if retval == -1:
 */
        __pyx_v_retval = brlapi__ignoreKeyRanges(__pyx_v_self->h, __pyx_v_c_keys, __pyx_v_c_n);
      }

      /* "brlapi.pyx":842
 * 			c_keys[i].first = keys[i][0]
 * 			c_keys[i].last = keys[i][1]
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__ignoreKeyRanges(self.h, c_keys, c_n)
 * 		c_brlapi.free(c_keys)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
  }

  /* "brlapi.pyx":844
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__ignoreKeyRanges(self.h, c_keys, c_n)
 * 		c_brlapi.free(c_keys)             # <<<<<<<<<<<<<<
 * 		if retval == -1:
 * 			raise OperationError()
 */
  free(__pyx_v_c_keys);

  /* "brlapi.pyx":845
 * 			retval = c_brlapi.brlapi__ignoreKeyRanges(self.h, c_keys, c_n)
 * 		c_brlapi.free(c_keys)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 		else:
 */
  __pyx_t_6 = ((__pyx_v_retval == -1L) != 0);
  if (unlikely(__pyx_t_6)) {

    /* "brlapi.pyx":846
 * 		c_brlapi.free(c_keys)
 * 		if retval == -1:
 * 			raise OperationError()             # <<<<<<<<<<<<<<
 * 		else:
 * 			return retval
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_OperationError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 846, __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_3 = (__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_3)) __PYX_ERR(0, 846, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 846, __pyx_L1_error)

    /* "brlapi.pyx":845
 * 			retval = c_brlapi.brlapi__ignoreKeyRanges(self.h, c_keys, c_n)
 * 		c_brlapi.free(c_keys)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 		else:
 */
  }

  /* "brlapi.pyx":848
 * 			raise OperationError()
 * 		else:
 * 			return retval             # <<<<<<<<<<<<<<
 * 
 * 	def acceptKeyRanges(self, keys):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_retval); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "brlapi.pyx":827
 * 			return retval
 * 
 * 	def ignoreKeyRanges(self, keys):             # <<<<<<<<<<<<<<
 * 		"""Ignore some key presses from the braille keyboard.
 * 		See brlapi_ignoreKeyRanges(3).
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("brlapi.Connection.ignoreKeyRanges", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":850
 * 			return retval
 * 
 * 	def acceptKeyRanges(self, keys):             # <<<<<<<<<<<<<<
 * 		"""Accept some key presses from the braille keyboard.
 * 		See brlapi_acceptKeyRanges(3).
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_37acceptKeyRanges(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static char __pyx_doc_6brlapi_10Connection_36acceptKeyRanges[] = "Connection.acceptKeyRanges(self, keys)\nAccept some key presses from the braille keyboard.\n\t\tSee brlapi_acceptKeyRanges(3).\n\t\t\n\t\tThis function asks the server to return the provided key ranges (inclusive) to the application, and not give them to brltty.\n\t\t\n\t\tThe given codes should be raw keycodes (i.e. some driver name was given to brlapi_enterTtyMode()) ";
static PyObject *__pyx_pw_6brlapi_10Connection_37acceptKeyRanges(PyObject *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("acceptKeyRanges (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_10Connection_36acceptKeyRanges(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self), ((PyObject *)__pyx_v_keys));

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

static PyObject *__pyx_pf_6brlapi_10Connection_36acceptKeyRanges(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_keys) {
  int __pyx_v_retval;
  brlapi_range_t *__pyx_v_c_keys;
  unsigned int __pyx_v_c_n;
  long __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  unsigned int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  brlapi_keyCode_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("acceptKeyRanges", 0);

  /* "brlapi.pyx":860
 * 		cdef c_brlapi.brlapi_range_t *c_keys
 * 		cdef unsigned int c_n
 * 		c_n = len(keys)             # <<<<<<<<<<<<<<
 * 		c_keys = <c_brlapi.brlapi_range_t*>c_brlapi.malloc(c_n * sizeof(c_brlapi.brlapi_range_t))
 * 		for i from 0 <= i < c_n:
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_keys); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 860, __pyx_L1_error)
  __pyx_v_c_n = __pyx_t_1;

  /* "brlapi.pyx":861
 * 		cdef unsigned int c_n
 * 		c_n = len(keys)
 * 		c_keys = <c_brlapi.brlapi_range_t*>c_brlapi.malloc(c_n * sizeof(c_brlapi.brlapi_range_t))             # <<<<<<<<<<<<<<
 * 		for i from 0 <= i < c_n:
 * 			c_keys[i].first = keys[i][0]
 */
  __pyx_v_c_keys = ((brlapi_range_t *)malloc((__pyx_v_c_n * (sizeof(brlapi_range_t)))));

  /* "brlapi.pyx":862
 * 		c_n = len(keys)
 * 		c_keys = <c_brlapi.brlapi_range_t*>c_brlapi.malloc(c_n * sizeof(c_brlapi.brlapi_range_t))
 * 		for i from 0 <= i < c_n:             # <<<<<<<<<<<<<<
 * 			c_keys[i].first = keys[i][0]
 * 			c_keys[i].last = keys[i][1]
 */
  __pyx_t_2 = __pyx_v_c_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "brlapi.pyx":863
 * 		c_keys = <c_brlapi.brlapi_range_t*>c_brlapi.malloc(c_n * sizeof(c_brlapi.brlapi_range_t))
 * 		for i from 0 <= i < c_n:
 * 			c_keys[i].first = keys[i][0]             # <<<<<<<<<<<<<<
 * 			c_keys[i].last = keys[i][1]
 * 		with nogil:
 */
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_keys, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_brlapi_keyCode_t(__pyx_t_4); if (unlikely((__pyx_t_5 == ((brlapi_keyCode_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 863, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    (__pyx_v_c_keys[__pyx_v_i]).first = __pyx_t_5;

    /* "brlapi.pyx":864
 * 		for i from 0 <= i < c_n:
 * 			c_keys[i].first = keys[i][0]
 * 			c_keys[i].last = keys[i][1]             # <<<<<<<<<<<<<<
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__acceptKeyRanges(self.h, c_keys, c_n)
 */
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_keys, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 864, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 864, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_brlapi_keyCode_t(__pyx_t_3); if (unlikely((__pyx_t_5 == ((brlapi_keyCode_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 864, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    (__pyx_v_c_keys[__pyx_v_i]).last = __pyx_t_5;
  }

  /* "brlapi.pyx":865
 * 			c_keys[i].first = keys[i][0]
 * 			c_keys[i].last = keys[i][1]
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__acceptKeyRanges(self.h, c_keys, c_n)
 * 		c_brlapi.free(c_keys)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "brlapi.pyx":866
 * 			c_keys[i].last = keys[i][1]
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__acceptKeyRanges(self.h, c_keys, c_n)             # <<<<<<<<<<<<<<
 * 		c_brlapi.free(c_keys)
 * 		if retval == -1:
 */
        __pyx_v_retval = brlapi__acceptKeyRanges(__pyx_v_self->h, __pyx_v_c_keys, __pyx_v_c_n);
      }

      /* "brlapi.pyx":865
 * 			c_keys[i].first = keys[i][0]
 * 			c_keys[i].last = keys[i][1]
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__acceptKeyRanges(self.h, c_keys, c_n)
 * 		c_brlapi.free(c_keys)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
  }

  /* "brlapi.pyx":867
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__acceptKeyRanges(self.h, c_keys, c_n)
 * 		c_brlapi.free(c_keys)             # <<<<<<<<<<<<<<
 * 		if retval == -1:
 * 			raise OperationError()
 */
  free(__pyx_v_c_keys);

  /* "brlapi.pyx":868
 * 			retval = c_brlapi.brlapi__acceptKeyRanges(self.h, c_keys, c_n)
 * 		c_brlapi.free(c_keys)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 		else:
 */
  __pyx_t_6 = ((__pyx_v_retval == -1L) != 0);
  if (unlikely(__pyx_t_6)) {

    /* "brlapi.pyx":869
 * 		c_brlapi.free(c_keys)
 * 		if retval == -1:
 * 			raise OperationError()             # <<<<<<<<<<<<<<
 * 		else:
 * 			return retval
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_OperationError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 869, __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_3 = (__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_3)) __PYX_ERR(0, 869, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 869, __pyx_L1_error)

    /* "brlapi.pyx":868
 * 			retval = c_brlapi.brlapi__acceptKeyRanges(self.h, c_keys, c_n)
 * 		c_brlapi.free(c_keys)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 		else:
 */
  }

  /* "brlapi.pyx":871
 * 			raise OperationError()
 * 		else:
 * 			return retval             # <<<<<<<<<<<<<<
 * 
 * 	def enterRawMode(self, driver):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_retval); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "brlapi.pyx":850
 * 			return retval
 * 
 * 	def acceptKeyRanges(self, keys):             # <<<<<<<<<<<<<<
 * 		"""Accept some key presses from the braille keyboard.
 * 		See brlapi_acceptKeyRanges(3).
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("brlapi.Connection.acceptKeyRanges", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":873
 * 			return retval
 * 
 * 	def enterRawMode(self, driver):             # <<<<<<<<<<<<<<
 * 		"""Switch to Raw mode
 * 		See brlapi_enterRawMode(3).
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_39enterRawMode(PyObject *__pyx_v_self, PyObject *__pyx_v_driver); /*proto*/
static char __pyx_doc_6brlapi_10Connection_38enterRawMode[] = "Connection.enterRawMode(self, driver)\nSwitch to Raw mode\n\t\tSee brlapi_enterRawMode(3).\n\t\t\n\t\t* driver : Specifies the name of the driver for which the raw communication will be established";
static PyObject *__pyx_pw_6brlapi_10Connection_39enterRawMode(PyObject *__pyx_v_self, PyObject *__pyx_v_driver) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("enterRawMode (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_10Connection_38enterRawMode(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self), ((PyObject *)__pyx_v_driver));

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

static PyObject *__pyx_pf_6brlapi_10Connection_38enterRawMode(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_driver) {
  int __pyx_v_retval;
  char *__pyx_v_c_driver;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  char *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("enterRawMode", 0);
  __Pyx_INCREF(__pyx_v_driver);

  /* "brlapi.pyx":880
 * 		cdef int retval
 * 		cdef char *c_driver
 * 		if (type(driver) == unicode):             # <<<<<<<<<<<<<<
 * 			driver = driver.encode('ASCII')
 * 		c_driver = driver
 */
  __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_driver)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 880, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "brlapi.pyx":881
 * 		cdef char *c_driver
 * 		if (type(driver) == unicode):
 * 			driver = driver.encode('ASCII')             # <<<<<<<<<<<<<<
 * 		c_driver = driver
 * 		with nogil:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_driver, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 881, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_n_u_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_n_u_ASCII);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_driver, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "brlapi.pyx":880
 * 		cdef int retval
 * 		cdef char *c_driver
 * 		if (type(driver) == unicode):             # <<<<<<<<<<<<<<
 * 			driver = driver.encode('ASCII')
 * 		c_driver = driver
 */
  }

  /* "brlapi.pyx":882
 * 		if (type(driver) == unicode):
 * 			driver = driver.encode('ASCII')
 * 		c_driver = driver             # <<<<<<<<<<<<<<
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__enterRawMode(self.h, c_driver)
 */
  __pyx_t_5 = __Pyx_PyObject_AsWritableString(__pyx_v_driver); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 882, __pyx_L1_error)
  __pyx_v_c_driver = __pyx_t_5;

  /* "brlapi.pyx":883
 * 			driver = driver.encode('ASCII')
 * 		c_driver = driver
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__enterRawMode(self.h, c_driver)
 * 		if retval == -1:
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "brlapi.pyx":884
 * 		c_driver = driver
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__enterRawMode(self.h, c_driver)             # <<<<<<<<<<<<<<
 * 		if retval == -1:
 * 			raise OperationError()
 */
        __pyx_v_retval = brlapi__enterRawMode(__pyx_v_self->h, __pyx_v_c_driver);
      }

      /* "brlapi.pyx":883
 * 			driver = driver.encode('ASCII')
 * 		c_driver = driver
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__enterRawMode(self.h, c_driver)
 * 		if retval == -1:
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L6;
        }
        __pyx_L6:;
      }
  }

  /* "brlapi.pyx":885
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__enterRawMode(self.h, c_driver)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 		else:
 */
  __pyx_t_2 = ((__pyx_v_retval == -1L) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "brlapi.pyx":886
 * 			retval = c_brlapi.brlapi__enterRawMode(self.h, c_driver)
 * 		if retval == -1:
 * 			raise OperationError()             # <<<<<<<<<<<<<<
 * 		else:
 * 			return retval
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_OperationError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 886, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_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, 886, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 886, __pyx_L1_error)

    /* "brlapi.pyx":885
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__enterRawMode(self.h, c_driver)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 		else:
 */
  }

  /* "brlapi.pyx":888
 * 			raise OperationError()
 * 		else:
 * 			return retval             # <<<<<<<<<<<<<<
 * 
 * 	def leaveRawMode(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_retval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 888, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "brlapi.pyx":873
 * 			return retval
 * 
 * 	def enterRawMode(self, driver):             # <<<<<<<<<<<<<<
 * 		"""Switch to Raw mode
 * 		See brlapi_enterRawMode(3).
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("brlapi.Connection.enterRawMode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_driver);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":890
 * 			return retval
 * 
 * 	def leaveRawMode(self):             # <<<<<<<<<<<<<<
 * 		"""leave Raw mode
 * 		See brlapi_leaveRawMode(3)."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_41leaveRawMode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6brlapi_10Connection_40leaveRawMode[] = "Connection.leaveRawMode(self)\nleave Raw mode\n\t\tSee brlapi_leaveRawMode(3).";
static PyObject *__pyx_pw_6brlapi_10Connection_41leaveRawMode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("leaveRawMode (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_10Connection_40leaveRawMode(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self));

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

static PyObject *__pyx_pf_6brlapi_10Connection_40leaveRawMode(struct __pyx_obj_6brlapi_Connection *__pyx_v_self) {
  int __pyx_v_retval;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("leaveRawMode", 0);

  /* "brlapi.pyx":894
 * 		See brlapi_leaveRawMode(3)."""
 * 		cdef int retval
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__leaveRawMode(self.h)
 * 		if retval == -1:
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "brlapi.pyx":895
 * 		cdef int retval
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__leaveRawMode(self.h)             # <<<<<<<<<<<<<<
 * 		if retval == -1:
 * 			raise OperationError()
 */
        __pyx_v_retval = brlapi__leaveRawMode(__pyx_v_self->h);
      }

      /* "brlapi.pyx":894
 * 		See brlapi_leaveRawMode(3)."""
 * 		cdef int retval
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__leaveRawMode(self.h)
 * 		if retval == -1:
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "brlapi.pyx":896
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__leaveRawMode(self.h)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 		else:
 */
  __pyx_t_1 = ((__pyx_v_retval == -1L) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "brlapi.pyx":897
 * 			retval = c_brlapi.brlapi__leaveRawMode(self.h)
 * 		if retval == -1:
 * 			raise OperationError()             # <<<<<<<<<<<<<<
 * 		else:
 * 			return retval
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_OperationError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 897, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_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, 897, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 897, __pyx_L1_error)

    /* "brlapi.pyx":896
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__leaveRawMode(self.h)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 		else:
 */
  }

  /* "brlapi.pyx":899
 * 			raise OperationError()
 * 		else:
 * 			return retval             # <<<<<<<<<<<<<<
 * 
 * 	def getParameter(self, param, subparam = 0, flags = 0):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_retval); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 899, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "brlapi.pyx":890
 * 			return retval
 * 
 * 	def leaveRawMode(self):             # <<<<<<<<<<<<<<
 * 		"""leave Raw mode
 * 		See brlapi_leaveRawMode(3)."""
 */

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

/* "brlapi.pyx":901
 * 			return retval
 * 
 * 	def getParameter(self, param, subparam = 0, flags = 0):             # <<<<<<<<<<<<<<
 * 		"""Get the value of a parameter.
 * 		See brlapi_getParameter(3).
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_43getParameter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6brlapi_10Connection_42getParameter[] = "Connection.getParameter(self, param, subparam=0, flags=0)\nGet the value of a parameter.\n\t\tSee brlapi_getParameter(3).\n\n\t\tThis gets the current content of a parameter";
static PyObject *__pyx_pw_6brlapi_10Connection_43getParameter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_param = 0;
  PyObject *__pyx_v_subparam = 0;
  PyObject *__pyx_v_flags = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getParameter (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_param,&__pyx_n_s_subparam,&__pyx_n_s_flags,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_int_0);
    values[2] = ((PyObject *)__pyx_int_0);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  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_param)) != 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_subparam);
          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_flags);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getParameter") < 0)) __PYX_ERR(0, 901, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_param = values[0];
    __pyx_v_subparam = values[1];
    __pyx_v_flags = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getParameter", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 901, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("brlapi.Connection.getParameter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6brlapi_10Connection_42getParameter(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self), __pyx_v_param, __pyx_v_subparam, __pyx_v_flags);

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

static PyObject *__pyx_pf_6brlapi_10Connection_42getParameter(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_param, PyObject *__pyx_v_subparam, PyObject *__pyx_v_flags) {
  brlapi_param_t __pyx_v_c_param;
  brlapi_param_subparam_t __pyx_v_c_subparam;
  brlapi_param_flags_t __pyx_v_c_flags;
  void *__pyx_v_c_value;
  size_t __pyx_v_size;
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  brlapi_param_t __pyx_t_1;
  brlapi_param_subparam_t __pyx_t_2;
  brlapi_param_flags_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  char const *__pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getParameter", 0);

  /* "brlapi.pyx":918
 * 		cdef char *string
 * 
 * 		c_param = param             # <<<<<<<<<<<<<<
 * 		c_subparam = subparam
 * 		c_flags = flags
 */
  __pyx_t_1 = __Pyx_PyInt_As_brlapi_param_t(__pyx_v_param); if (unlikely((__pyx_t_1 == ((brlapi_param_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 918, __pyx_L1_error)
  __pyx_v_c_param = __pyx_t_1;

  /* "brlapi.pyx":919
 * 
 * 		c_param = param
 * 		c_subparam = subparam             # <<<<<<<<<<<<<<
 * 		c_flags = flags
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_v_subparam); if (unlikely((__pyx_t_2 == ((brlapi_param_subparam_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 919, __pyx_L1_error)
  __pyx_v_c_subparam = __pyx_t_2;

  /* "brlapi.pyx":920
 * 		c_param = param
 * 		c_subparam = subparam
 * 		c_flags = flags             # <<<<<<<<<<<<<<
 * 
 * 		with nogil:
 */
  __pyx_t_3 = __Pyx_PyInt_As_uint32_t(__pyx_v_flags); if (unlikely((__pyx_t_3 == ((brlapi_param_flags_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 920, __pyx_L1_error)
  __pyx_v_c_flags = __pyx_t_3;

  /* "brlapi.pyx":922
 * 		c_flags = flags
 * 
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			c_value = c_brlapi.brlapi__getParameterAlloc(self.h, c_param, c_subparam, c_flags, &size)
 * 		if c_value == NULL:
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "brlapi.pyx":923
 * 
 * 		with nogil:
 * 			c_value = c_brlapi.brlapi__getParameterAlloc(self.h, c_param, c_subparam, c_flags, &size)             # <<<<<<<<<<<<<<
 * 		if c_value == NULL:
 * 			raise OperationError()
 */
        __pyx_v_c_value = brlapi__getParameterAlloc(__pyx_v_self->h, __pyx_v_c_param, __pyx_v_c_subparam, __pyx_v_c_flags, (&__pyx_v_size));
      }

      /* "brlapi.pyx":922
 * 		c_flags = flags
 * 
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			c_value = c_brlapi.brlapi__getParameterAlloc(self.h, c_param, c_subparam, c_flags, &size)
 * 		if c_value == NULL:
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "brlapi.pyx":924
 * 		with nogil:
 * 			c_value = c_brlapi.brlapi__getParameterAlloc(self.h, c_param, c_subparam, c_flags, &size)
 * 		if c_value == NULL:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 
 */
  __pyx_t_4 = ((__pyx_v_c_value == NULL) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "brlapi.pyx":925
 * 			c_value = c_brlapi.brlapi__getParameterAlloc(self.h, c_param, c_subparam, c_flags, &size)
 * 		if c_value == NULL:
 * 			raise OperationError()             # <<<<<<<<<<<<<<
 * 
 * 		try:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_OperationError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 925, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 925, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 925, __pyx_L1_error)

    /* "brlapi.pyx":924
 * 		with nogil:
 * 			c_value = c_brlapi.brlapi__getParameterAlloc(self.h, c_param, c_subparam, c_flags, &size)
 * 		if c_value == NULL:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 
 */
  }

  /* "brlapi.pyx":927
 * 			raise OperationError()
 * 
 * 		try:             # <<<<<<<<<<<<<<
 * 			ret = _parameterToPython(c_param, c_value, size)
 * 		except Exception as e:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_10);
    /*try:*/ {

      /* "brlapi.pyx":928
 * 
 * 		try:
 * 			ret = _parameterToPython(c_param, c_value, size)             # <<<<<<<<<<<<<<
 * 		except Exception as e:
 * 			c_brlapi.free(c_value)
 */
      __pyx_t_5 = __pyx_f_6brlapi__parameterToPython(__pyx_v_c_param, __pyx_v_c_value, __pyx_v_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 928, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_v_ret = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "brlapi.pyx":927
 * 			raise OperationError()
 * 
 * 		try:             # <<<<<<<<<<<<<<
 * 			ret = _parameterToPython(c_param, c_value, size)
 * 		except Exception as e:
 */
    }
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    goto __pyx_L12_try_end;
    __pyx_L7_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "brlapi.pyx":929
 * 		try:
 * 			ret = _parameterToPython(c_param, c_value, size)
 * 		except Exception as e:             # <<<<<<<<<<<<<<
 * 			c_brlapi.free(c_value)
 * 			raise(e)
 */
    __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_11) {
      __Pyx_AddTraceback("brlapi.Connection.getParameter", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 929, __pyx_L9_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_e = __pyx_t_6;
      /*try:*/ {

        /* "brlapi.pyx":930
 * 			ret = _parameterToPython(c_param, c_value, size)
 * 		except Exception as e:
 * 			c_brlapi.free(c_value)             # <<<<<<<<<<<<<<
 * 			raise(e)
 * 
 */
        free(__pyx_v_c_value);

        /* "brlapi.pyx":931
 * 		except Exception as e:
 * 			c_brlapi.free(c_value)
 * 			raise(e)             # <<<<<<<<<<<<<<
 * 
 * 		c_brlapi.free(c_value)
 */
        __Pyx_Raise(__pyx_v_e, 0, 0, 0);
        __PYX_ERR(0, 931, __pyx_L18_error)
      }

      /* "brlapi.pyx":929
 * 		try:
 * 			ret = _parameterToPython(c_param, c_value, size)
 * 		except Exception as e:             # <<<<<<<<<<<<<<
 * 			c_brlapi.free(c_value)
 * 			raise(e)
 */
      /*finally:*/ {
        __pyx_L18_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __pyx_t_11 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_e);
            __pyx_v_e = NULL;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          }
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16);
          __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L9_except_error;
        }
      }
    }
    goto __pyx_L9_except_error;
    __pyx_L9_except_error:;

    /* "brlapi.pyx":927
 * 			raise OperationError()
 * 
 * 		try:             # <<<<<<<<<<<<<<
 * 			ret = _parameterToPython(c_param, c_value, size)
 * 		except Exception as e:
 */
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
    goto __pyx_L1_error;
    __pyx_L12_try_end:;
  }

  /* "brlapi.pyx":933
 * 			raise(e)
 * 
 * 		c_brlapi.free(c_value)             # <<<<<<<<<<<<<<
 * 		return ret
 * 
 */
  free(__pyx_v_c_value);

  /* "brlapi.pyx":934
 * 
 * 		c_brlapi.free(c_value)
 * 		return ret             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  /* "brlapi.pyx":901
 * 			return retval
 * 
 * 	def getParameter(self, param, subparam = 0, flags = 0):             # <<<<<<<<<<<<<<
 * 		"""Get the value of a parameter.
 * 		See brlapi_getParameter(3).
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("brlapi.Connection.getParameter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":937
 * 
 * 
 * 	def setParameter(self, param, subparam, flags, value):             # <<<<<<<<<<<<<<
 * 		"""Set the value of a parameter.
 * 		See brlapi_setParameter(3).
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_45setParameter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6brlapi_10Connection_44setParameter[] = "Connection.setParameter(self, param, subparam, flags, value)\nSet the value of a parameter.\n\t\tSee brlapi_setParameter(3).\n\n\t\tThis sets the content of a parameter";
static PyObject *__pyx_pw_6brlapi_10Connection_45setParameter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_param = 0;
  PyObject *__pyx_v_subparam = 0;
  PyObject *__pyx_v_flags = 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("setParameter (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_param,&__pyx_n_s_subparam,&__pyx_n_s_flags,&__pyx_n_s_value,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_param)) != 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_subparam)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("setParameter", 1, 4, 4, 1); __PYX_ERR(0, 937, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("setParameter", 1, 4, 4, 2); __PYX_ERR(0, 937, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("setParameter", 1, 4, 4, 3); __PYX_ERR(0, 937, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setParameter") < 0)) __PYX_ERR(0, 937, __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_param = values[0];
    __pyx_v_subparam = values[1];
    __pyx_v_flags = values[2];
    __pyx_v_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setParameter", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 937, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("brlapi.Connection.setParameter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6brlapi_10Connection_44setParameter(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self), __pyx_v_param, __pyx_v_subparam, __pyx_v_flags, __pyx_v_value);

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

static PyObject *__pyx_pf_6brlapi_10Connection_44setParameter(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_param, PyObject *__pyx_v_subparam, PyObject *__pyx_v_flags, PyObject *__pyx_v_value) {
  brlapi_param_t __pyx_v_c_param;
  brlapi_param_subparam_t __pyx_v_c_subparam;
  brlapi_param_flags_t __pyx_v_c_flags;
  void *__pyx_v_c_value;
  uint64_t *__pyx_v_values64;
  uint32_t *__pyx_v_values32;
  uint16_t *__pyx_v_values16;
  uint8_t *__pyx_v_values8;
  char *__pyx_v_string;
  brlapi_param_properties_t const *__pyx_v_props;
  Py_ssize_t __pyx_v_size;
  PyObject *__pyx_v_i = NULL;
  int __pyx_v_retval;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  brlapi_param_t __pyx_t_1;
  brlapi_param_subparam_t __pyx_t_2;
  brlapi_param_flags_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  char *__pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  uint8_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  uint16_t __pyx_t_14;
  uint32_t __pyx_t_15;
  uint64_t __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setParameter", 0);
  __Pyx_INCREF(__pyx_v_value);

  /* "brlapi.pyx":953
 * 		cdef const c_brlapi.brlapi_param_properties_t *props
 * 
 * 		c_param = param             # <<<<<<<<<<<<<<
 * 		c_subparam = subparam
 * 		c_flags = flags
 */
  __pyx_t_1 = __Pyx_PyInt_As_brlapi_param_t(__pyx_v_param); if (unlikely((__pyx_t_1 == ((brlapi_param_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 953, __pyx_L1_error)
  __pyx_v_c_param = __pyx_t_1;

  /* "brlapi.pyx":954
 * 
 * 		c_param = param
 * 		c_subparam = subparam             # <<<<<<<<<<<<<<
 * 		c_flags = flags
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_v_subparam); if (unlikely((__pyx_t_2 == ((brlapi_param_subparam_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 954, __pyx_L1_error)
  __pyx_v_c_subparam = __pyx_t_2;

  /* "brlapi.pyx":955
 * 		c_param = param
 * 		c_subparam = subparam
 * 		c_flags = flags             # <<<<<<<<<<<<<<
 * 
 * 		with nogil:
 */
  __pyx_t_3 = __Pyx_PyInt_As_uint32_t(__pyx_v_flags); if (unlikely((__pyx_t_3 == ((brlapi_param_flags_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 955, __pyx_L1_error)
  __pyx_v_c_flags = __pyx_t_3;

  /* "brlapi.pyx":957
 * 		c_flags = flags
 * 
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			props = c_brlapi.brlapi_getParameterProperties(c_param)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "brlapi.pyx":958
 * 
 * 		with nogil:
 * 			props = c_brlapi.brlapi_getParameterProperties(c_param)             # <<<<<<<<<<<<<<
 * 
 * 		if props == NULL:
 */
        __pyx_v_props = brlapi_getParameterProperties(__pyx_v_c_param);
      }

      /* "brlapi.pyx":957
 * 		c_flags = flags
 * 
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			props = c_brlapi.brlapi_getParameterProperties(c_param)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "brlapi.pyx":960
 * 			props = c_brlapi.brlapi_getParameterProperties(c_param)
 * 
 * 		if props == NULL:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 
 */
  __pyx_t_4 = ((__pyx_v_props == NULL) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "brlapi.pyx":961
 * 
 * 		if props == NULL:
 * 			raise OperationError()             # <<<<<<<<<<<<<<
 * 
 * 		if props.type == PARAM_TYPE_STRING:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_OperationError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 961, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 961, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 961, __pyx_L1_error)

    /* "brlapi.pyx":960
 * 			props = c_brlapi.brlapi_getParameterProperties(c_param)
 * 
 * 		if props == NULL:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 
 */
  }

  /* "brlapi.pyx":963
 * 			raise OperationError()
 * 
 * 		if props.type == PARAM_TYPE_STRING:             # <<<<<<<<<<<<<<
 * 			if type(value) != unicode and type(value) != str:
 * 				raise ValueError("String value expected")
 */
  __pyx_t_5 = __Pyx_PyInt_From_brlapi_param_type_t(__pyx_v_props->type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PARAM_TYPE_STRING); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__pyx_t_4) {

    /* "brlapi.pyx":964
 * 
 * 		if props.type == PARAM_TYPE_STRING:
 * 			if type(value) != unicode and type(value) != str:             # <<<<<<<<<<<<<<
 * 				raise ValueError("String value expected")
 * 
 */
    __pyx_t_7 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_value)), ((PyObject *)(&PyUnicode_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 964, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 964, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_8) {
    } else {
      __pyx_t_4 = __pyx_t_8;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_7 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_value)), ((PyObject *)(&PyUnicode_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 964, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 964, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_4 = __pyx_t_8;
    __pyx_L9_bool_binop_done:;
    if (unlikely(__pyx_t_4)) {

      /* "brlapi.pyx":965
 * 		if props.type == PARAM_TYPE_STRING:
 * 			if type(value) != unicode and type(value) != str:
 * 				raise ValueError("String value expected")             # <<<<<<<<<<<<<<
 * 
 * 		if props.type == PARAM_TYPE_BOOLEAN:
 */
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 965, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_Raise(__pyx_t_7, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __PYX_ERR(0, 965, __pyx_L1_error)

      /* "brlapi.pyx":964
 * 
 * 		if props.type == PARAM_TYPE_STRING:
 * 			if type(value) != unicode and type(value) != str:             # <<<<<<<<<<<<<<
 * 				raise ValueError("String value expected")
 * 
 */
    }

    /* "brlapi.pyx":963
 * 			raise OperationError()
 * 
 * 		if props.type == PARAM_TYPE_STRING:             # <<<<<<<<<<<<<<
 * 			if type(value) != unicode and type(value) != str:
 * 				raise ValueError("String value expected")
 */
  }

  /* "brlapi.pyx":967
 * 				raise ValueError("String value expected")
 * 
 * 		if props.type == PARAM_TYPE_BOOLEAN:             # <<<<<<<<<<<<<<
 * 			if props.isArray:
 * 				if type(value[0]) != bool:
 */
  __pyx_t_7 = __Pyx_PyInt_From_brlapi_param_type_t(__pyx_v_props->type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PARAM_TYPE_BOOLEAN); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_7, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 967, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 967, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_4) {

    /* "brlapi.pyx":968
 * 
 * 		if props.type == PARAM_TYPE_BOOLEAN:
 * 			if props.isArray:             # <<<<<<<<<<<<<<
 * 				if type(value[0]) != bool:
 * 					raise ValueError("Boolean values expected")
 */
    __pyx_t_4 = (__pyx_v_props->isArray != 0);
    if (__pyx_t_4) {

      /* "brlapi.pyx":969
 * 		if props.type == PARAM_TYPE_BOOLEAN:
 * 			if props.isArray:
 * 				if type(value[0]) != bool:             # <<<<<<<<<<<<<<
 * 					raise ValueError("Boolean values expected")
 * 			else:
 */
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_value, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 969, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_t_5)), ((PyObject*)&PyBool_Type), Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 969, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 969, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(__pyx_t_4)) {

        /* "brlapi.pyx":970
 * 			if props.isArray:
 * 				if type(value[0]) != bool:
 * 					raise ValueError("Boolean values expected")             # <<<<<<<<<<<<<<
 * 			else:
 * 				if type(value) != bool:
 */
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 970, __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, 970, __pyx_L1_error)

        /* "brlapi.pyx":969
 * 		if props.type == PARAM_TYPE_BOOLEAN:
 * 			if props.isArray:
 * 				if type(value[0]) != bool:             # <<<<<<<<<<<<<<
 * 					raise ValueError("Boolean values expected")
 * 			else:
 */
      }

      /* "brlapi.pyx":968
 * 
 * 		if props.type == PARAM_TYPE_BOOLEAN:
 * 			if props.isArray:             # <<<<<<<<<<<<<<
 * 				if type(value[0]) != bool:
 * 					raise ValueError("Boolean values expected")
 */
      goto __pyx_L12;
    }

    /* "brlapi.pyx":972
 * 					raise ValueError("Boolean values expected")
 * 			else:
 * 				if type(value) != bool:             # <<<<<<<<<<<<<<
 * 					raise ValueError("Boolean value expected")
 * 
 */
    /*else*/ {
      __pyx_t_6 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_value)), ((PyObject*)&PyBool_Type), Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 972, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 972, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(__pyx_t_4)) {

        /* "brlapi.pyx":973
 * 			else:
 * 				if type(value) != bool:
 * 					raise ValueError("Boolean value expected")             # <<<<<<<<<<<<<<
 * 
 * 		if props.type == PARAM_TYPE_UINT8 or \
 */
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 973, __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, 973, __pyx_L1_error)

        /* "brlapi.pyx":972
 * 					raise ValueError("Boolean values expected")
 * 			else:
 * 				if type(value) != bool:             # <<<<<<<<<<<<<<
 * 					raise ValueError("Boolean value expected")
 * 
 */
      }
    }
    __pyx_L12:;

    /* "brlapi.pyx":967
 * 				raise ValueError("String value expected")
 * 
 * 		if props.type == PARAM_TYPE_BOOLEAN:             # <<<<<<<<<<<<<<
 * 			if props.isArray:
 * 				if type(value[0]) != bool:
 */
  }

  /* "brlapi.pyx":975
 * 					raise ValueError("Boolean value expected")
 * 
 * 		if props.type == PARAM_TYPE_UINT8 or \             # <<<<<<<<<<<<<<
 * 		   props.type == PARAM_TYPE_UINT16 or \
 * 		   props.type == PARAM_TYPE_UINT32:
 */
  __pyx_t_6 = __Pyx_PyInt_From_brlapi_param_type_t(__pyx_v_props->type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PARAM_TYPE_UINT8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 975, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 975, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (!__pyx_t_8) {
  } else {
    __pyx_t_4 = __pyx_t_8;
    goto __pyx_L16_bool_binop_done;
  }

  /* "brlapi.pyx":976
 * 
 * 		if props.type == PARAM_TYPE_UINT8 or \
 * 		   props.type == PARAM_TYPE_UINT16 or \             # <<<<<<<<<<<<<<
 * 		   props.type == PARAM_TYPE_UINT32:
 * 			if props.isArray:
 */
  __pyx_t_7 = __Pyx_PyInt_From_brlapi_param_type_t(__pyx_v_props->type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PARAM_TYPE_UINT16); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 976, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 976, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (!__pyx_t_8) {
  } else {
    __pyx_t_4 = __pyx_t_8;
    goto __pyx_L16_bool_binop_done;
  }

  /* "brlapi.pyx":977
 * 		if props.type == PARAM_TYPE_UINT8 or \
 * 		   props.type == PARAM_TYPE_UINT16 or \
 * 		   props.type == PARAM_TYPE_UINT32:             # <<<<<<<<<<<<<<
 * 			if props.isArray:
 * 				if type(value[0]) != int:
 */
  __pyx_t_6 = __Pyx_PyInt_From_brlapi_param_type_t(__pyx_v_props->type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PARAM_TYPE_UINT32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 977, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 977, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_4 = __pyx_t_8;
  __pyx_L16_bool_binop_done:;

  /* "brlapi.pyx":975
 * 					raise ValueError("Boolean value expected")
 * 
 * 		if props.type == PARAM_TYPE_UINT8 or \             # <<<<<<<<<<<<<<
 * 		   props.type == PARAM_TYPE_UINT16 or \
 * 		   props.type == PARAM_TYPE_UINT32:
 */
  if (__pyx_t_4) {

    /* "brlapi.pyx":978
 * 		   props.type == PARAM_TYPE_UINT16 or \
 * 		   props.type == PARAM_TYPE_UINT32:
 * 			if props.isArray:             # <<<<<<<<<<<<<<
 * 				if type(value[0]) != int:
 * 					raise ValueError("Integer values expected")
 */
    __pyx_t_4 = (__pyx_v_props->isArray != 0);
    if (__pyx_t_4) {

      /* "brlapi.pyx":979
 * 		   props.type == PARAM_TYPE_UINT32:
 * 			if props.isArray:
 * 				if type(value[0]) != int:             # <<<<<<<<<<<<<<
 * 					raise ValueError("Integer values expected")
 * 			else:
 */
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_value, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 979, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_t_7)), ((PyObject *)(&PyInt_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 979, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 979, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(__pyx_t_4)) {

        /* "brlapi.pyx":980
 * 			if props.isArray:
 * 				if type(value[0]) != int:
 * 					raise ValueError("Integer values expected")             # <<<<<<<<<<<<<<
 * 			else:
 * 				if type(value) != int:
 */
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 980, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_Raise(__pyx_t_5, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __PYX_ERR(0, 980, __pyx_L1_error)

        /* "brlapi.pyx":979
 * 		   props.type == PARAM_TYPE_UINT32:
 * 			if props.isArray:
 * 				if type(value[0]) != int:             # <<<<<<<<<<<<<<
 * 					raise ValueError("Integer values expected")
 * 			else:
 */
      }

      /* "brlapi.pyx":978
 * 		   props.type == PARAM_TYPE_UINT16 or \
 * 		   props.type == PARAM_TYPE_UINT32:
 * 			if props.isArray:             # <<<<<<<<<<<<<<
 * 				if type(value[0]) != int:
 * 					raise ValueError("Integer values expected")
 */
      goto __pyx_L19;
    }

    /* "brlapi.pyx":982
 * 					raise ValueError("Integer values expected")
 * 			else:
 * 				if type(value) != int:             # <<<<<<<<<<<<<<
 * 					raise ValueError("Integer value expected")
 * 
 */
    /*else*/ {
      __pyx_t_5 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_value)), ((PyObject *)(&PyInt_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 982, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 982, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(__pyx_t_4)) {

        /* "brlapi.pyx":983
 * 			else:
 * 				if type(value) != int:
 * 					raise ValueError("Integer value expected")             # <<<<<<<<<<<<<<
 * 
 * 		if props.type == PARAM_TYPE_STRING:
 */
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 983, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_Raise(__pyx_t_5, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __PYX_ERR(0, 983, __pyx_L1_error)

        /* "brlapi.pyx":982
 * 					raise ValueError("Integer values expected")
 * 			else:
 * 				if type(value) != int:             # <<<<<<<<<<<<<<
 * 					raise ValueError("Integer value expected")
 * 
 */
      }
    }
    __pyx_L19:;

    /* "brlapi.pyx":975
 * 					raise ValueError("Boolean value expected")
 * 
 * 		if props.type == PARAM_TYPE_UINT8 or \             # <<<<<<<<<<<<<<
 * 		   props.type == PARAM_TYPE_UINT16 or \
 * 		   props.type == PARAM_TYPE_UINT32:
 */
  }

  /* "brlapi.pyx":985
 * 					raise ValueError("Integer value expected")
 * 
 * 		if props.type == PARAM_TYPE_STRING:             # <<<<<<<<<<<<<<
 * 			if type(value) == unicode:
 * 				value = value.encode('UTF-8')
 */
  __pyx_t_5 = __Pyx_PyInt_From_brlapi_param_type_t(__pyx_v_props->type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 985, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_PARAM_TYPE_STRING); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 985, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 985, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 985, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_4) {

    /* "brlapi.pyx":986
 * 
 * 		if props.type == PARAM_TYPE_STRING:
 * 			if type(value) == unicode:             # <<<<<<<<<<<<<<
 * 				value = value.encode('UTF-8')
 * 			size = len(value)
 */
    __pyx_t_6 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_value)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 986, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 986, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_4) {

      /* "brlapi.pyx":987
 * 		if props.type == PARAM_TYPE_STRING:
 * 			if type(value) == unicode:
 * 				value = value.encode('UTF-8')             # <<<<<<<<<<<<<<
 * 			size = len(value)
 * 			c_value = <void*>c_brlapi.malloc(size)
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 987, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_5, __pyx_kp_u_UTF_8) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_kp_u_UTF_8);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 987, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "brlapi.pyx":986
 * 
 * 		if props.type == PARAM_TYPE_STRING:
 * 			if type(value) == unicode:             # <<<<<<<<<<<<<<
 * 				value = value.encode('UTF-8')
 * 			size = len(value)
 */
    }

    /* "brlapi.pyx":988
 * 			if type(value) == unicode:
 * 				value = value.encode('UTF-8')
 * 			size = len(value)             # <<<<<<<<<<<<<<
 * 			c_value = <void*>c_brlapi.malloc(size)
 * 			values8 = <uint8_t *>c_value
 */
    __pyx_t_9 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 988, __pyx_L1_error)
    __pyx_v_size = __pyx_t_9;

    /* "brlapi.pyx":989
 * 				value = value.encode('UTF-8')
 * 			size = len(value)
 * 			c_value = <void*>c_brlapi.malloc(size)             # <<<<<<<<<<<<<<
 * 			values8 = <uint8_t *>c_value
 * 			string = value
 */
    __pyx_v_c_value = ((void *)malloc(__pyx_v_size));

    /* "brlapi.pyx":990
 * 			size = len(value)
 * 			c_value = <void*>c_brlapi.malloc(size)
 * 			values8 = <uint8_t *>c_value             # <<<<<<<<<<<<<<
 * 			string = value
 * 			c_brlapi.memcpy(<void*>values8,<void*>string,size)
 */
    __pyx_v_values8 = ((uint8_t *)__pyx_v_c_value);

    /* "brlapi.pyx":991
 * 			c_value = <void*>c_brlapi.malloc(size)
 * 			values8 = <uint8_t *>c_value
 * 			string = value             # <<<<<<<<<<<<<<
 * 			c_brlapi.memcpy(<void*>values8,<void*>string,size)
 * 		elif props.type == PARAM_TYPE_BOOLEAN or props.type == PARAM_TYPE_UINT8:
 */
    __pyx_t_10 = __Pyx_PyObject_AsWritableString(__pyx_v_value); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 991, __pyx_L1_error)
    __pyx_v_string = __pyx_t_10;

    /* "brlapi.pyx":992
 * 			values8 = <uint8_t *>c_value
 * 			string = value
 * 			c_brlapi.memcpy(<void*>values8,<void*>string,size)             # <<<<<<<<<<<<<<
 * 		elif props.type == PARAM_TYPE_BOOLEAN or props.type == PARAM_TYPE_UINT8:
 * 			if props.isArray:
 */
    (void)(memcpy(((void *)__pyx_v_values8), ((void *)__pyx_v_string), __pyx_v_size));

    /* "brlapi.pyx":985
 * 					raise ValueError("Integer value expected")
 * 
 * 		if props.type == PARAM_TYPE_STRING:             # <<<<<<<<<<<<<<
 * 			if type(value) == unicode:
 * 				value = value.encode('UTF-8')
 */
    goto __pyx_L22;
  }

  /* "brlapi.pyx":993
 * 			string = value
 * 			c_brlapi.memcpy(<void*>values8,<void*>string,size)
 * 		elif props.type == PARAM_TYPE_BOOLEAN or props.type == PARAM_TYPE_UINT8:             # <<<<<<<<<<<<<<
 * 			if props.isArray:
 * 				size = 1 * len(value)
 */
  __pyx_t_6 = __Pyx_PyInt_From_brlapi_param_type_t(__pyx_v_props->type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_PARAM_TYPE_BOOLEAN); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 993, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 993, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (!__pyx_t_8) {
  } else {
    __pyx_t_4 = __pyx_t_8;
    goto __pyx_L24_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_PyInt_From_brlapi_param_type_t(__pyx_v_props->type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_PARAM_TYPE_UINT8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 993, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 993, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_4 = __pyx_t_8;
  __pyx_L24_bool_binop_done:;
  if (__pyx_t_4) {

    /* "brlapi.pyx":994
 * 			c_brlapi.memcpy(<void*>values8,<void*>string,size)
 * 		elif props.type == PARAM_TYPE_BOOLEAN or props.type == PARAM_TYPE_UINT8:
 * 			if props.isArray:             # <<<<<<<<<<<<<<
 * 				size = 1 * len(value)
 * 				c_value = <void*>c_brlapi.malloc(size)
 */
    __pyx_t_4 = (__pyx_v_props->isArray != 0);
    if (__pyx_t_4) {

      /* "brlapi.pyx":995
 * 		elif props.type == PARAM_TYPE_BOOLEAN or props.type == PARAM_TYPE_UINT8:
 * 			if props.isArray:
 * 				size = 1 * len(value)             # <<<<<<<<<<<<<<
 * 				c_value = <void*>c_brlapi.malloc(size)
 * 				values8 = <uint8_t *>c_value
 */
      __pyx_t_9 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 995, __pyx_L1_error)
      __pyx_v_size = (1 * __pyx_t_9);

      /* "brlapi.pyx":996
 * 			if props.isArray:
 * 				size = 1 * len(value)
 * 				c_value = <void*>c_brlapi.malloc(size)             # <<<<<<<<<<<<<<
 * 				values8 = <uint8_t *>c_value
 * 				for i in len(value):
 */
      __pyx_v_c_value = ((void *)malloc(__pyx_v_size));

      /* "brlapi.pyx":997
 * 				size = 1 * len(value)
 * 				c_value = <void*>c_brlapi.malloc(size)
 * 				values8 = <uint8_t *>c_value             # <<<<<<<<<<<<<<
 * 				for i in len(value):
 * 					values8[i] = value[i]
 */
      __pyx_v_values8 = ((uint8_t *)__pyx_v_c_value);

      /* "brlapi.pyx":998
 * 				c_value = <void*>c_brlapi.malloc(size)
 * 				values8 = <uint8_t *>c_value
 * 				for i in len(value):             # <<<<<<<<<<<<<<
 * 					values8[i] = value[i]
 * 			else:
 */
      __pyx_t_9 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 998, __pyx_L1_error)
      __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 998, __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_9 = 0;
        __pyx_t_11 = NULL;
      } else {
        __pyx_t_9 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 998, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_11 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 998, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      for (;;) {
        if (likely(!__pyx_t_11)) {
          if (likely(PyList_CheckExact(__pyx_t_7))) {
            if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_7)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 998, __pyx_L1_error)
            #else
            __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 998, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          } else {
            if (__pyx_t_9 >= 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_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 998, __pyx_L1_error)
            #else
            __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 998, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          }
        } else {
          __pyx_t_6 = __pyx_t_11(__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, 998, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_6);
        }
        __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6);
        __pyx_t_6 = 0;

        /* "brlapi.pyx":999
 * 				values8 = <uint8_t *>c_value
 * 				for i in len(value):
 * 					values8[i] = value[i]             # <<<<<<<<<<<<<<
 * 			else:
 * 				size = 1
 */
        __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_value, __pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 999, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_12 = __Pyx_PyInt_As_uint8_t(__pyx_t_6); if (unlikely((__pyx_t_12 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 999, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 999, __pyx_L1_error)
        (__pyx_v_values8[__pyx_t_13]) = __pyx_t_12;

        /* "brlapi.pyx":998
 * 				c_value = <void*>c_brlapi.malloc(size)
 * 				values8 = <uint8_t *>c_value
 * 				for i in len(value):             # <<<<<<<<<<<<<<
 * 					values8[i] = value[i]
 * 			else:
 */
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "brlapi.pyx":994
 * 			c_brlapi.memcpy(<void*>values8,<void*>string,size)
 * 		elif props.type == PARAM_TYPE_BOOLEAN or props.type == PARAM_TYPE_UINT8:
 * 			if props.isArray:             # <<<<<<<<<<<<<<
 * 				size = 1 * len(value)
 * 				c_value = <void*>c_brlapi.malloc(size)
 */
      goto __pyx_L26;
    }

    /* "brlapi.pyx":1001
 * 					values8[i] = value[i]
 * 			else:
 * 				size = 1             # <<<<<<<<<<<<<<
 * 				c_value = <void*>c_brlapi.malloc(size)
 * 				values8 = <uint8_t *>c_value
 */
    /*else*/ {
      __pyx_v_size = 1;

      /* "brlapi.pyx":1002
 * 			else:
 * 				size = 1
 * 				c_value = <void*>c_brlapi.malloc(size)             # <<<<<<<<<<<<<<
 * 				values8 = <uint8_t *>c_value
 * 				values8[0] = value
 */
      __pyx_v_c_value = ((void *)malloc(__pyx_v_size));

      /* "brlapi.pyx":1003
 * 				size = 1
 * 				c_value = <void*>c_brlapi.malloc(size)
 * 				values8 = <uint8_t *>c_value             # <<<<<<<<<<<<<<
 * 				values8[0] = value
 * 		elif props.type == PARAM_TYPE_UINT16:
 */
      __pyx_v_values8 = ((uint8_t *)__pyx_v_c_value);

      /* "brlapi.pyx":1004
 * 				c_value = <void*>c_brlapi.malloc(size)
 * 				values8 = <uint8_t *>c_value
 * 				values8[0] = value             # <<<<<<<<<<<<<<
 * 		elif props.type == PARAM_TYPE_UINT16:
 * 			if props.isArray:
 */
      __pyx_t_12 = __Pyx_PyInt_As_uint8_t(__pyx_v_value); if (unlikely((__pyx_t_12 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1004, __pyx_L1_error)
      (__pyx_v_values8[0]) = __pyx_t_12;
    }
    __pyx_L26:;

    /* "brlapi.pyx":993
 * 			string = value
 * 			c_brlapi.memcpy(<void*>values8,<void*>string,size)
 * 		elif props.type == PARAM_TYPE_BOOLEAN or props.type == PARAM_TYPE_UINT8:             # <<<<<<<<<<<<<<
 * 			if props.isArray:
 * 				size = 1 * len(value)
 */
    goto __pyx_L22;
  }

  /* "brlapi.pyx":1005
 * 				values8 = <uint8_t *>c_value
 * 				values8[0] = value
 * 		elif props.type == PARAM_TYPE_UINT16:             # <<<<<<<<<<<<<<
 * 			if props.isArray:
 * 				size = 2 * len(value)
 */
  __pyx_t_7 = __Pyx_PyInt_From_brlapi_param_type_t(__pyx_v_props->type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PARAM_TYPE_UINT16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_7, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1005, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1005, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_4) {

    /* "brlapi.pyx":1006
 * 				values8[0] = value
 * 		elif props.type == PARAM_TYPE_UINT16:
 * 			if props.isArray:             # <<<<<<<<<<<<<<
 * 				size = 2 * len(value)
 * 				c_value = <void*>c_brlapi.malloc(size)
 */
    __pyx_t_4 = (__pyx_v_props->isArray != 0);
    if (__pyx_t_4) {

      /* "brlapi.pyx":1007
 * 		elif props.type == PARAM_TYPE_UINT16:
 * 			if props.isArray:
 * 				size = 2 * len(value)             # <<<<<<<<<<<<<<
 * 				c_value = <void*>c_brlapi.malloc(size)
 * 				values16 = <uint16_t *>c_value
 */
      __pyx_t_9 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1007, __pyx_L1_error)
      __pyx_v_size = (2 * __pyx_t_9);

      /* "brlapi.pyx":1008
 * 			if props.isArray:
 * 				size = 2 * len(value)
 * 				c_value = <void*>c_brlapi.malloc(size)             # <<<<<<<<<<<<<<
 * 				values16 = <uint16_t *>c_value
 * 				for i in len(value):
 */
      __pyx_v_c_value = ((void *)malloc(__pyx_v_size));

      /* "brlapi.pyx":1009
 * 				size = 2 * len(value)
 * 				c_value = <void*>c_brlapi.malloc(size)
 * 				values16 = <uint16_t *>c_value             # <<<<<<<<<<<<<<
 * 				for i in len(value):
 * 					values16[i] = value[i]
 */
      __pyx_v_values16 = ((uint16_t *)__pyx_v_c_value);

      /* "brlapi.pyx":1010
 * 				c_value = <void*>c_brlapi.malloc(size)
 * 				values16 = <uint16_t *>c_value
 * 				for i in len(value):             # <<<<<<<<<<<<<<
 * 					values16[i] = value[i]
 * 			else:
 */
      __pyx_t_9 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1010, __pyx_L1_error)
      __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1010, __pyx_L1_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_9 = 0;
        __pyx_t_11 = NULL;
      } else {
        __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1010, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1010, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      for (;;) {
        if (likely(!__pyx_t_11)) {
          if (likely(PyList_CheckExact(__pyx_t_6))) {
            if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_5); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1010, __pyx_L1_error)
            #else
            __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1010, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            #endif
          } else {
            if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_5); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1010, __pyx_L1_error)
            #else
            __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1010, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            #endif
          }
        } else {
          __pyx_t_5 = __pyx_t_11(__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, 1010, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_5);
        }
        __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "brlapi.pyx":1011
 * 				values16 = <uint16_t *>c_value
 * 				for i in len(value):
 * 					values16[i] = value[i]             # <<<<<<<<<<<<<<
 * 			else:
 * 				size = 2
 */
        __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_value, __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1011, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_14 = __Pyx_PyInt_As_uint16_t(__pyx_t_5); if (unlikely((__pyx_t_14 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1011, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1011, __pyx_L1_error)
        (__pyx_v_values16[__pyx_t_13]) = __pyx_t_14;

        /* "brlapi.pyx":1010
 * 				c_value = <void*>c_brlapi.malloc(size)
 * 				values16 = <uint16_t *>c_value
 * 				for i in len(value):             # <<<<<<<<<<<<<<
 * 					values16[i] = value[i]
 * 			else:
 */
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "brlapi.pyx":1006
 * 				values8[0] = value
 * 		elif props.type == PARAM_TYPE_UINT16:
 * 			if props.isArray:             # <<<<<<<<<<<<<<
 * 				size = 2 * len(value)
 * 				c_value = <void*>c_brlapi.malloc(size)
 */
      goto __pyx_L29;
    }

    /* "brlapi.pyx":1013
 * 					values16[i] = value[i]
 * 			else:
 * 				size = 2             # <<<<<<<<<<<<<<
 * 				c_value = <void*>c_brlapi.malloc(size)
 * 				values16 = <uint16_t *>c_value
 */
    /*else*/ {
      __pyx_v_size = 2;

      /* "brlapi.pyx":1014
 * 			else:
 * 				size = 2
 * 				c_value = <void*>c_brlapi.malloc(size)             # <<<<<<<<<<<<<<
 * 				values16 = <uint16_t *>c_value
 * 				values16[0] = value
 */
      __pyx_v_c_value = ((void *)malloc(__pyx_v_size));

      /* "brlapi.pyx":1015
 * 				size = 2
 * 				c_value = <void*>c_brlapi.malloc(size)
 * 				values16 = <uint16_t *>c_value             # <<<<<<<<<<<<<<
 * 				values16[0] = value
 * 		elif props.type == PARAM_TYPE_UINT32:
 */
      __pyx_v_values16 = ((uint16_t *)__pyx_v_c_value);

      /* "brlapi.pyx":1016
 * 				c_value = <void*>c_brlapi.malloc(size)
 * 				values16 = <uint16_t *>c_value
 * 				values16[0] = value             # <<<<<<<<<<<<<<
 * 		elif props.type == PARAM_TYPE_UINT32:
 * 			if props.isArray:
 */
      __pyx_t_14 = __Pyx_PyInt_As_uint16_t(__pyx_v_value); if (unlikely((__pyx_t_14 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1016, __pyx_L1_error)
      (__pyx_v_values16[0]) = __pyx_t_14;
    }
    __pyx_L29:;

    /* "brlapi.pyx":1005
 * 				values8 = <uint8_t *>c_value
 * 				values8[0] = value
 * 		elif props.type == PARAM_TYPE_UINT16:             # <<<<<<<<<<<<<<
 * 			if props.isArray:
 * 				size = 2 * len(value)
 */
    goto __pyx_L22;
  }

  /* "brlapi.pyx":1017
 * 				values16 = <uint16_t *>c_value
 * 				values16[0] = value
 * 		elif props.type == PARAM_TYPE_UINT32:             # <<<<<<<<<<<<<<
 * 			if props.isArray:
 * 				size = 4 * len(value)
 */
  __pyx_t_6 = __Pyx_PyInt_From_brlapi_param_type_t(__pyx_v_props->type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PARAM_TYPE_UINT32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1017, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1017, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__pyx_t_4) {

    /* "brlapi.pyx":1018
 * 				values16[0] = value
 * 		elif props.type == PARAM_TYPE_UINT32:
 * 			if props.isArray:             # <<<<<<<<<<<<<<
 * 				size = 4 * len(value)
 * 				c_value = <void*>c_brlapi.malloc(size)
 */
    __pyx_t_4 = (__pyx_v_props->isArray != 0);
    if (__pyx_t_4) {

      /* "brlapi.pyx":1019
 * 		elif props.type == PARAM_TYPE_UINT32:
 * 			if props.isArray:
 * 				size = 4 * len(value)             # <<<<<<<<<<<<<<
 * 				c_value = <void*>c_brlapi.malloc(size)
 * 				values32 = <uint32_t *>c_value
 */
      __pyx_t_9 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1019, __pyx_L1_error)
      __pyx_v_size = (4 * __pyx_t_9);

      /* "brlapi.pyx":1020
 * 			if props.isArray:
 * 				size = 4 * len(value)
 * 				c_value = <void*>c_brlapi.malloc(size)             # <<<<<<<<<<<<<<
 * 				values32 = <uint32_t *>c_value
 * 				for i in len(value):
 */
      __pyx_v_c_value = ((void *)malloc(__pyx_v_size));

      /* "brlapi.pyx":1021
 * 				size = 4 * len(value)
 * 				c_value = <void*>c_brlapi.malloc(size)
 * 				values32 = <uint32_t *>c_value             # <<<<<<<<<<<<<<
 * 				for i in len(value):
 * 					values32[i] = value[i]
 */
      __pyx_v_values32 = ((uint32_t *)__pyx_v_c_value);

      /* "brlapi.pyx":1022
 * 				c_value = <void*>c_brlapi.malloc(size)
 * 				values32 = <uint32_t *>c_value
 * 				for i in len(value):             # <<<<<<<<<<<<<<
 * 					values32[i] = value[i]
 * 			else:
 */
      __pyx_t_9 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1022, __pyx_L1_error)
      __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1022, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
        __pyx_t_5 = __pyx_t_7; __Pyx_INCREF(__pyx_t_5); __pyx_t_9 = 0;
        __pyx_t_11 = NULL;
      } else {
        __pyx_t_9 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1022, __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, 1022, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      for (;;) {
        if (likely(!__pyx_t_11)) {
          if (likely(PyList_CheckExact(__pyx_t_5))) {
            if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1022, __pyx_L1_error)
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1022, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            #endif
          } else {
            if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1022, __pyx_L1_error)
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1022, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            #endif
          }
        } else {
          __pyx_t_7 = __pyx_t_11(__pyx_t_5);
          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, 1022, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_7);
        }
        __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "brlapi.pyx":1023
 * 				values32 = <uint32_t *>c_value
 * 				for i in len(value):
 * 					values32[i] = value[i]             # <<<<<<<<<<<<<<
 * 			else:
 * 				size = 4
 */
        __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_value, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1023, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_15 = __Pyx_PyInt_As_uint32_t(__pyx_t_7); if (unlikely((__pyx_t_15 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1023, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1023, __pyx_L1_error)
        (__pyx_v_values32[__pyx_t_13]) = __pyx_t_15;

        /* "brlapi.pyx":1022
 * 				c_value = <void*>c_brlapi.malloc(size)
 * 				values32 = <uint32_t *>c_value
 * 				for i in len(value):             # <<<<<<<<<<<<<<
 * 					values32[i] = value[i]
 * 			else:
 */
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "brlapi.pyx":1018
 * 				values16[0] = value
 * 		elif props.type == PARAM_TYPE_UINT32:
 * 			if props.isArray:             # <<<<<<<<<<<<<<
 * 				size = 4 * len(value)
 * 				c_value = <void*>c_brlapi.malloc(size)
 */
      goto __pyx_L32;
    }

    /* "brlapi.pyx":1025
 * 					values32[i] = value[i]
 * 			else:
 * 				size = 4             # <<<<<<<<<<<<<<
 * 				c_value = <void*>c_brlapi.malloc(size)
 * 				values32 = <uint32_t *>c_value
 */
    /*else*/ {
      __pyx_v_size = 4;

      /* "brlapi.pyx":1026
 * 			else:
 * 				size = 4
 * 				c_value = <void*>c_brlapi.malloc(size)             # <<<<<<<<<<<<<<
 * 				values32 = <uint32_t *>c_value
 * 				values32[0] = value
 */
      __pyx_v_c_value = ((void *)malloc(__pyx_v_size));

      /* "brlapi.pyx":1027
 * 				size = 4
 * 				c_value = <void*>c_brlapi.malloc(size)
 * 				values32 = <uint32_t *>c_value             # <<<<<<<<<<<<<<
 * 				values32[0] = value
 * 		elif props.type == PARAM_TYPE_UINT64:
 */
      __pyx_v_values32 = ((uint32_t *)__pyx_v_c_value);

      /* "brlapi.pyx":1028
 * 				c_value = <void*>c_brlapi.malloc(size)
 * 				values32 = <uint32_t *>c_value
 * 				values32[0] = value             # <<<<<<<<<<<<<<
 * 		elif props.type == PARAM_TYPE_UINT64:
 * 			if props.isArray:
 */
      __pyx_t_15 = __Pyx_PyInt_As_uint32_t(__pyx_v_value); if (unlikely((__pyx_t_15 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1028, __pyx_L1_error)
      (__pyx_v_values32[0]) = __pyx_t_15;
    }
    __pyx_L32:;

    /* "brlapi.pyx":1017
 * 				values16 = <uint16_t *>c_value
 * 				values16[0] = value
 * 		elif props.type == PARAM_TYPE_UINT32:             # <<<<<<<<<<<<<<
 * 			if props.isArray:
 * 				size = 4 * len(value)
 */
    goto __pyx_L22;
  }

  /* "brlapi.pyx":1029
 * 				values32 = <uint32_t *>c_value
 * 				values32[0] = value
 * 		elif props.type == PARAM_TYPE_UINT64:             # <<<<<<<<<<<<<<
 * 			if props.isArray:
 * 				size = 4 * len(value)
 */
  __pyx_t_5 = __Pyx_PyInt_From_brlapi_param_type_t(__pyx_v_props->type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_PARAM_TYPE_UINT64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (likely(__pyx_t_4)) {

    /* "brlapi.pyx":1030
 * 				values32[0] = value
 * 		elif props.type == PARAM_TYPE_UINT64:
 * 			if props.isArray:             # <<<<<<<<<<<<<<
 * 				size = 4 * len(value)
 * 				c_value = <void*>c_brlapi.malloc(size)
 */
    __pyx_t_4 = (__pyx_v_props->isArray != 0);
    if (__pyx_t_4) {

      /* "brlapi.pyx":1031
 * 		elif props.type == PARAM_TYPE_UINT64:
 * 			if props.isArray:
 * 				size = 4 * len(value)             # <<<<<<<<<<<<<<
 * 				c_value = <void*>c_brlapi.malloc(size)
 * 				values64 = <uint64_t *>c_value
 */
      __pyx_t_9 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1031, __pyx_L1_error)
      __pyx_v_size = (4 * __pyx_t_9);

      /* "brlapi.pyx":1032
 * 			if props.isArray:
 * 				size = 4 * len(value)
 * 				c_value = <void*>c_brlapi.malloc(size)             # <<<<<<<<<<<<<<
 * 				values64 = <uint64_t *>c_value
 * 				for i in len(value):
 */
      __pyx_v_c_value = ((void *)malloc(__pyx_v_size));

      /* "brlapi.pyx":1033
 * 				size = 4 * len(value)
 * 				c_value = <void*>c_brlapi.malloc(size)
 * 				values64 = <uint64_t *>c_value             # <<<<<<<<<<<<<<
 * 				for i in len(value):
 * 					values64[i] = value[i]
 */
      __pyx_v_values64 = ((uint64_t *)__pyx_v_c_value);

      /* "brlapi.pyx":1034
 * 				c_value = <void*>c_brlapi.malloc(size)
 * 				values64 = <uint64_t *>c_value
 * 				for i in len(value):             # <<<<<<<<<<<<<<
 * 					values64[i] = value[i]
 * 			else:
 */
      __pyx_t_9 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1034, __pyx_L1_error)
      __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1034, __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_9 = 0;
        __pyx_t_11 = NULL;
      } else {
        __pyx_t_9 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1034, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_11 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1034, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      for (;;) {
        if (likely(!__pyx_t_11)) {
          if (likely(PyList_CheckExact(__pyx_t_7))) {
            if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_7)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1034, __pyx_L1_error)
            #else
            __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1034, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          } else {
            if (__pyx_t_9 >= 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_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1034, __pyx_L1_error)
            #else
            __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1034, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          }
        } else {
          __pyx_t_6 = __pyx_t_11(__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, 1034, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_6);
        }
        __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6);
        __pyx_t_6 = 0;

        /* "brlapi.pyx":1035
 * 				values64 = <uint64_t *>c_value
 * 				for i in len(value):
 * 					values64[i] = value[i]             # <<<<<<<<<<<<<<
 * 			else:
 * 				size = 8
 */
        __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_value, __pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1035, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_16 = __Pyx_PyInt_As_uint64_t(__pyx_t_6); if (unlikely((__pyx_t_16 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1035, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1035, __pyx_L1_error)
        (__pyx_v_values64[__pyx_t_13]) = __pyx_t_16;

        /* "brlapi.pyx":1034
 * 				c_value = <void*>c_brlapi.malloc(size)
 * 				values64 = <uint64_t *>c_value
 * 				for i in len(value):             # <<<<<<<<<<<<<<
 * 					values64[i] = value[i]
 * 			else:
 */
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "brlapi.pyx":1030
 * 				values32[0] = value
 * 		elif props.type == PARAM_TYPE_UINT64:
 * 			if props.isArray:             # <<<<<<<<<<<<<<
 * 				size = 4 * len(value)
 * 				c_value = <void*>c_brlapi.malloc(size)
 */
      goto __pyx_L35;
    }

    /* "brlapi.pyx":1037
 * 					values64[i] = value[i]
 * 			else:
 * 				size = 8             # <<<<<<<<<<<<<<
 * 				c_value = <void*>c_brlapi.malloc(size)
 * 				values64 = <uint64_t *>c_value
 */
    /*else*/ {
      __pyx_v_size = 8;

      /* "brlapi.pyx":1038
 * 			else:
 * 				size = 8
 * 				c_value = <void*>c_brlapi.malloc(size)             # <<<<<<<<<<<<<<
 * 				values64 = <uint64_t *>c_value
 * 				values64[0] = value
 */
      __pyx_v_c_value = ((void *)malloc(__pyx_v_size));

      /* "brlapi.pyx":1039
 * 				size = 8
 * 				c_value = <void*>c_brlapi.malloc(size)
 * 				values64 = <uint64_t *>c_value             # <<<<<<<<<<<<<<
 * 				values64[0] = value
 * 		else:
 */
      __pyx_v_values64 = ((uint64_t *)__pyx_v_c_value);

      /* "brlapi.pyx":1040
 * 				c_value = <void*>c_brlapi.malloc(size)
 * 				values64 = <uint64_t *>c_value
 * 				values64[0] = value             # <<<<<<<<<<<<<<
 * 		else:
 * 			raise ValueError("Unsupported parameter type")
 */
      __pyx_t_16 = __Pyx_PyInt_As_uint64_t(__pyx_v_value); if (unlikely((__pyx_t_16 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1040, __pyx_L1_error)
      (__pyx_v_values64[0]) = __pyx_t_16;
    }
    __pyx_L35:;

    /* "brlapi.pyx":1029
 * 				values32 = <uint32_t *>c_value
 * 				values32[0] = value
 * 		elif props.type == PARAM_TYPE_UINT64:             # <<<<<<<<<<<<<<
 * 			if props.isArray:
 * 				size = 4 * len(value)
 */
    goto __pyx_L22;
  }

  /* "brlapi.pyx":1042
 * 				values64[0] = value
 * 		else:
 * 			raise ValueError("Unsupported parameter type")             # <<<<<<<<<<<<<<
 * 
 * 		with nogil:
 */
  /*else*/ {
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1042, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(0, 1042, __pyx_L1_error)
  }
  __pyx_L22:;

  /* "brlapi.pyx":1044
 * 			raise ValueError("Unsupported parameter type")
 * 
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__setParameter(self.h, c_param, c_subparam, c_flags, c_value, size)
 * 		if retval == -1:
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "brlapi.pyx":1045
 * 
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__setParameter(self.h, c_param, c_subparam, c_flags, c_value, size)             # <<<<<<<<<<<<<<
 * 		if retval == -1:
 * 			c_brlapi.free(c_value)
 */
        __pyx_v_retval = brlapi__setParameter(__pyx_v_self->h, __pyx_v_c_param, __pyx_v_c_subparam, __pyx_v_c_flags, __pyx_v_c_value, __pyx_v_size);
      }

      /* "brlapi.pyx":1044
 * 			raise ValueError("Unsupported parameter type")
 * 
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__setParameter(self.h, c_param, c_subparam, c_flags, c_value, size)
 * 		if retval == -1:
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L40;
        }
        __pyx_L40:;
      }
  }

  /* "brlapi.pyx":1046
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__setParameter(self.h, c_param, c_subparam, c_flags, c_value, size)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			c_brlapi.free(c_value)
 * 			raise OperationError()
 */
  __pyx_t_4 = ((__pyx_v_retval == -1L) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "brlapi.pyx":1047
 * 			retval = c_brlapi.brlapi__setParameter(self.h, c_param, c_subparam, c_flags, c_value, size)
 * 		if retval == -1:
 * 			c_brlapi.free(c_value)             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 * 		c_brlapi.free(c_value)
 */
    free(__pyx_v_c_value);

    /* "brlapi.pyx":1048
 * 		if retval == -1:
 * 			c_brlapi.free(c_value)
 * 			raise OperationError()             # <<<<<<<<<<<<<<
 * 		c_brlapi.free(c_value)
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_OperationError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1048, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_7 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1048, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(0, 1048, __pyx_L1_error)

    /* "brlapi.pyx":1046
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__setParameter(self.h, c_param, c_subparam, c_flags, c_value, size)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			c_brlapi.free(c_value)
 * 			raise OperationError()
 */
  }

  /* "brlapi.pyx":1049
 * 			c_brlapi.free(c_value)
 * 			raise OperationError()
 * 		c_brlapi.free(c_value)             # <<<<<<<<<<<<<<
 * 
 * 	def watchParameter(self, param, subparam, flags, func):
 */
  free(__pyx_v_c_value);

  /* "brlapi.pyx":937
 * 
 * 
 * 	def setParameter(self, param, subparam, flags, value):             # <<<<<<<<<<<<<<
 * 		"""Set the value of a parameter.
 * 		See brlapi_setParameter(3).
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("brlapi.Connection.setParameter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":1051
 * 		c_brlapi.free(c_value)
 * 
 * 	def watchParameter(self, param, subparam, flags, func):             # <<<<<<<<<<<<<<
 * 		"""Set a parameter change callback.
 * 		See brlapi_watchParameter(3).
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_47watchParameter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6brlapi_10Connection_46watchParameter[] = "Connection.watchParameter(self, param, subparam, flags, func)\nSet a parameter change callback.\n\t\tSee brlapi_watchParameter(3).\n\n\t\tThis registers a parameter change callback: whenever the given\n\t\tparameter changes, the given function is called.\n\n\t\tThis returns an entry object, to be passed to unwatchParameter.";
static PyObject *__pyx_pw_6brlapi_10Connection_47watchParameter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_param = 0;
  PyObject *__pyx_v_subparam = 0;
  PyObject *__pyx_v_flags = 0;
  PyObject *__pyx_v_func = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("watchParameter (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_param,&__pyx_n_s_subparam,&__pyx_n_s_flags,&__pyx_n_s_func,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_param)) != 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_subparam)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("watchParameter", 1, 4, 4, 1); __PYX_ERR(0, 1051, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("watchParameter", 1, 4, 4, 2); __PYX_ERR(0, 1051, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("watchParameter", 1, 4, 4, 3); __PYX_ERR(0, 1051, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "watchParameter") < 0)) __PYX_ERR(0, 1051, __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_param = values[0];
    __pyx_v_subparam = values[1];
    __pyx_v_flags = values[2];
    __pyx_v_func = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("watchParameter", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1051, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("brlapi.Connection.watchParameter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6brlapi_10Connection_46watchParameter(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self), __pyx_v_param, __pyx_v_subparam, __pyx_v_flags, __pyx_v_func);

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

/* "brlapi.pyx":1068
 * 		c_flags = flags
 * 
 * 		def cfunc(param):             # <<<<<<<<<<<<<<
 * 			cdef c_brlapi.brlapi_python_callbackData_t *callbackData
 * 			callbackData = <c_brlapi.brlapi_python_callbackData_t*> <uintptr_t> param
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_14watchParameter_1cfunc(PyObject *__pyx_self, PyObject *__pyx_v_param); /*proto*/
static PyMethodDef __pyx_mdef_6brlapi_10Connection_14watchParameter_1cfunc = {"cfunc", (PyCFunction)__pyx_pw_6brlapi_10Connection_14watchParameter_1cfunc, METH_O, 0};
static PyObject *__pyx_pw_6brlapi_10Connection_14watchParameter_1cfunc(PyObject *__pyx_self, PyObject *__pyx_v_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cfunc (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_10Connection_14watchParameter_cfunc(__pyx_self, ((PyObject *)__pyx_v_param));

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

static PyObject *__pyx_pf_6brlapi_10Connection_14watchParameter_cfunc(PyObject *__pyx_self, PyObject *__pyx_v_param) {
  struct __pyx_obj_6brlapi___pyx_scope_struct__watchParameter *__pyx_cur_scope;
  struct __pyx_obj_6brlapi___pyx_scope_struct__watchParameter *__pyx_outer_scope;
  brlapi_python_callbackData_t *__pyx_v_callbackData;
  brlapi_param_t __pyx_v_parameter;
  brlapi_param_subparam_t __pyx_v_subparam;
  brlapi_param_flags_t __pyx_v_flags;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  uintptr_t __pyx_t_1;
  brlapi_param_t __pyx_t_2;
  brlapi_param_subparam_t __pyx_t_3;
  brlapi_param_flags_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cfunc", 0);
  __pyx_outer_scope = (struct __pyx_obj_6brlapi___pyx_scope_struct__watchParameter *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "brlapi.pyx":1070
 * 		def cfunc(param):
 * 			cdef c_brlapi.brlapi_python_callbackData_t *callbackData
 * 			callbackData = <c_brlapi.brlapi_python_callbackData_t*> <uintptr_t> param             # <<<<<<<<<<<<<<
 * 
 * 			parameter = callbackData.parameter
 */
  __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_param); if (unlikely((__pyx_t_1 == ((uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1070, __pyx_L1_error)
  __pyx_v_callbackData = ((brlapi_python_callbackData_t *)((uintptr_t)__pyx_t_1));

  /* "brlapi.pyx":1072
 * 			callbackData = <c_brlapi.brlapi_python_callbackData_t*> <uintptr_t> param
 * 
 * 			parameter = callbackData.parameter             # <<<<<<<<<<<<<<
 * 			subparam = callbackData.subparam
 * 			flags = callbackData.flags
 */
  __pyx_t_2 = __pyx_v_callbackData->parameter;
  __pyx_v_parameter = __pyx_t_2;

  /* "brlapi.pyx":1073
 * 
 * 			parameter = callbackData.parameter
 * 			subparam = callbackData.subparam             # <<<<<<<<<<<<<<
 * 			flags = callbackData.flags
 * 			data = _parameterToPython(callbackData.parameter, callbackData.data, callbackData.len)
 */
  __pyx_t_3 = __pyx_v_callbackData->subparam;
  __pyx_v_subparam = __pyx_t_3;

  /* "brlapi.pyx":1074
 * 			parameter = callbackData.parameter
 * 			subparam = callbackData.subparam
 * 			flags = callbackData.flags             # <<<<<<<<<<<<<<
 * 			data = _parameterToPython(callbackData.parameter, callbackData.data, callbackData.len)
 * 
 */
  __pyx_t_4 = __pyx_v_callbackData->flags;
  __pyx_v_flags = __pyx_t_4;

  /* "brlapi.pyx":1075
 * 			subparam = callbackData.subparam
 * 			flags = callbackData.flags
 * 			data = _parameterToPython(callbackData.parameter, callbackData.data, callbackData.len)             # <<<<<<<<<<<<<<
 * 
 * 			func(parameter, subparam, flags, data)
 */
  __pyx_t_5 = __pyx_f_6brlapi__parameterToPython(__pyx_v_callbackData->parameter, __pyx_v_callbackData->data, __pyx_v_callbackData->len); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1075, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_data = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "brlapi.pyx":1077
 * 			data = _parameterToPython(callbackData.parameter, callbackData.data, callbackData.len)
 * 
 * 			func(parameter, subparam, flags, data)             # <<<<<<<<<<<<<<
 * 
 * 		descr = c_brlapi.brlapi_python_watchParameter(self.h, c_param, c_subparam, c_flags, cfunc)
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); __PYX_ERR(0, 1077, __pyx_L1_error) }
  __pyx_t_6 = __Pyx_PyInt_From_brlapi_param_t(__pyx_v_parameter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyInt_From_uint64_t(__pyx_v_subparam); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyInt_From_uint32_t(__pyx_v_flags); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  __pyx_t_9 = __pyx_cur_scope->__pyx_v_func; __pyx_t_10 = NULL;
  __pyx_t_11 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
      __pyx_t_11 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_9)) {
    PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_v_data};
    __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_11, 4+__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1077, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
    PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_v_data};
    __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_11, 4+__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1077, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else
  #endif
  {
    __pyx_t_12 = PyTuple_New(4+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1077, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    if (__pyx_t_10) {
      __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_11, __pyx_t_8);
    __Pyx_INCREF(__pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    PyTuple_SET_ITEM(__pyx_t_12, 3+__pyx_t_11, __pyx_v_data);
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_t_8 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1077, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "brlapi.pyx":1068
 * 		c_flags = flags
 * 
 * 		def cfunc(param):             # <<<<<<<<<<<<<<
 * 			cdef c_brlapi.brlapi_python_callbackData_t *callbackData
 * 			callbackData = <c_brlapi.brlapi_python_callbackData_t*> <uintptr_t> param
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("brlapi.Connection.watchParameter.cfunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":1051
 * 		c_brlapi.free(c_value)
 * 
 * 	def watchParameter(self, param, subparam, flags, func):             # <<<<<<<<<<<<<<
 * 		"""Set a parameter change callback.
 * 		See brlapi_watchParameter(3).
 */

static PyObject *__pyx_pf_6brlapi_10Connection_46watchParameter(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_param, PyObject *__pyx_v_subparam, PyObject *__pyx_v_flags, PyObject *__pyx_v_func) {
  struct __pyx_obj_6brlapi___pyx_scope_struct__watchParameter *__pyx_cur_scope;
  brlapi_param_t __pyx_v_c_param;
  brlapi_param_subparam_t __pyx_v_c_subparam;
  brlapi_param_flags_t __pyx_v_c_flags;
  brlapi_python_paramCallbackDescriptor_t *__pyx_v_descr;
  PyObject *__pyx_v_cfunc = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  brlapi_param_t __pyx_t_1;
  brlapi_param_subparam_t __pyx_t_2;
  brlapi_param_flags_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  brlapi_python_paramCallbackDescriptor_t *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("watchParameter", 0);
  __pyx_cur_scope = (struct __pyx_obj_6brlapi___pyx_scope_struct__watchParameter *)__pyx_tp_new_6brlapi___pyx_scope_struct__watchParameter(__pyx_ptype_6brlapi___pyx_scope_struct__watchParameter, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6brlapi___pyx_scope_struct__watchParameter *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1051, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_func = __pyx_v_func;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);

  /* "brlapi.pyx":1064
 * 		cdef c_brlapi.brlapi_python_paramCallbackDescriptor_t *descr
 * 
 * 		c_param = param             # <<<<<<<<<<<<<<
 * 		c_subparam = subparam
 * 		c_flags = flags
 */
  __pyx_t_1 = __Pyx_PyInt_As_brlapi_param_t(__pyx_v_param); if (unlikely((__pyx_t_1 == ((brlapi_param_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1064, __pyx_L1_error)
  __pyx_v_c_param = __pyx_t_1;

  /* "brlapi.pyx":1065
 * 
 * 		c_param = param
 * 		c_subparam = subparam             # <<<<<<<<<<<<<<
 * 		c_flags = flags
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_v_subparam); if (unlikely((__pyx_t_2 == ((brlapi_param_subparam_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1065, __pyx_L1_error)
  __pyx_v_c_subparam = __pyx_t_2;

  /* "brlapi.pyx":1066
 * 		c_param = param
 * 		c_subparam = subparam
 * 		c_flags = flags             # <<<<<<<<<<<<<<
 * 
 * 		def cfunc(param):
 */
  __pyx_t_3 = __Pyx_PyInt_As_uint32_t(__pyx_v_flags); if (unlikely((__pyx_t_3 == ((brlapi_param_flags_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1066, __pyx_L1_error)
  __pyx_v_c_flags = __pyx_t_3;

  /* "brlapi.pyx":1068
 * 		c_flags = flags
 * 
 * 		def cfunc(param):             # <<<<<<<<<<<<<<
 * 			cdef c_brlapi.brlapi_python_callbackData_t *callbackData
 * 			callbackData = <c_brlapi.brlapi_python_callbackData_t*> <uintptr_t> param
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6brlapi_10Connection_14watchParameter_1cfunc, 0, __pyx_n_s_watchParameter_locals_cfunc, ((PyObject*)__pyx_cur_scope), __pyx_n_s_brlapi, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1068, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_cfunc = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "brlapi.pyx":1079
 * 			func(parameter, subparam, flags, data)
 * 
 * 		descr = c_brlapi.brlapi_python_watchParameter(self.h, c_param, c_subparam, c_flags, cfunc)             # <<<<<<<<<<<<<<
 * 		return <uintptr_t>descr
 * 
 */
  __pyx_t_5 = brlapi_python_watchParameter(__pyx_v_self->h, __pyx_v_c_param, __pyx_v_c_subparam, __pyx_v_c_flags, __pyx_v_cfunc); if (unlikely(__pyx_t_5 == ((brlapi_python_paramCallbackDescriptor_t *)NULL))) __PYX_ERR(0, 1079, __pyx_L1_error)
  __pyx_v_descr = __pyx_t_5;

  /* "brlapi.pyx":1080
 * 
 * 		descr = c_brlapi.brlapi_python_watchParameter(self.h, c_param, c_subparam, c_flags, cfunc)
 * 		return <uintptr_t>descr             # <<<<<<<<<<<<<<
 * 
 * 	def unwatchParameter(self, entry):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyInt_FromSize_t(((uintptr_t)__pyx_v_descr)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1080, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "brlapi.pyx":1051
 * 		c_brlapi.free(c_value)
 * 
 * 	def watchParameter(self, param, subparam, flags, func):             # <<<<<<<<<<<<<<
 * 		"""Set a parameter change callback.
 * 		See brlapi_watchParameter(3).
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("brlapi.Connection.watchParameter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cfunc);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "brlapi.pyx":1082
 * 		return <uintptr_t>descr
 * 
 * 	def unwatchParameter(self, entry):             # <<<<<<<<<<<<<<
 * 		"""Clear a parameter change callback.
 * 		See brlapi_unwatchParameter(3).
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_49unwatchParameter(PyObject *__pyx_v_self, PyObject *__pyx_v_entry); /*proto*/
static char __pyx_doc_6brlapi_10Connection_48unwatchParameter[] = "Connection.unwatchParameter(self, entry)\nClear a parameter change callback.\n\t\tSee brlapi_unwatchParameter(3).\n\n\t\tThis unregisters a parameter change callback: the callback\n\t\tfunction previously registered with brlapi_watchParameter\n\t\twill not be called any more.";
static PyObject *__pyx_pw_6brlapi_10Connection_49unwatchParameter(PyObject *__pyx_v_self, PyObject *__pyx_v_entry) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("unwatchParameter (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_10Connection_48unwatchParameter(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self), ((PyObject *)__pyx_v_entry));

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

static PyObject *__pyx_pf_6brlapi_10Connection_48unwatchParameter(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_entry) {
  uintptr_t __pyx_v_descr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  uintptr_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("unwatchParameter", 0);

  /* "brlapi.pyx":1091
 * 		cdef uintptr_t descr
 * 
 * 		descr = entry             # <<<<<<<<<<<<<<
 * 		c_brlapi.brlapi_python_unwatchParameter(self.h, <c_brlapi.brlapi_python_paramCallbackDescriptor_t *>descr)
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_entry); if (unlikely((__pyx_t_1 == ((uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1091, __pyx_L1_error)
  __pyx_v_descr = __pyx_t_1;

  /* "brlapi.pyx":1092
 * 
 * 		descr = entry
 * 		c_brlapi.brlapi_python_unwatchParameter(self.h, <c_brlapi.brlapi_python_paramCallbackDescriptor_t *>descr)             # <<<<<<<<<<<<<<
 * 
 * 	def pause(self, timeout_ms):
 */
  (void)(brlapi_python_unwatchParameter(__pyx_v_self->h, ((brlapi_python_paramCallbackDescriptor_t *)__pyx_v_descr)));

  /* "brlapi.pyx":1082
 * 		return <uintptr_t>descr
 * 
 * 	def unwatchParameter(self, entry):             # <<<<<<<<<<<<<<
 * 		"""Clear a parameter change callback.
 * 		See brlapi_unwatchParameter(3).
 */

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

/* "brlapi.pyx":1094
 * 		c_brlapi.brlapi_python_unwatchParameter(self.h, <c_brlapi.brlapi_python_paramCallbackDescriptor_t *>descr)
 * 
 * 	def pause(self, timeout_ms):             # <<<<<<<<<<<<<<
 * 		"""Wait until an event is received from the BrlAPI server.
 * 		See brlapi_pause(3).
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_51pause(PyObject *__pyx_v_self, PyObject *__pyx_v_timeout_ms); /*proto*/
static char __pyx_doc_6brlapi_10Connection_50pause[] = "Connection.pause(self, timeout_ms)\nWait until an event is received from the BrlAPI server.\n\t\tSee brlapi_pause(3).\n\t\t";
static PyObject *__pyx_pw_6brlapi_10Connection_51pause(PyObject *__pyx_v_self, PyObject *__pyx_v_timeout_ms) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pause (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_10Connection_50pause(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self), ((PyObject *)__pyx_v_timeout_ms));

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

static PyObject *__pyx_pf_6brlapi_10Connection_50pause(struct __pyx_obj_6brlapi_Connection *__pyx_v_self, PyObject *__pyx_v_timeout_ms) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pause", 0);

  /* "brlapi.pyx":1098
 * 		See brlapi_pause(3).
 * 		"""
 * 		c_brlapi.brlapi__pause(self.h, timeout_ms)             # <<<<<<<<<<<<<<
 * 
 * 	def sync(self):
 */
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_timeout_ms); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1098, __pyx_L1_error)
  (void)(brlapi__pause(__pyx_v_self->h, __pyx_t_1));

  /* "brlapi.pyx":1094
 * 		c_brlapi.brlapi_python_unwatchParameter(self.h, <c_brlapi.brlapi_python_paramCallbackDescriptor_t *>descr)
 * 
 * 	def pause(self, timeout_ms):             # <<<<<<<<<<<<<<
 * 		"""Wait until an event is received from the BrlAPI server.
 * 		See brlapi_pause(3).
 */

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

/* "brlapi.pyx":1100
 * 		c_brlapi.brlapi__pause(self.h, timeout_ms)
 * 
 * 	def sync(self):             # <<<<<<<<<<<<<<
 * 		"""Synchronize against any pending exception, and raise it.
 * 		See brlapi_sync(3).
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_53sync(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6brlapi_10Connection_52sync[] = "Connection.sync(self)\nSynchronize against any pending exception, and raise it.\n\t\tSee brlapi_sync(3).\n\t\t";
static PyObject *__pyx_pw_6brlapi_10Connection_53sync(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sync (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_10Connection_52sync(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self));

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

static PyObject *__pyx_pf_6brlapi_10Connection_52sync(struct __pyx_obj_6brlapi_Connection *__pyx_v_self) {
  int __pyx_v_retval;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sync", 0);

  /* "brlapi.pyx":1106
 * 		cdef int retval
 * 
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__sync(self.h)
 * 		if retval == -1:
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "brlapi.pyx":1107
 * 
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__sync(self.h)             # <<<<<<<<<<<<<<
 * 		if retval == -1:
 * 			raise OperationError()
 */
        __pyx_v_retval = brlapi__sync(__pyx_v_self->h);
      }

      /* "brlapi.pyx":1106
 * 		cdef int retval
 * 
 * 		with nogil:             # <<<<<<<<<<<<<<
 * 			retval = c_brlapi.brlapi__sync(self.h)
 * 		if retval == -1:
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "brlapi.pyx":1108
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__sync(self.h)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 */
  __pyx_t_1 = ((__pyx_v_retval == -1L) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "brlapi.pyx":1109
 * 			retval = c_brlapi.brlapi__sync(self.h)
 * 		if retval == -1:
 * 			raise OperationError()             # <<<<<<<<<<<<<<
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_OperationError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_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, 1109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1109, __pyx_L1_error)

    /* "brlapi.pyx":1108
 * 		with nogil:
 * 			retval = c_brlapi.brlapi__sync(self.h)
 * 		if retval == -1:             # <<<<<<<<<<<<<<
 * 			raise OperationError()
 */
  }

  /* "brlapi.pyx":1100
 * 		c_brlapi.brlapi__pause(self.h, timeout_ms)
 * 
 * 	def sync(self):             # <<<<<<<<<<<<<<
 * 		"""Synchronize against any pending exception, and raise it.
 * 		See brlapi_sync(3).
 */

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

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.h cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_55__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6brlapi_10Connection_54__reduce_cython__[] = "Connection.__reduce_cython__(self)";
static PyObject *__pyx_pw_6brlapi_10Connection_55__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_10Connection_54__reduce_cython__(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self));

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

static PyObject *__pyx_pf_6brlapi_10Connection_54__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6brlapi_Connection *__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("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.h cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.h cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.h cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.h cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.h cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_6brlapi_10Connection_57__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_6brlapi_10Connection_56__setstate_cython__[] = "Connection.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_6brlapi_10Connection_57__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6brlapi_10Connection_56__setstate_cython__(((struct __pyx_obj_6brlapi_Connection *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("self.h cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.h cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.h cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.h cannot be converted to a Python object for pickling")
 */

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

static PyObject *__pyx_tp_new_6brlapi_WriteStruct(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  return o;
}

static void __pyx_tp_dealloc_6brlapi_WriteStruct(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_6brlapi_11WriteStruct_displayNumber(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6brlapi_11WriteStruct_13displayNumber_1__get__(o);
}

static int __pyx_setprop_6brlapi_11WriteStruct_displayNumber(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6brlapi_11WriteStruct_13displayNumber_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6brlapi_11WriteStruct_regionBegin(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6brlapi_11WriteStruct_11regionBegin_1__get__(o);
}

static int __pyx_setprop_6brlapi_11WriteStruct_regionBegin(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6brlapi_11WriteStruct_11regionBegin_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6brlapi_11WriteStruct_regionSize(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6brlapi_11WriteStruct_10regionSize_1__get__(o);
}

static int __pyx_setprop_6brlapi_11WriteStruct_regionSize(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6brlapi_11WriteStruct_10regionSize_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6brlapi_11WriteStruct_text(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6brlapi_11WriteStruct_4text_1__get__(o);
}

static int __pyx_setprop_6brlapi_11WriteStruct_text(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6brlapi_11WriteStruct_4text_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6brlapi_11WriteStruct_cursor(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6brlapi_11WriteStruct_6cursor_1__get__(o);
}

static int __pyx_setprop_6brlapi_11WriteStruct_cursor(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6brlapi_11WriteStruct_6cursor_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6brlapi_11WriteStruct_charset(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6brlapi_11WriteStruct_7charset_1__get__(o);
}

static int __pyx_setprop_6brlapi_11WriteStruct_charset(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6brlapi_11WriteStruct_7charset_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6brlapi_11WriteStruct_attrAnd(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6brlapi_11WriteStruct_7attrAnd_1__get__(o);
}

static int __pyx_setprop_6brlapi_11WriteStruct_attrAnd(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6brlapi_11WriteStruct_7attrAnd_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6brlapi_11WriteStruct_attrOr(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6brlapi_11WriteStruct_6attrOr_1__get__(o);
}

static int __pyx_setprop_6brlapi_11WriteStruct_attrOr(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6brlapi_11WriteStruct_6attrOr_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_6brlapi_WriteStruct[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_6brlapi_11WriteStruct_3__reduce_cython__, METH_NOARGS, __pyx_doc_6brlapi_11WriteStruct_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_6brlapi_11WriteStruct_5__setstate_cython__, METH_O, __pyx_doc_6brlapi_11WriteStruct_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6brlapi_WriteStruct[] = {
  {(char *)"displayNumber", __pyx_getprop_6brlapi_11WriteStruct_displayNumber, __pyx_setprop_6brlapi_11WriteStruct_displayNumber, (char *)"Display number DISPLAY_DEFAULT == unspecified", 0},
  {(char *)"regionBegin", __pyx_getprop_6brlapi_11WriteStruct_regionBegin, __pyx_setprop_6brlapi_11WriteStruct_regionBegin, (char *)"Region of display to update, 1st character of display is 1", 0},
  {(char *)"regionSize", __pyx_getprop_6brlapi_11WriteStruct_regionSize, __pyx_setprop_6brlapi_11WriteStruct_regionSize, (char *)"Number of characters held in text, attrAnd and attrOr. For multibytes text, this is the number of multibyte characters. Combining and double-width characters count for 1", 0},
  {(char *)"text", __pyx_getprop_6brlapi_11WriteStruct_text, __pyx_setprop_6brlapi_11WriteStruct_text, (char *)"Text to display", 0},
  {(char *)"cursor", __pyx_getprop_6brlapi_11WriteStruct_cursor, __pyx_setprop_6brlapi_11WriteStruct_cursor, (char *)"CURSOR_LEAVE == don't touch, CURSOR_OFF == turn off, 1 = 1st char of display, ...", 0},
  {(char *)"charset", __pyx_getprop_6brlapi_11WriteStruct_charset, __pyx_setprop_6brlapi_11WriteStruct_charset, (char *)"Character set of the text", 0},
  {(char *)"attrAnd", __pyx_getprop_6brlapi_11WriteStruct_attrAnd, __pyx_setprop_6brlapi_11WriteStruct_attrAnd, (char *)"And attributes; applied first", 0},
  {(char *)"attrOr", __pyx_getprop_6brlapi_11WriteStruct_attrOr, __pyx_setprop_6brlapi_11WriteStruct_attrOr, (char *)"Or attributes; applied after ANDing", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6brlapi_WriteStruct = {
  PyVarObject_HEAD_INIT(0, 0)
  "brlapi.WriteStruct", /*tp_name*/
  sizeof(struct __pyx_obj_6brlapi_WriteStruct), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6brlapi_WriteStruct, /*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_BASETYPE, /*tp_flags*/
  "WriteStruct()\nStructure containing arguments to be given to Connection.write()\n\tSee brlapi_writeArguments_t(3).\n\t\n\tThis is DEPRECATED. Use the named parameters of write() instead.", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6brlapi_WriteStruct, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6brlapi_WriteStruct, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6brlapi_11WriteStruct_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6brlapi_WriteStruct, /*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 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};

static PyObject *__pyx_tp_new_6brlapi_Connection(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  return o;
}

static void __pyx_tp_dealloc_6brlapi_Connection(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_6brlapi_10Connection_host(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6brlapi_10Connection_4host_1__get__(o);
}

static PyObject *__pyx_getprop_6brlapi_10Connection_auth(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6brlapi_10Connection_4auth_1__get__(o);
}

static PyObject *__pyx_getprop_6brlapi_10Connection_fileDescriptor(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6brlapi_10Connection_14fileDescriptor_1__get__(o);
}

static PyObject *__pyx_getprop_6brlapi_10Connection_displaySize(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6brlapi_10Connection_11displaySize_1__get__(o);
}

static PyObject *__pyx_getprop_6brlapi_10Connection_driverName(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6brlapi_10Connection_10driverName_1__get__(o);
}

static PyObject *__pyx_getprop_6brlapi_10Connection_modelIdentifier(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6brlapi_10Connection_15modelIdentifier_1__get__(o);
}

static PyMethodDef __pyx_methods_6brlapi_Connection[] = {
  {"closeConnection", (PyCFunction)__pyx_pw_6brlapi_10Connection_3closeConnection, METH_NOARGS, __pyx_doc_6brlapi_10Connection_2closeConnection},
  {"__del__", (PyCFunction)__pyx_pw_6brlapi_10Connection_5__del__, METH_NOARGS, __pyx_doc_6brlapi_10Connection_4__del__},
  {"enterTtyMode", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6brlapi_10Connection_7enterTtyMode, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6brlapi_10Connection_6enterTtyMode},
  {"enterTtyModeWithPath", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6brlapi_10Connection_9enterTtyModeWithPath, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6brlapi_10Connection_8enterTtyModeWithPath},
  {"leaveTtyMode", (PyCFunction)__pyx_pw_6brlapi_10Connection_11leaveTtyMode, METH_NOARGS, __pyx_doc_6brlapi_10Connection_10leaveTtyMode},
  {"setFocus", (PyCFunction)__pyx_pw_6brlapi_10Connection_13setFocus, METH_O, __pyx_doc_6brlapi_10Connection_12setFocus},
  {"write", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6brlapi_10Connection_15write, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6brlapi_10Connection_14write},
  {"writeDots", (PyCFunction)__pyx_pw_6brlapi_10Connection_17writeDots, METH_O, __pyx_doc_6brlapi_10Connection_16writeDots},
  {"writeText", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6brlapi_10Connection_19writeText, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6brlapi_10Connection_18writeText},
  {"readKey", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6brlapi_10Connection_21readKey, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6brlapi_10Connection_20readKey},
  {"readKeyWithTimeout", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6brlapi_10Connection_23readKeyWithTimeout, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6brlapi_10Connection_22readKeyWithTimeout},
  {"expandKeyCode", (PyCFunction)__pyx_pw_6brlapi_10Connection_25expandKeyCode, METH_O, __pyx_doc_6brlapi_10Connection_24expandKeyCode},
  {"ignoreKeys", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6brlapi_10Connection_27ignoreKeys, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6brlapi_10Connection_26ignoreKeys},
  {"acceptKeys", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6brlapi_10Connection_29acceptKeys, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6brlapi_10Connection_28acceptKeys},
  {"ignoreAllKeys", (PyCFunction)__pyx_pw_6brlapi_10Connection_31ignoreAllKeys, METH_NOARGS, __pyx_doc_6brlapi_10Connection_30ignoreAllKeys},
  {"acceptAllKeys", (PyCFunction)__pyx_pw_6brlapi_10Connection_33acceptAllKeys, METH_NOARGS, __pyx_doc_6brlapi_10Connection_32acceptAllKeys},
  {"ignoreKeyRanges", (PyCFunction)__pyx_pw_6brlapi_10Connection_35ignoreKeyRanges, METH_O, __pyx_doc_6brlapi_10Connection_34ignoreKeyRanges},
  {"acceptKeyRanges", (PyCFunction)__pyx_pw_6brlapi_10Connection_37acceptKeyRanges, METH_O, __pyx_doc_6brlapi_10Connection_36acceptKeyRanges},
  {"enterRawMode", (PyCFunction)__pyx_pw_6brlapi_10Connection_39enterRawMode, METH_O, __pyx_doc_6brlapi_10Connection_38enterRawMode},
  {"leaveRawMode", (PyCFunction)__pyx_pw_6brlapi_10Connection_41leaveRawMode, METH_NOARGS, __pyx_doc_6brlapi_10Connection_40leaveRawMode},
  {"getParameter", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6brlapi_10Connection_43getParameter, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6brlapi_10Connection_42getParameter},
  {"setParameter", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6brlapi_10Connection_45setParameter, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6brlapi_10Connection_44setParameter},
  {"watchParameter", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6brlapi_10Connection_47watchParameter, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6brlapi_10Connection_46watchParameter},
  {"unwatchParameter", (PyCFunction)__pyx_pw_6brlapi_10Connection_49unwatchParameter, METH_O, __pyx_doc_6brlapi_10Connection_48unwatchParameter},
  {"pause", (PyCFunction)__pyx_pw_6brlapi_10Connection_51pause, METH_O, __pyx_doc_6brlapi_10Connection_50pause},
  {"sync", (PyCFunction)__pyx_pw_6brlapi_10Connection_53sync, METH_NOARGS, __pyx_doc_6brlapi_10Connection_52sync},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_6brlapi_10Connection_55__reduce_cython__, METH_NOARGS, __pyx_doc_6brlapi_10Connection_54__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_6brlapi_10Connection_57__setstate_cython__, METH_O, __pyx_doc_6brlapi_10Connection_56__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6brlapi_Connection[] = {
  {(char *)"host", __pyx_getprop_6brlapi_10Connection_host, 0, (char *)"To get authorized to connect, libbrlapi has to tell the BrlAPI server a secret key, for security reasons. This is the path to the file which holds it; it will hence have to be readable by the application.", 0},
  {(char *)"auth", __pyx_getprop_6brlapi_10Connection_auth, 0, (char *)"This tells where the BrlAPI server resides : it might be listening on another computer, on any TCP port. It should look like \"foo:1\", which means TCP port number BRLAPI_SOCKETPORTNUM+1 on computer called \"foo\".", 0},
  {(char *)"fileDescriptor", __pyx_getprop_6brlapi_10Connection_fileDescriptor, 0, (char *)"Returns the Unix file descriptor that the connection uses", 0},
  {(char *)"displaySize", __pyx_getprop_6brlapi_10Connection_displaySize, 0, (char *)"Get the size of the braille display\n\t\tSee brlapi_getDisplaySize(3).", 0},
  {(char *)"driverName", __pyx_getprop_6brlapi_10Connection_driverName, 0, (char *)"Get the complete name of the driver used by BrlTTY\n\t\tSee brlapi_getDriverName(3).", 0},
  {(char *)"modelIdentifier", __pyx_getprop_6brlapi_10Connection_modelIdentifier, 0, (char *)"Get the identifier for the model of the braille display\n\t\tSee brlapi_getModelIdentifier(3).", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6brlapi_Connection = {
  PyVarObject_HEAD_INIT(0, 0)
  "brlapi.Connection", /*tp_name*/
  sizeof(struct __pyx_obj_6brlapi_Connection), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6brlapi_Connection, /*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_BASETYPE, /*tp_flags*/
  "Connection(host=None, auth=None)\nClass which manages the bridge between your program and BrlAPI", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6brlapi_Connection, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6brlapi_Connection, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6brlapi_10Connection_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6brlapi_Connection, /*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 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};

static struct __pyx_obj_6brlapi___pyx_scope_struct__watchParameter *__pyx_freelist_6brlapi___pyx_scope_struct__watchParameter[8];
static int __pyx_freecount_6brlapi___pyx_scope_struct__watchParameter = 0;

static PyObject *__pyx_tp_new_6brlapi___pyx_scope_struct__watchParameter(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6brlapi___pyx_scope_struct__watchParameter > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6brlapi___pyx_scope_struct__watchParameter)))) {
    o = (PyObject*)__pyx_freelist_6brlapi___pyx_scope_struct__watchParameter[--__pyx_freecount_6brlapi___pyx_scope_struct__watchParameter];
    memset(o, 0, sizeof(struct __pyx_obj_6brlapi___pyx_scope_struct__watchParameter));
    (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_6brlapi___pyx_scope_struct__watchParameter(PyObject *o) {
  struct __pyx_obj_6brlapi___pyx_scope_struct__watchParameter *p = (struct __pyx_obj_6brlapi___pyx_scope_struct__watchParameter *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_func);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6brlapi___pyx_scope_struct__watchParameter < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6brlapi___pyx_scope_struct__watchParameter)))) {
    __pyx_freelist_6brlapi___pyx_scope_struct__watchParameter[__pyx_freecount_6brlapi___pyx_scope_struct__watchParameter++] = ((struct __pyx_obj_6brlapi___pyx_scope_struct__watchParameter *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6brlapi___pyx_scope_struct__watchParameter(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6brlapi___pyx_scope_struct__watchParameter *p = (struct __pyx_obj_6brlapi___pyx_scope_struct__watchParameter *)o;
  if (p->__pyx_v_func) {
    e = (*v)(p->__pyx_v_func, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6brlapi___pyx_scope_struct__watchParameter(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6brlapi___pyx_scope_struct__watchParameter *p = (struct __pyx_obj_6brlapi___pyx_scope_struct__watchParameter *)o;
  tmp = ((PyObject*)p->__pyx_v_func);
  p->__pyx_v_func = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6brlapi___pyx_scope_struct__watchParameter = {
  PyVarObject_HEAD_INIT(0, 0)
  "brlapi.__pyx_scope_struct__watchParameter", /*tp_name*/
  sizeof(struct __pyx_obj_6brlapi___pyx_scope_struct__watchParameter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6brlapi___pyx_scope_struct__watchParameter, /*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_6brlapi___pyx_scope_struct__watchParameter, /*tp_traverse*/
  __pyx_tp_clear_6brlapi___pyx_scope_struct__watchParameter, /*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_6brlapi___pyx_scope_struct__watchParameter, /*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 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #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_brlapi(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_brlapi},
  {0, NULL}
};
#endif

static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    "brlapi",
    __pyx_k_This_module_implements_a_set_of, /* 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_n_u_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 1, 0, 1},
  {&__pyx_kp_u_Authentication_failed_Please_ch, __pyx_k_Authentication_failed_Please_ch, sizeof(__pyx_k_Authentication_failed_Please_ch), 0, 1, 0, 0},
  {&__pyx_kp_u_BRLTTY_is_too_busy, __pyx_k_BRLTTY_is_too_busy, sizeof(__pyx_k_BRLTTY_is_too_busy), 0, 1, 0, 0},
  {&__pyx_kp_u_Boolean_value_expected, __pyx_k_Boolean_value_expected, sizeof(__pyx_k_Boolean_value_expected), 0, 1, 0, 0},
  {&__pyx_kp_u_Boolean_values_expected, __pyx_k_Boolean_values_expected, sizeof(__pyx_k_Boolean_values_expected), 0, 1, 0, 0},
  {&__pyx_n_s_CURSOR_LEAVE, __pyx_k_CURSOR_LEAVE, sizeof(__pyx_k_CURSOR_LEAVE), 0, 0, 1, 1},
  {&__pyx_n_s_CURSOR_OFF, __pyx_k_CURSOR_OFF, sizeof(__pyx_k_CURSOR_OFF), 0, 0, 1, 1},
  {&__pyx_n_s_Connection, __pyx_k_Connection, sizeof(__pyx_k_Connection), 0, 0, 1, 1},
  {&__pyx_n_s_ConnectionError, __pyx_k_ConnectionError, sizeof(__pyx_k_ConnectionError), 0, 0, 1, 1},
  {&__pyx_n_s_ConnectionError___init, __pyx_k_ConnectionError___init, sizeof(__pyx_k_ConnectionError___init), 0, 0, 1, 1},
  {&__pyx_n_s_ConnectionError___str, __pyx_k_ConnectionError___str, sizeof(__pyx_k_ConnectionError___str), 0, 0, 1, 1},
  {&__pyx_n_s_ConnectionError_auth, __pyx_k_ConnectionError_auth, sizeof(__pyx_k_ConnectionError_auth), 0, 0, 1, 1},
  {&__pyx_n_s_ConnectionError_host, __pyx_k_ConnectionError_host, sizeof(__pyx_k_ConnectionError_host), 0, 0, 1, 1},
  {&__pyx_n_s_DISPLAY_DEFAULT, __pyx_k_DISPLAY_DEFAULT, sizeof(__pyx_k_DISPLAY_DEFAULT), 0, 0, 1, 1},
  {&__pyx_n_s_DOT1, __pyx_k_DOT1, sizeof(__pyx_k_DOT1), 0, 0, 1, 1},
  {&__pyx_n_s_DOT2, __pyx_k_DOT2, sizeof(__pyx_k_DOT2), 0, 0, 1, 1},
  {&__pyx_n_s_DOT3, __pyx_k_DOT3, sizeof(__pyx_k_DOT3), 0, 0, 1, 1},
  {&__pyx_n_s_DOT4, __pyx_k_DOT4, sizeof(__pyx_k_DOT4), 0, 0, 1, 1},
  {&__pyx_n_s_DOT5, __pyx_k_DOT5, sizeof(__pyx_k_DOT5), 0, 0, 1, 1},
  {&__pyx_n_s_DOT6, __pyx_k_DOT6, sizeof(__pyx_k_DOT6), 0, 0, 1, 1},
  {&__pyx_n_s_DOT7, __pyx_k_DOT7, sizeof(__pyx_k_DOT7), 0, 0, 1, 1},
  {&__pyx_n_s_DOT8, __pyx_k_DOT8, sizeof(__pyx_k_DOT8), 0, 0, 1, 1},
  {&__pyx_n_s_DOTC, __pyx_k_DOTC, sizeof(__pyx_k_DOTC), 0, 0, 1, 1},
  {&__pyx_n_s_ECONNREFUSED, __pyx_k_ECONNREFUSED, sizeof(__pyx_k_ECONNREFUSED), 0, 0, 1, 1},
  {&__pyx_n_s_EINTR, __pyx_k_EINTR, sizeof(__pyx_k_EINTR), 0, 0, 1, 1},
  {&__pyx_n_s_ENOENT, __pyx_k_ENOENT, sizeof(__pyx_k_ENOENT), 0, 0, 1, 1},
  {&__pyx_n_s_ERROR_AUTHENTICATION, __pyx_k_ERROR_AUTHENTICATION, sizeof(__pyx_k_ERROR_AUTHENTICATION), 0, 0, 1, 1},
  {&__pyx_n_s_ERROR_CONNREFUSED, __pyx_k_ERROR_CONNREFUSED, sizeof(__pyx_k_ERROR_CONNREFUSED), 0, 0, 1, 1},
  {&__pyx_n_s_ERROR_DEVICEBUSY, __pyx_k_ERROR_DEVICEBUSY, sizeof(__pyx_k_ERROR_DEVICEBUSY), 0, 0, 1, 1},
  {&__pyx_n_s_ERROR_DRIVERERROR, __pyx_k_ERROR_DRIVERERROR, sizeof(__pyx_k_ERROR_DRIVERERROR), 0, 0, 1, 1},
  {&__pyx_n_s_ERROR_EMPTYKEY, __pyx_k_ERROR_EMPTYKEY, sizeof(__pyx_k_ERROR_EMPTYKEY), 0, 0, 1, 1},
  {&__pyx_n_s_ERROR_EOF, __pyx_k_ERROR_EOF, sizeof(__pyx_k_ERROR_EOF), 0, 0, 1, 1},
  {&__pyx_n_s_ERROR_GAIERR, __pyx_k_ERROR_GAIERR, sizeof(__pyx_k_ERROR_GAIERR), 0, 0, 1, 1},
  {&__pyx_n_s_ERROR_ILLEGAL_INSTRUCTION, __pyx_k_ERROR_ILLEGAL_INSTRUCTION, sizeof(__pyx_k_ERROR_ILLEGAL_INSTRUCTION), 0, 0, 1, 1},
  {&__pyx_n_s_ERROR_INVALID_PACKET, __pyx_k_ERROR_INVALID_PACKET, sizeof(__pyx_k_ERROR_INVALID_PACKET), 0, 0, 1, 1},
  {&__pyx_n_s_ERROR_INVALID_PARAMETER, __pyx_k_ERROR_INVALID_PARAMETER, sizeof(__pyx_k_ERROR_INVALID_PARAMETER), 0, 0, 1, 1},
  {&__pyx_n_s_ERROR_LIBCERR, __pyx_k_ERROR_LIBCERR, sizeof(__pyx_k_ERROR_LIBCERR), 0, 0, 1, 1},
  {&__pyx_n_s_ERROR_NOMEM, __pyx_k_ERROR_NOMEM, sizeof(__pyx_k_ERROR_NOMEM), 0, 0, 1, 1},
  {&__pyx_n_s_ERROR_OPNOTSUPP, __pyx_k_ERROR_OPNOTSUPP, sizeof(__pyx_k_ERROR_OPNOTSUPP), 0, 0, 1, 1},
  {&__pyx_n_s_ERROR_PROTOCOL_VERSION, __pyx_k_ERROR_PROTOCOL_VERSION, sizeof(__pyx_k_ERROR_PROTOCOL_VERSION), 0, 0, 1, 1},
  {&__pyx_n_s_ERROR_READONLY_PARAMETER, __pyx_k_ERROR_READONLY_PARAMETER, sizeof(__pyx_k_ERROR_READONLY_PARAMETER), 0, 0, 1, 1},
  {&__pyx_n_s_ERROR_SUCCESS, __pyx_k_ERROR_SUCCESS, sizeof(__pyx_k_ERROR_SUCCESS), 0, 0, 1, 1},
  {&__pyx_n_s_ERROR_TTYBUSY, __pyx_k_ERROR_TTYBUSY, sizeof(__pyx_k_ERROR_TTYBUSY), 0, 0, 1, 1},
  {&__pyx_n_s_ERROR_UNKNOWNTTY, __pyx_k_ERROR_UNKNOWNTTY, sizeof(__pyx_k_ERROR_UNKNOWNTTY), 0, 0, 1, 1},
  {&__pyx_n_s_ERROR_UNKNOWN_INSTRUCTION, __pyx_k_ERROR_UNKNOWN_INSTRUCTION, sizeof(__pyx_k_ERROR_UNKNOWN_INSTRUCTION), 0, 0, 1, 1},
  {&__pyx_kp_s_Error_while_connecting_to_BrlTTY, __pyx_k_Error_while_connecting_to_BrlTTY, sizeof(__pyx_k_Error_while_connecting_to_BrlTTY), 0, 0, 1, 0},
  {&__pyx_kp_s_Error_while_performing_some_oper, __pyx_k_Error_while_performing_some_oper, sizeof(__pyx_k_Error_while_performing_some_oper), 0, 0, 1, 0},
  {&__pyx_kp_u_Integer_value_expected, __pyx_k_Integer_value_expected, sizeof(__pyx_k_Integer_value_expected), 0, 1, 0, 0},
  {&__pyx_kp_u_Integer_values_expected, __pyx_k_Integer_values_expected, sizeof(__pyx_k_Integer_values_expected), 0, 1, 0, 0},
  {&__pyx_kp_u_Is_BRLTTY_really_running, __pyx_k_Is_BRLTTY_really_running, sizeof(__pyx_k_Is_BRLTTY_really_running), 0, 1, 0, 0},
  {&__pyx_n_s_KEY_CMD_ALERT, __pyx_k_KEY_CMD_ALERT, sizeof(__pyx_k_KEY_CMD_ALERT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_ALTGR, __pyx_k_KEY_CMD_ALTGR, sizeof(__pyx_k_KEY_CMD_ALTGR), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_APNDCHARS, __pyx_k_KEY_CMD_APNDCHARS, sizeof(__pyx_k_KEY_CMD_APNDCHARS), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_ARG_MASK, __pyx_k_KEY_CMD_ARG_MASK, sizeof(__pyx_k_KEY_CMD_ARG_MASK), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_ARG_SHIFT, __pyx_k_KEY_CMD_ARG_SHIFT, sizeof(__pyx_k_KEY_CMD_ARG_SHIFT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_ASPK_CMP_WORDS, __pyx_k_KEY_CMD_ASPK_CMP_WORDS, sizeof(__pyx_k_KEY_CMD_ASPK_CMP_WORDS), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_ASPK_DEL_CHARS, __pyx_k_KEY_CMD_ASPK_DEL_CHARS, sizeof(__pyx_k_KEY_CMD_ASPK_DEL_CHARS), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_ASPK_INDENT, __pyx_k_KEY_CMD_ASPK_INDENT, sizeof(__pyx_k_KEY_CMD_ASPK_INDENT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_ASPK_INS_CHARS, __pyx_k_KEY_CMD_ASPK_INS_CHARS, sizeof(__pyx_k_KEY_CMD_ASPK_INS_CHARS), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_ASPK_REP_CHARS, __pyx_k_KEY_CMD_ASPK_REP_CHARS, sizeof(__pyx_k_KEY_CMD_ASPK_REP_CHARS), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_ASPK_SEL_CHAR, __pyx_k_KEY_CMD_ASPK_SEL_CHAR, sizeof(__pyx_k_KEY_CMD_ASPK_SEL_CHAR), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_ASPK_SEL_LINE, __pyx_k_KEY_CMD_ASPK_SEL_LINE, sizeof(__pyx_k_KEY_CMD_ASPK_SEL_LINE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_ATTRBLINK, __pyx_k_KEY_CMD_ATTRBLINK, sizeof(__pyx_k_KEY_CMD_ATTRBLINK), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_ATTRDN, __pyx_k_KEY_CMD_ATTRDN, sizeof(__pyx_k_KEY_CMD_ATTRDN), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_ATTRUP, __pyx_k_KEY_CMD_ATTRUP, sizeof(__pyx_k_KEY_CMD_ATTRUP), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_ATTRVIS, __pyx_k_KEY_CMD_ATTRVIS, sizeof(__pyx_k_KEY_CMD_ATTRVIS), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_AUTOREPEAT, __pyx_k_KEY_CMD_AUTOREPEAT, sizeof(__pyx_k_KEY_CMD_AUTOREPEAT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_AUTOSPEAK, __pyx_k_KEY_CMD_AUTOSPEAK, sizeof(__pyx_k_KEY_CMD_AUTOSPEAK), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_BACK, __pyx_k_KEY_CMD_BACK, sizeof(__pyx_k_KEY_CMD_BACK), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_BLK_MASK, __pyx_k_KEY_CMD_BLK_MASK, sizeof(__pyx_k_KEY_CMD_BLK_MASK), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_BLK_SHIFT, __pyx_k_KEY_CMD_BLK_SHIFT, sizeof(__pyx_k_KEY_CMD_BLK_SHIFT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_BOT, __pyx_k_KEY_CMD_BOT, sizeof(__pyx_k_KEY_CMD_BOT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_BOT_LEFT, __pyx_k_KEY_CMD_BOT_LEFT, sizeof(__pyx_k_KEY_CMD_BOT_LEFT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_BRLKBD, __pyx_k_KEY_CMD_BRLKBD, sizeof(__pyx_k_KEY_CMD_BRLKBD), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_BRLUCDOTS, __pyx_k_KEY_CMD_BRLUCDOTS, sizeof(__pyx_k_KEY_CMD_BRLUCDOTS), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_BRL_START, __pyx_k_KEY_CMD_BRL_START, sizeof(__pyx_k_KEY_CMD_BRL_START), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_BRL_STOP, __pyx_k_KEY_CMD_BRL_STOP, sizeof(__pyx_k_KEY_CMD_BRL_STOP), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_CAPBLINK, __pyx_k_KEY_CMD_CAPBLINK, sizeof(__pyx_k_KEY_CMD_CAPBLINK), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_CHRLT, __pyx_k_KEY_CMD_CHRLT, sizeof(__pyx_k_KEY_CMD_CHRLT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_CHRRT, __pyx_k_KEY_CMD_CHRRT, sizeof(__pyx_k_KEY_CMD_CHRRT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_CLIP_ADD, __pyx_k_KEY_CMD_CLIP_ADD, sizeof(__pyx_k_KEY_CMD_CLIP_ADD), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_CLIP_APPEND, __pyx_k_KEY_CMD_CLIP_APPEND, sizeof(__pyx_k_KEY_CMD_CLIP_APPEND), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_CLIP_COPY, __pyx_k_KEY_CMD_CLIP_COPY, sizeof(__pyx_k_KEY_CMD_CLIP_COPY), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_CLIP_NEW, __pyx_k_KEY_CMD_CLIP_NEW, sizeof(__pyx_k_KEY_CMD_CLIP_NEW), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_CLIP_RESTORE, __pyx_k_KEY_CMD_CLIP_RESTORE, sizeof(__pyx_k_KEY_CMD_CLIP_RESTORE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_CLIP_SAVE, __pyx_k_KEY_CMD_CLIP_SAVE, sizeof(__pyx_k_KEY_CMD_CLIP_SAVE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_COMPBRL6, __pyx_k_KEY_CMD_COMPBRL6, sizeof(__pyx_k_KEY_CMD_COMPBRL6), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_CONTEXT, __pyx_k_KEY_CMD_CONTEXT, sizeof(__pyx_k_KEY_CMD_CONTEXT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_CONTRACTED, __pyx_k_KEY_CMD_CONTRACTED, sizeof(__pyx_k_KEY_CMD_CONTRACTED), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_CONTROL, __pyx_k_KEY_CMD_CONTROL, sizeof(__pyx_k_KEY_CMD_CONTROL), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_COPYCHARS, __pyx_k_KEY_CMD_COPYCHARS, sizeof(__pyx_k_KEY_CMD_COPYCHARS), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_COPY_LINE, __pyx_k_KEY_CMD_COPY_LINE, sizeof(__pyx_k_KEY_CMD_COPY_LINE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_COPY_RECT, __pyx_k_KEY_CMD_COPY_RECT, sizeof(__pyx_k_KEY_CMD_COPY_RECT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_CSRBLINK, __pyx_k_KEY_CMD_CSRBLINK, sizeof(__pyx_k_KEY_CMD_CSRBLINK), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_CSRHIDE, __pyx_k_KEY_CMD_CSRHIDE, sizeof(__pyx_k_KEY_CMD_CSRHIDE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_CSRJMP_VERT, __pyx_k_KEY_CMD_CSRJMP_VERT, sizeof(__pyx_k_KEY_CMD_CSRJMP_VERT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_CSRSIZE, __pyx_k_KEY_CMD_CSRSIZE, sizeof(__pyx_k_KEY_CMD_CSRSIZE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_CSRTRK, __pyx_k_KEY_CMD_CSRTRK, sizeof(__pyx_k_KEY_CMD_CSRTRK), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_CSRVIS, __pyx_k_KEY_CMD_CSRVIS, sizeof(__pyx_k_KEY_CMD_CSRVIS), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_CUTAPPEND, __pyx_k_KEY_CMD_CUTAPPEND, sizeof(__pyx_k_KEY_CMD_CUTAPPEND), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_CUTBEGIN, __pyx_k_KEY_CMD_CUTBEGIN, sizeof(__pyx_k_KEY_CMD_CUTBEGIN), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_CUTLINE, __pyx_k_KEY_CMD_CUTLINE, sizeof(__pyx_k_KEY_CMD_CUTLINE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_CUTRECT, __pyx_k_KEY_CMD_CUTRECT, sizeof(__pyx_k_KEY_CMD_CUTRECT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_DESCCHAR, __pyx_k_KEY_CMD_DESCCHAR, sizeof(__pyx_k_KEY_CMD_DESCCHAR), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_DESC_CURR_CHAR, __pyx_k_KEY_CMD_DESC_CURR_CHAR, sizeof(__pyx_k_KEY_CMD_DESC_CURR_CHAR), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_DISPMD, __pyx_k_KEY_CMD_DISPMD, sizeof(__pyx_k_KEY_CMD_DISPMD), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_FREEZE, __pyx_k_KEY_CMD_FREEZE, sizeof(__pyx_k_KEY_CMD_FREEZE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_FWINLT, __pyx_k_KEY_CMD_FWINLT, sizeof(__pyx_k_KEY_CMD_FWINLT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_FWINLTSKIP, __pyx_k_KEY_CMD_FWINLTSKIP, sizeof(__pyx_k_KEY_CMD_FWINLTSKIP), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_FWINRT, __pyx_k_KEY_CMD_FWINRT, sizeof(__pyx_k_KEY_CMD_FWINRT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_FWINRTSKIP, __pyx_k_KEY_CMD_FWINRTSKIP, sizeof(__pyx_k_KEY_CMD_FWINRTSKIP), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_GOTOLINE, __pyx_k_KEY_CMD_GOTOLINE, sizeof(__pyx_k_KEY_CMD_GOTOLINE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_GOTOMARK, __pyx_k_KEY_CMD_GOTOMARK, sizeof(__pyx_k_KEY_CMD_GOTOMARK), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_GUI, __pyx_k_KEY_CMD_GUI, sizeof(__pyx_k_KEY_CMD_GUI), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_GUI_APP_ALERTS, __pyx_k_KEY_CMD_GUI_APP_ALERTS, sizeof(__pyx_k_KEY_CMD_GUI_APP_ALERTS), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_GUI_APP_LIST, __pyx_k_KEY_CMD_GUI_APP_LIST, sizeof(__pyx_k_KEY_CMD_GUI_APP_LIST), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_GUI_APP_MENU, __pyx_k_KEY_CMD_GUI_APP_MENU, sizeof(__pyx_k_KEY_CMD_GUI_APP_MENU), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_GUI_AREA_ACTV, __pyx_k_KEY_CMD_GUI_AREA_ACTV, sizeof(__pyx_k_KEY_CMD_GUI_AREA_ACTV), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_GUI_AREA_NEXT, __pyx_k_KEY_CMD_GUI_AREA_NEXT, sizeof(__pyx_k_KEY_CMD_GUI_AREA_NEXT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_GUI_AREA_PREV, __pyx_k_KEY_CMD_GUI_AREA_PREV, sizeof(__pyx_k_KEY_CMD_GUI_AREA_PREV), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_GUI_BACK, __pyx_k_KEY_CMD_GUI_BACK, sizeof(__pyx_k_KEY_CMD_GUI_BACK), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_GUI_BRL_ACTIONS, __pyx_k_KEY_CMD_GUI_BRL_ACTIONS, sizeof(__pyx_k_KEY_CMD_GUI_BRL_ACTIONS), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_GUI_DEV_OPTIONS, __pyx_k_KEY_CMD_GUI_DEV_OPTIONS, sizeof(__pyx_k_KEY_CMD_GUI_DEV_OPTIONS), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_GUI_DEV_SETTINGS, __pyx_k_KEY_CMD_GUI_DEV_SETTINGS, sizeof(__pyx_k_KEY_CMD_GUI_DEV_SETTINGS), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_GUI_HOME, __pyx_k_KEY_CMD_GUI_HOME, sizeof(__pyx_k_KEY_CMD_GUI_HOME), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_GUI_ITEM_FRST, __pyx_k_KEY_CMD_GUI_ITEM_FRST, sizeof(__pyx_k_KEY_CMD_GUI_ITEM_FRST), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_GUI_ITEM_LAST, __pyx_k_KEY_CMD_GUI_ITEM_LAST, sizeof(__pyx_k_KEY_CMD_GUI_ITEM_LAST), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_GUI_ITEM_NEXT, __pyx_k_KEY_CMD_GUI_ITEM_NEXT, sizeof(__pyx_k_KEY_CMD_GUI_ITEM_NEXT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_GUI_ITEM_PREV, __pyx_k_KEY_CMD_GUI_ITEM_PREV, sizeof(__pyx_k_KEY_CMD_GUI_ITEM_PREV), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_GUI_TITLE, __pyx_k_KEY_CMD_GUI_TITLE, sizeof(__pyx_k_KEY_CMD_GUI_TITLE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_HELP, __pyx_k_KEY_CMD_HELP, sizeof(__pyx_k_KEY_CMD_HELP), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_HOME, __pyx_k_KEY_CMD_HOME, sizeof(__pyx_k_KEY_CMD_HOME), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_HOST_COPY, __pyx_k_KEY_CMD_HOST_COPY, sizeof(__pyx_k_KEY_CMD_HOST_COPY), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_HOST_CUT, __pyx_k_KEY_CMD_HOST_CUT, sizeof(__pyx_k_KEY_CMD_HOST_CUT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_HOST_PASTE, __pyx_k_KEY_CMD_HOST_PASTE, sizeof(__pyx_k_KEY_CMD_HOST_PASTE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_HWINLT, __pyx_k_KEY_CMD_HWINLT, sizeof(__pyx_k_KEY_CMD_HWINLT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_HWINRT, __pyx_k_KEY_CMD_HWINRT, sizeof(__pyx_k_KEY_CMD_HWINRT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_INDICATORS, __pyx_k_KEY_CMD_INDICATORS, sizeof(__pyx_k_KEY_CMD_INDICATORS), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_INFO, __pyx_k_KEY_CMD_INFO, sizeof(__pyx_k_KEY_CMD_INFO), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_LEARN, __pyx_k_KEY_CMD_LEARN, sizeof(__pyx_k_KEY_CMD_LEARN), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_LNBEG, __pyx_k_KEY_CMD_LNBEG, sizeof(__pyx_k_KEY_CMD_LNBEG), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_LNDN, __pyx_k_KEY_CMD_LNDN, sizeof(__pyx_k_KEY_CMD_LNDN), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_LNEND, __pyx_k_KEY_CMD_LNEND, sizeof(__pyx_k_KEY_CMD_LNEND), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_LNUP, __pyx_k_KEY_CMD_LNUP, sizeof(__pyx_k_KEY_CMD_LNUP), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_MENU_FIRST_ITEM, __pyx_k_KEY_CMD_MENU_FIRST_ITEM, sizeof(__pyx_k_KEY_CMD_MENU_FIRST_ITEM), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_MENU_LAST_ITEM, __pyx_k_KEY_CMD_MENU_LAST_ITEM, sizeof(__pyx_k_KEY_CMD_MENU_LAST_ITEM), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_MENU_NEXT_ITEM, __pyx_k_KEY_CMD_MENU_NEXT_ITEM, sizeof(__pyx_k_KEY_CMD_MENU_NEXT_ITEM), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_MENU_NEXT_SETTING, __pyx_k_KEY_CMD_MENU_NEXT_SETTING, sizeof(__pyx_k_KEY_CMD_MENU_NEXT_SETTING), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_MENU_PREV_ITEM, __pyx_k_KEY_CMD_MENU_PREV_ITEM, sizeof(__pyx_k_KEY_CMD_MENU_PREV_ITEM), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_MENU_PREV_LEVEL, __pyx_k_KEY_CMD_MENU_PREV_LEVEL, sizeof(__pyx_k_KEY_CMD_MENU_PREV_LEVEL), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_MENU_PREV_SETTING, __pyx_k_KEY_CMD_MENU_PREV_SETTING, sizeof(__pyx_k_KEY_CMD_MENU_PREV_SETTING), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_META, __pyx_k_KEY_CMD_META, sizeof(__pyx_k_KEY_CMD_META), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_MUTE, __pyx_k_KEY_CMD_MUTE, sizeof(__pyx_k_KEY_CMD_MUTE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_NOOP, __pyx_k_KEY_CMD_NOOP, sizeof(__pyx_k_KEY_CMD_NOOP), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_NXDIFCHAR, __pyx_k_KEY_CMD_NXDIFCHAR, sizeof(__pyx_k_KEY_CMD_NXDIFCHAR), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_NXDIFLN, __pyx_k_KEY_CMD_NXDIFLN, sizeof(__pyx_k_KEY_CMD_NXDIFLN), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_NXINDENT, __pyx_k_KEY_CMD_NXINDENT, sizeof(__pyx_k_KEY_CMD_NXINDENT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_NXNBWIN, __pyx_k_KEY_CMD_NXNBWIN, sizeof(__pyx_k_KEY_CMD_NXNBWIN), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_NXPGRPH, __pyx_k_KEY_CMD_NXPGRPH, sizeof(__pyx_k_KEY_CMD_NXPGRPH), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_NXPROMPT, __pyx_k_KEY_CMD_NXPROMPT, sizeof(__pyx_k_KEY_CMD_NXPROMPT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_NXSEARCH, __pyx_k_KEY_CMD_NXSEARCH, sizeof(__pyx_k_KEY_CMD_NXSEARCH), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_OFFLINE, __pyx_k_KEY_CMD_OFFLINE, sizeof(__pyx_k_KEY_CMD_OFFLINE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_PASSAT, __pyx_k_KEY_CMD_PASSAT, sizeof(__pyx_k_KEY_CMD_PASSAT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_PASSDOTS, __pyx_k_KEY_CMD_PASSDOTS, sizeof(__pyx_k_KEY_CMD_PASSDOTS), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_PASSPS2, __pyx_k_KEY_CMD_PASSPS2, sizeof(__pyx_k_KEY_CMD_PASSPS2), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_PASSXT, __pyx_k_KEY_CMD_PASSXT, sizeof(__pyx_k_KEY_CMD_PASSXT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_PASTE, __pyx_k_KEY_CMD_PASTE, sizeof(__pyx_k_KEY_CMD_PASTE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_PASTE_HISTORY, __pyx_k_KEY_CMD_PASTE_HISTORY, sizeof(__pyx_k_KEY_CMD_PASTE_HISTORY), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_PRDIFCHAR, __pyx_k_KEY_CMD_PRDIFCHAR, sizeof(__pyx_k_KEY_CMD_PRDIFCHAR), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_PRDIFLN, __pyx_k_KEY_CMD_PRDIFLN, sizeof(__pyx_k_KEY_CMD_PRDIFLN), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_PREFLOAD, __pyx_k_KEY_CMD_PREFLOAD, sizeof(__pyx_k_KEY_CMD_PREFLOAD), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_PREFMENU, __pyx_k_KEY_CMD_PREFMENU, sizeof(__pyx_k_KEY_CMD_PREFMENU), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_PREFSAVE, __pyx_k_KEY_CMD_PREFSAVE, sizeof(__pyx_k_KEY_CMD_PREFSAVE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_PRINDENT, __pyx_k_KEY_CMD_PRINDENT, sizeof(__pyx_k_KEY_CMD_PRINDENT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_PRNBWIN, __pyx_k_KEY_CMD_PRNBWIN, sizeof(__pyx_k_KEY_CMD_PRNBWIN), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_PRPGRPH, __pyx_k_KEY_CMD_PRPGRPH, sizeof(__pyx_k_KEY_CMD_PRPGRPH), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_PRPROMPT, __pyx_k_KEY_CMD_PRPROMPT, sizeof(__pyx_k_KEY_CMD_PRPROMPT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_PRSEARCH, __pyx_k_KEY_CMD_PRSEARCH, sizeof(__pyx_k_KEY_CMD_PRSEARCH), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_REFRESH, __pyx_k_KEY_CMD_REFRESH, sizeof(__pyx_k_KEY_CMD_REFRESH), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_REFRESH_LINE, __pyx_k_KEY_CMD_REFRESH_LINE, sizeof(__pyx_k_KEY_CMD_REFRESH_LINE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_RESTARTBRL, __pyx_k_KEY_CMD_RESTARTBRL, sizeof(__pyx_k_KEY_CMD_RESTARTBRL), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_RESTARTSPEECH, __pyx_k_KEY_CMD_RESTARTSPEECH, sizeof(__pyx_k_KEY_CMD_RESTARTSPEECH), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_RETURN, __pyx_k_KEY_CMD_RETURN, sizeof(__pyx_k_KEY_CMD_RETURN), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_ROUTE, __pyx_k_KEY_CMD_ROUTE, sizeof(__pyx_k_KEY_CMD_ROUTE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_ROUTE_CURR_LOCN, __pyx_k_KEY_CMD_ROUTE_CURR_LOCN, sizeof(__pyx_k_KEY_CMD_ROUTE_CURR_LOCN), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_ROUTE_LINE, __pyx_k_KEY_CMD_ROUTE_LINE, sizeof(__pyx_k_KEY_CMD_ROUTE_LINE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SAY_ABOVE, __pyx_k_KEY_CMD_SAY_ABOVE, sizeof(__pyx_k_KEY_CMD_SAY_ABOVE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SAY_ALL, __pyx_k_KEY_CMD_SAY_ALL, sizeof(__pyx_k_KEY_CMD_SAY_ALL), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SAY_BELOW, __pyx_k_KEY_CMD_SAY_BELOW, sizeof(__pyx_k_KEY_CMD_SAY_BELOW), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SAY_FASTER, __pyx_k_KEY_CMD_SAY_FASTER, sizeof(__pyx_k_KEY_CMD_SAY_FASTER), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SAY_HIGHER, __pyx_k_KEY_CMD_SAY_HIGHER, sizeof(__pyx_k_KEY_CMD_SAY_HIGHER), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SAY_LINE, __pyx_k_KEY_CMD_SAY_LINE, sizeof(__pyx_k_KEY_CMD_SAY_LINE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SAY_LOUDER, __pyx_k_KEY_CMD_SAY_LOUDER, sizeof(__pyx_k_KEY_CMD_SAY_LOUDER), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SAY_LOWER, __pyx_k_KEY_CMD_SAY_LOWER, sizeof(__pyx_k_KEY_CMD_SAY_LOWER), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SAY_SLOWER, __pyx_k_KEY_CMD_SAY_SLOWER, sizeof(__pyx_k_KEY_CMD_SAY_SLOWER), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SAY_SOFTER, __pyx_k_KEY_CMD_SAY_SOFTER, sizeof(__pyx_k_KEY_CMD_SAY_SOFTER), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SCR_START, __pyx_k_KEY_CMD_SCR_START, sizeof(__pyx_k_KEY_CMD_SCR_START), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SCR_STOP, __pyx_k_KEY_CMD_SCR_STOP, sizeof(__pyx_k_KEY_CMD_SCR_STOP), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SELECTVT, __pyx_k_KEY_CMD_SELECTVT, sizeof(__pyx_k_KEY_CMD_SELECTVT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SELECTVT_NEXT, __pyx_k_KEY_CMD_SELECTVT_NEXT, sizeof(__pyx_k_KEY_CMD_SELECTVT_NEXT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SELECTVT_PREV, __pyx_k_KEY_CMD_SELECTVT_PREV, sizeof(__pyx_k_KEY_CMD_SELECTVT_PREV), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SETLEFT, __pyx_k_KEY_CMD_SETLEFT, sizeof(__pyx_k_KEY_CMD_SETLEFT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SETMARK, __pyx_k_KEY_CMD_SETMARK, sizeof(__pyx_k_KEY_CMD_SETMARK), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SET_ATTRIBUTES_TABLE, __pyx_k_KEY_CMD_SET_ATTRIBUTES_TABLE, sizeof(__pyx_k_KEY_CMD_SET_ATTRIBUTES_TABLE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SET_CONTRACTION_TABLE, __pyx_k_KEY_CMD_SET_CONTRACTION_TABLE, sizeof(__pyx_k_KEY_CMD_SET_CONTRACTION_TABLE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SET_KEYBOARD_TABLE, __pyx_k_KEY_CMD_SET_KEYBOARD_TABLE, sizeof(__pyx_k_KEY_CMD_SET_KEYBOARD_TABLE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SET_LANGUAGE_PROFILE, __pyx_k_KEY_CMD_SET_LANGUAGE_PROFILE, sizeof(__pyx_k_KEY_CMD_SET_LANGUAGE_PROFILE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SET_TEXT_TABLE, __pyx_k_KEY_CMD_SET_TEXT_TABLE, sizeof(__pyx_k_KEY_CMD_SET_TEXT_TABLE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SHIFT, __pyx_k_KEY_CMD_SHIFT, sizeof(__pyx_k_KEY_CMD_SHIFT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SHOW_CURR_LOCN, __pyx_k_KEY_CMD_SHOW_CURR_LOCN, sizeof(__pyx_k_KEY_CMD_SHOW_CURR_LOCN), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SIXDOTS, __pyx_k_KEY_CMD_SIXDOTS, sizeof(__pyx_k_KEY_CMD_SIXDOTS), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SKPBLNKWINS, __pyx_k_KEY_CMD_SKPBLNKWINS, sizeof(__pyx_k_KEY_CMD_SKPBLNKWINS), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SKPIDLNS, __pyx_k_KEY_CMD_SKPIDLNS, sizeof(__pyx_k_KEY_CMD_SKPIDLNS), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SLIDEWIN, __pyx_k_KEY_CMD_SLIDEWIN, sizeof(__pyx_k_KEY_CMD_SLIDEWIN), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SPEAK_CURR_CHAR, __pyx_k_KEY_CMD_SPEAK_CURR_CHAR, sizeof(__pyx_k_KEY_CMD_SPEAK_CURR_CHAR), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SPEAK_CURR_LINE, __pyx_k_KEY_CMD_SPEAK_CURR_LINE, sizeof(__pyx_k_KEY_CMD_SPEAK_CURR_LINE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SPEAK_CURR_LOCN, __pyx_k_KEY_CMD_SPEAK_CURR_LOCN, sizeof(__pyx_k_KEY_CMD_SPEAK_CURR_LOCN), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SPEAK_CURR_WORD, __pyx_k_KEY_CMD_SPEAK_CURR_WORD, sizeof(__pyx_k_KEY_CMD_SPEAK_CURR_WORD), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SPEAK_FRST_CHAR, __pyx_k_KEY_CMD_SPEAK_FRST_CHAR, sizeof(__pyx_k_KEY_CMD_SPEAK_FRST_CHAR), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SPEAK_FRST_LINE, __pyx_k_KEY_CMD_SPEAK_FRST_LINE, sizeof(__pyx_k_KEY_CMD_SPEAK_FRST_LINE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SPEAK_INDENT, __pyx_k_KEY_CMD_SPEAK_INDENT, sizeof(__pyx_k_KEY_CMD_SPEAK_INDENT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SPEAK_LAST_CHAR, __pyx_k_KEY_CMD_SPEAK_LAST_CHAR, sizeof(__pyx_k_KEY_CMD_SPEAK_LAST_CHAR), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SPEAK_LAST_LINE, __pyx_k_KEY_CMD_SPEAK_LAST_LINE, sizeof(__pyx_k_KEY_CMD_SPEAK_LAST_LINE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SPEAK_NEXT_CHAR, __pyx_k_KEY_CMD_SPEAK_NEXT_CHAR, sizeof(__pyx_k_KEY_CMD_SPEAK_NEXT_CHAR), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SPEAK_NEXT_LINE, __pyx_k_KEY_CMD_SPEAK_NEXT_LINE, sizeof(__pyx_k_KEY_CMD_SPEAK_NEXT_LINE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SPEAK_NEXT_WORD, __pyx_k_KEY_CMD_SPEAK_NEXT_WORD, sizeof(__pyx_k_KEY_CMD_SPEAK_NEXT_WORD), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SPEAK_PREV_CHAR, __pyx_k_KEY_CMD_SPEAK_PREV_CHAR, sizeof(__pyx_k_KEY_CMD_SPEAK_PREV_CHAR), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SPEAK_PREV_LINE, __pyx_k_KEY_CMD_SPEAK_PREV_LINE, sizeof(__pyx_k_KEY_CMD_SPEAK_PREV_LINE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SPEAK_PREV_WORD, __pyx_k_KEY_CMD_SPEAK_PREV_WORD, sizeof(__pyx_k_KEY_CMD_SPEAK_PREV_WORD), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SPELL_CURR_WORD, __pyx_k_KEY_CMD_SPELL_CURR_WORD, sizeof(__pyx_k_KEY_CMD_SPELL_CURR_WORD), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SPKHOME, __pyx_k_KEY_CMD_SPKHOME, sizeof(__pyx_k_KEY_CMD_SPKHOME), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SPK_START, __pyx_k_KEY_CMD_SPK_START, sizeof(__pyx_k_KEY_CMD_SPK_START), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SPK_STOP, __pyx_k_KEY_CMD_SPK_STOP, sizeof(__pyx_k_KEY_CMD_SPK_STOP), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SWITCHVT, __pyx_k_KEY_CMD_SWITCHVT, sizeof(__pyx_k_KEY_CMD_SWITCHVT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SWITCHVT_NEXT, __pyx_k_KEY_CMD_SWITCHVT_NEXT, sizeof(__pyx_k_KEY_CMD_SWITCHVT_NEXT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_SWITCHVT_PREV, __pyx_k_KEY_CMD_SWITCHVT_PREV, sizeof(__pyx_k_KEY_CMD_SWITCHVT_PREV), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_TIME, __pyx_k_KEY_CMD_TIME, sizeof(__pyx_k_KEY_CMD_TIME), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_TOP, __pyx_k_KEY_CMD_TOP, sizeof(__pyx_k_KEY_CMD_TOP), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_TOP_LEFT, __pyx_k_KEY_CMD_TOP_LEFT, sizeof(__pyx_k_KEY_CMD_TOP_LEFT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_TOUCH_AT, __pyx_k_KEY_CMD_TOUCH_AT, sizeof(__pyx_k_KEY_CMD_TOUCH_AT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_TOUCH_NAV, __pyx_k_KEY_CMD_TOUCH_NAV, sizeof(__pyx_k_KEY_CMD_TOUCH_NAV), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_TUNES, __pyx_k_KEY_CMD_TUNES, sizeof(__pyx_k_KEY_CMD_TUNES), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_TXTSEL_ALL, __pyx_k_KEY_CMD_TXTSEL_ALL, sizeof(__pyx_k_KEY_CMD_TXTSEL_ALL), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_TXTSEL_CLEAR, __pyx_k_KEY_CMD_TXTSEL_CLEAR, sizeof(__pyx_k_KEY_CMD_TXTSEL_CLEAR), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_TXTSEL_SET, __pyx_k_KEY_CMD_TXTSEL_SET, sizeof(__pyx_k_KEY_CMD_TXTSEL_SET), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_TXTSEL_START, __pyx_k_KEY_CMD_TXTSEL_START, sizeof(__pyx_k_KEY_CMD_TXTSEL_START), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_UNSTICK, __pyx_k_KEY_CMD_UNSTICK, sizeof(__pyx_k_KEY_CMD_UNSTICK), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_UPPER, __pyx_k_KEY_CMD_UPPER, sizeof(__pyx_k_KEY_CMD_UPPER), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_WINDN, __pyx_k_KEY_CMD_WINDN, sizeof(__pyx_k_KEY_CMD_WINDN), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CMD_WINUP, __pyx_k_KEY_CMD_WINUP, sizeof(__pyx_k_KEY_CMD_WINUP), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CODE_MASK, __pyx_k_KEY_CODE_MASK, sizeof(__pyx_k_KEY_CODE_MASK), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_CODE_SHIFT, __pyx_k_KEY_CODE_SHIFT, sizeof(__pyx_k_KEY_CODE_SHIFT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_FLAGS_MASK, __pyx_k_KEY_FLAGS_MASK, sizeof(__pyx_k_KEY_FLAGS_MASK), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_FLAGS_SHIFT, __pyx_k_KEY_FLAGS_SHIFT, sizeof(__pyx_k_KEY_FLAGS_SHIFT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_FLG_INPUT_ALTGR, __pyx_k_KEY_FLG_INPUT_ALTGR, sizeof(__pyx_k_KEY_FLG_INPUT_ALTGR), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_FLG_INPUT_CONTROL, __pyx_k_KEY_FLG_INPUT_CONTROL, sizeof(__pyx_k_KEY_FLG_INPUT_CONTROL), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_FLG_INPUT_ESCAPED, __pyx_k_KEY_FLG_INPUT_ESCAPED, sizeof(__pyx_k_KEY_FLG_INPUT_ESCAPED), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_FLG_INPUT_GUI, __pyx_k_KEY_FLG_INPUT_GUI, sizeof(__pyx_k_KEY_FLG_INPUT_GUI), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_FLG_INPUT_META, __pyx_k_KEY_FLG_INPUT_META, sizeof(__pyx_k_KEY_FLG_INPUT_META), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_FLG_INPUT_SHIFT, __pyx_k_KEY_FLG_INPUT_SHIFT, sizeof(__pyx_k_KEY_FLG_INPUT_SHIFT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_FLG_INPUT_UPPER, __pyx_k_KEY_FLG_INPUT_UPPER, sizeof(__pyx_k_KEY_FLG_INPUT_UPPER), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_FLG_KBD_EMUL0, __pyx_k_KEY_FLG_KBD_EMUL0, sizeof(__pyx_k_KEY_FLG_KBD_EMUL0), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_FLG_KBD_EMUL1, __pyx_k_KEY_FLG_KBD_EMUL1, sizeof(__pyx_k_KEY_FLG_KBD_EMUL1), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_FLG_KBD_RELEASE, __pyx_k_KEY_FLG_KBD_RELEASE, sizeof(__pyx_k_KEY_FLG_KBD_RELEASE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_FLG_MOTION_ROUTE, __pyx_k_KEY_FLG_MOTION_ROUTE, sizeof(__pyx_k_KEY_FLG_MOTION_ROUTE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_FLG_MOTION_SCALED, __pyx_k_KEY_FLG_MOTION_SCALED, sizeof(__pyx_k_KEY_FLG_MOTION_SCALED), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_FLG_MOTION_TOLEFT, __pyx_k_KEY_FLG_MOTION_TOLEFT, sizeof(__pyx_k_KEY_FLG_MOTION_TOLEFT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_FLG_TOGGLE_MASK, __pyx_k_KEY_FLG_TOGGLE_MASK, sizeof(__pyx_k_KEY_FLG_TOGGLE_MASK), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_FLG_TOGGLE_OFF, __pyx_k_KEY_FLG_TOGGLE_OFF, sizeof(__pyx_k_KEY_FLG_TOGGLE_OFF), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_FLG_TOGGLE_ON, __pyx_k_KEY_FLG_TOGGLE_ON, sizeof(__pyx_k_KEY_FLG_TOGGLE_ON), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_MAX, __pyx_k_KEY_MAX, sizeof(__pyx_k_KEY_MAX), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_BACKSPACE, __pyx_k_KEY_SYM_BACKSPACE, sizeof(__pyx_k_KEY_SYM_BACKSPACE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_DELETE, __pyx_k_KEY_SYM_DELETE, sizeof(__pyx_k_KEY_SYM_DELETE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_DOWN, __pyx_k_KEY_SYM_DOWN, sizeof(__pyx_k_KEY_SYM_DOWN), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_END, __pyx_k_KEY_SYM_END, sizeof(__pyx_k_KEY_SYM_END), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_ESCAPE, __pyx_k_KEY_SYM_ESCAPE, sizeof(__pyx_k_KEY_SYM_ESCAPE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F1, __pyx_k_KEY_SYM_F1, sizeof(__pyx_k_KEY_SYM_F1), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F10, __pyx_k_KEY_SYM_F10, sizeof(__pyx_k_KEY_SYM_F10), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F11, __pyx_k_KEY_SYM_F11, sizeof(__pyx_k_KEY_SYM_F11), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F12, __pyx_k_KEY_SYM_F12, sizeof(__pyx_k_KEY_SYM_F12), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F13, __pyx_k_KEY_SYM_F13, sizeof(__pyx_k_KEY_SYM_F13), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F14, __pyx_k_KEY_SYM_F14, sizeof(__pyx_k_KEY_SYM_F14), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F15, __pyx_k_KEY_SYM_F15, sizeof(__pyx_k_KEY_SYM_F15), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F16, __pyx_k_KEY_SYM_F16, sizeof(__pyx_k_KEY_SYM_F16), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F17, __pyx_k_KEY_SYM_F17, sizeof(__pyx_k_KEY_SYM_F17), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F18, __pyx_k_KEY_SYM_F18, sizeof(__pyx_k_KEY_SYM_F18), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F19, __pyx_k_KEY_SYM_F19, sizeof(__pyx_k_KEY_SYM_F19), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F2, __pyx_k_KEY_SYM_F2, sizeof(__pyx_k_KEY_SYM_F2), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F20, __pyx_k_KEY_SYM_F20, sizeof(__pyx_k_KEY_SYM_F20), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F21, __pyx_k_KEY_SYM_F21, sizeof(__pyx_k_KEY_SYM_F21), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F22, __pyx_k_KEY_SYM_F22, sizeof(__pyx_k_KEY_SYM_F22), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F23, __pyx_k_KEY_SYM_F23, sizeof(__pyx_k_KEY_SYM_F23), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F24, __pyx_k_KEY_SYM_F24, sizeof(__pyx_k_KEY_SYM_F24), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F25, __pyx_k_KEY_SYM_F25, sizeof(__pyx_k_KEY_SYM_F25), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F26, __pyx_k_KEY_SYM_F26, sizeof(__pyx_k_KEY_SYM_F26), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F27, __pyx_k_KEY_SYM_F27, sizeof(__pyx_k_KEY_SYM_F27), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F28, __pyx_k_KEY_SYM_F28, sizeof(__pyx_k_KEY_SYM_F28), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F29, __pyx_k_KEY_SYM_F29, sizeof(__pyx_k_KEY_SYM_F29), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F3, __pyx_k_KEY_SYM_F3, sizeof(__pyx_k_KEY_SYM_F3), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F30, __pyx_k_KEY_SYM_F30, sizeof(__pyx_k_KEY_SYM_F30), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F31, __pyx_k_KEY_SYM_F31, sizeof(__pyx_k_KEY_SYM_F31), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F32, __pyx_k_KEY_SYM_F32, sizeof(__pyx_k_KEY_SYM_F32), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F33, __pyx_k_KEY_SYM_F33, sizeof(__pyx_k_KEY_SYM_F33), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F34, __pyx_k_KEY_SYM_F34, sizeof(__pyx_k_KEY_SYM_F34), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F35, __pyx_k_KEY_SYM_F35, sizeof(__pyx_k_KEY_SYM_F35), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F4, __pyx_k_KEY_SYM_F4, sizeof(__pyx_k_KEY_SYM_F4), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F5, __pyx_k_KEY_SYM_F5, sizeof(__pyx_k_KEY_SYM_F5), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F6, __pyx_k_KEY_SYM_F6, sizeof(__pyx_k_KEY_SYM_F6), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F7, __pyx_k_KEY_SYM_F7, sizeof(__pyx_k_KEY_SYM_F7), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F8, __pyx_k_KEY_SYM_F8, sizeof(__pyx_k_KEY_SYM_F8), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_F9, __pyx_k_KEY_SYM_F9, sizeof(__pyx_k_KEY_SYM_F9), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_HOME, __pyx_k_KEY_SYM_HOME, sizeof(__pyx_k_KEY_SYM_HOME), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_INSERT, __pyx_k_KEY_SYM_INSERT, sizeof(__pyx_k_KEY_SYM_INSERT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_LEFT, __pyx_k_KEY_SYM_LEFT, sizeof(__pyx_k_KEY_SYM_LEFT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_LINEFEED, __pyx_k_KEY_SYM_LINEFEED, sizeof(__pyx_k_KEY_SYM_LINEFEED), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_PAGE_DOWN, __pyx_k_KEY_SYM_PAGE_DOWN, sizeof(__pyx_k_KEY_SYM_PAGE_DOWN), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_PAGE_UP, __pyx_k_KEY_SYM_PAGE_UP, sizeof(__pyx_k_KEY_SYM_PAGE_UP), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_RIGHT, __pyx_k_KEY_SYM_RIGHT, sizeof(__pyx_k_KEY_SYM_RIGHT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_TAB, __pyx_k_KEY_SYM_TAB, sizeof(__pyx_k_KEY_SYM_TAB), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_UNICODE, __pyx_k_KEY_SYM_UNICODE, sizeof(__pyx_k_KEY_SYM_UNICODE), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_SYM_UP, __pyx_k_KEY_SYM_UP, sizeof(__pyx_k_KEY_SYM_UP), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_TYPE_CMD, __pyx_k_KEY_TYPE_CMD, sizeof(__pyx_k_KEY_TYPE_CMD), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_TYPE_MASK, __pyx_k_KEY_TYPE_MASK, sizeof(__pyx_k_KEY_TYPE_MASK), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_TYPE_SHIFT, __pyx_k_KEY_TYPE_SHIFT, sizeof(__pyx_k_KEY_TYPE_SHIFT), 0, 0, 1, 1},
  {&__pyx_n_s_KEY_TYPE_SYM, __pyx_k_KEY_TYPE_SYM, sizeof(__pyx_k_KEY_TYPE_SYM), 0, 0, 1, 1},
  {&__pyx_n_s_OperationError, __pyx_k_OperationError, sizeof(__pyx_k_OperationError), 0, 0, 1, 1},
  {&__pyx_n_s_OperationError___init, __pyx_k_OperationError___init, sizeof(__pyx_k_OperationError___init), 0, 0, 1, 1},
  {&__pyx_n_s_OperationError___str, __pyx_k_OperationError___str, sizeof(__pyx_k_OperationError___str), 0, 0, 1, 1},
  {&__pyx_n_s_PARAMF_GLOBAL, __pyx_k_PARAMF_GLOBAL, sizeof(__pyx_k_PARAMF_GLOBAL), 0, 0, 1, 1},
  {&__pyx_n_s_PARAMF_LOCAL, __pyx_k_PARAMF_LOCAL, sizeof(__pyx_k_PARAMF_LOCAL), 0, 0, 1, 1},
  {&__pyx_n_s_PARAMF_SELF, __pyx_k_PARAMF_SELF, sizeof(__pyx_k_PARAMF_SELF), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_AUDIBLE_ALERTS, __pyx_k_PARAM_AUDIBLE_ALERTS, sizeof(__pyx_k_PARAM_AUDIBLE_ALERTS), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_BOUND_COMMAND_KEYCODES, __pyx_k_PARAM_BOUND_COMMAND_KEYCODES, sizeof(__pyx_k_PARAM_BOUND_COMMAND_KEYCODES), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_CLIENT_PRIORITY, __pyx_k_PARAM_CLIENT_PRIORITY, sizeof(__pyx_k_PARAM_CLIENT_PRIORITY), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_CLIPBOARD_CONTENT, __pyx_k_PARAM_CLIPBOARD_CONTENT, sizeof(__pyx_k_PARAM_CLIPBOARD_CONTENT), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_COMMAND_KEYCODE_NAME, __pyx_k_PARAM_COMMAND_KEYCODE_NAME, sizeof(__pyx_k_PARAM_COMMAND_KEYCODE_NAME), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_COMMAND_KEYCODE_SUMMARY, __pyx_k_PARAM_COMMAND_KEYCODE_SUMMARY, sizeof(__pyx_k_PARAM_COMMAND_KEYCODE_SUMMARY), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_COMPUTER_BRAILLE_CELL_SIZE, __pyx_k_PARAM_COMPUTER_BRAILLE_CELL_SIZE, sizeof(__pyx_k_PARAM_COMPUTER_BRAILLE_CELL_SIZE), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_COMPUTER_BRAILLE_ROWS_MASK, __pyx_k_PARAM_COMPUTER_BRAILLE_ROWS_MASK, sizeof(__pyx_k_PARAM_COMPUTER_BRAILLE_ROWS_MASK), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_COMPUTER_BRAILLE_ROW_CELLS, __pyx_k_PARAM_COMPUTER_BRAILLE_ROW_CELLS, sizeof(__pyx_k_PARAM_COMPUTER_BRAILLE_ROW_CELLS), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_COMPUTER_BRAILLE_TABLE, __pyx_k_PARAM_COMPUTER_BRAILLE_TABLE, sizeof(__pyx_k_PARAM_COMPUTER_BRAILLE_TABLE), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_COUNT, __pyx_k_PARAM_COUNT, sizeof(__pyx_k_PARAM_COUNT), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_CURSOR_BLINK_PERCENTAGE, __pyx_k_PARAM_CURSOR_BLINK_PERCENTAGE, sizeof(__pyx_k_PARAM_CURSOR_BLINK_PERCENTAGE), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_CURSOR_BLINK_PERIOD, __pyx_k_PARAM_CURSOR_BLINK_PERIOD, sizeof(__pyx_k_PARAM_CURSOR_BLINK_PERIOD), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_CURSOR_DOTS, __pyx_k_PARAM_CURSOR_DOTS, sizeof(__pyx_k_PARAM_CURSOR_DOTS), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_DEFINED_DRIVER_KEYCODES, __pyx_k_PARAM_DEFINED_DRIVER_KEYCODES, sizeof(__pyx_k_PARAM_DEFINED_DRIVER_KEYCODES), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_DEVICE_CELL_SIZE, __pyx_k_PARAM_DEVICE_CELL_SIZE, sizeof(__pyx_k_PARAM_DEVICE_CELL_SIZE), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_DEVICE_IDENTIFIER, __pyx_k_PARAM_DEVICE_IDENTIFIER, sizeof(__pyx_k_PARAM_DEVICE_IDENTIFIER), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_DEVICE_MODEL, __pyx_k_PARAM_DEVICE_MODEL, sizeof(__pyx_k_PARAM_DEVICE_MODEL), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_DEVICE_ONLINE, __pyx_k_PARAM_DEVICE_ONLINE, sizeof(__pyx_k_PARAM_DEVICE_ONLINE), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_DEVICE_SPEED, __pyx_k_PARAM_DEVICE_SPEED, sizeof(__pyx_k_PARAM_DEVICE_SPEED), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_DISPLAY_SIZE, __pyx_k_PARAM_DISPLAY_SIZE, sizeof(__pyx_k_PARAM_DISPLAY_SIZE), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_DRIVER_CODE, __pyx_k_PARAM_DRIVER_CODE, sizeof(__pyx_k_PARAM_DRIVER_CODE), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_DRIVER_KEYCODE_NAME, __pyx_k_PARAM_DRIVER_KEYCODE_NAME, sizeof(__pyx_k_PARAM_DRIVER_KEYCODE_NAME), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_DRIVER_KEYCODE_SUMMARY, __pyx_k_PARAM_DRIVER_KEYCODE_SUMMARY, sizeof(__pyx_k_PARAM_DRIVER_KEYCODE_SUMMARY), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_DRIVER_NAME, __pyx_k_PARAM_DRIVER_NAME, sizeof(__pyx_k_PARAM_DRIVER_NAME), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_DRIVER_VERSION, __pyx_k_PARAM_DRIVER_VERSION, sizeof(__pyx_k_PARAM_DRIVER_VERSION), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_LITERARY_BRAILLE, __pyx_k_PARAM_LITERARY_BRAILLE, sizeof(__pyx_k_PARAM_LITERARY_BRAILLE), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_LITERARY_BRAILLE_TABLE, __pyx_k_PARAM_LITERARY_BRAILLE_TABLE, sizeof(__pyx_k_PARAM_LITERARY_BRAILLE_TABLE), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_MESSAGE_LOCALE, __pyx_k_PARAM_MESSAGE_LOCALE, sizeof(__pyx_k_PARAM_MESSAGE_LOCALE), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_RENDERED_CELLS, __pyx_k_PARAM_RENDERED_CELLS, sizeof(__pyx_k_PARAM_RENDERED_CELLS), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_RETAIN_DOTS, __pyx_k_PARAM_RETAIN_DOTS, sizeof(__pyx_k_PARAM_RETAIN_DOTS), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_SERVER_VERSION, __pyx_k_PARAM_SERVER_VERSION, sizeof(__pyx_k_PARAM_SERVER_VERSION), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_SKIP_IDENTICAL_LINES, __pyx_k_PARAM_SKIP_IDENTICAL_LINES, sizeof(__pyx_k_PARAM_SKIP_IDENTICAL_LINES), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_TYPE_BOOLEAN, __pyx_k_PARAM_TYPE_BOOLEAN, sizeof(__pyx_k_PARAM_TYPE_BOOLEAN), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_TYPE_KEYCODE, __pyx_k_PARAM_TYPE_KEYCODE, sizeof(__pyx_k_PARAM_TYPE_KEYCODE), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_TYPE_STRING, __pyx_k_PARAM_TYPE_STRING, sizeof(__pyx_k_PARAM_TYPE_STRING), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_TYPE_UINT16, __pyx_k_PARAM_TYPE_UINT16, sizeof(__pyx_k_PARAM_TYPE_UINT16), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_TYPE_UINT32, __pyx_k_PARAM_TYPE_UINT32, sizeof(__pyx_k_PARAM_TYPE_UINT32), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_TYPE_UINT64, __pyx_k_PARAM_TYPE_UINT64, sizeof(__pyx_k_PARAM_TYPE_UINT64), 0, 0, 1, 1},
  {&__pyx_n_s_PARAM_TYPE_UINT8, __pyx_k_PARAM_TYPE_UINT8, sizeof(__pyx_k_PARAM_TYPE_UINT8), 0, 0, 1, 1},
  {&__pyx_kp_s_Pickling_of_struct_members_such, __pyx_k_Pickling_of_struct_members_such, sizeof(__pyx_k_Pickling_of_struct_members_such), 0, 0, 1, 0},
  {&__pyx_kp_u_String_value_expected, __pyx_k_String_value_expected, sizeof(__pyx_k_String_value_expected), 0, 1, 0, 0},
  {&__pyx_n_s_TTY_DEFAULT, __pyx_k_TTY_DEFAULT, sizeof(__pyx_k_TTY_DEFAULT), 0, 0, 1, 1},
  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  {&__pyx_kp_b_UTF_8, __pyx_k_UTF_8, sizeof(__pyx_k_UTF_8), 0, 0, 0, 0},
  {&__pyx_kp_u_UTF_8, __pyx_k_UTF_8, sizeof(__pyx_k_UTF_8), 0, 1, 0, 0},
  {&__pyx_kp_u_Unsupported_parameter_type, __pyx_k_Unsupported_parameter_type, sizeof(__pyx_k_Unsupported_parameter_type), 0, 1, 0, 0},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_n_s_WriteStruct, __pyx_k_WriteStruct, sizeof(__pyx_k_WriteStruct), 0, 0, 1, 1},
  {&__pyx_kp_b__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 0, 0, 0},
  {&__pyx_kp_b__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 0, 0},
  {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0},
  {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0},
  {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0},
  {&__pyx_n_s_andMask, __pyx_k_andMask, sizeof(__pyx_k_andMask), 0, 0, 1, 1},
  {&__pyx_n_u_argument, __pyx_k_argument, sizeof(__pyx_k_argument), 0, 1, 0, 1},
  {&__pyx_n_s_attrAnd, __pyx_k_attrAnd, sizeof(__pyx_k_attrAnd), 0, 0, 1, 1},
  {&__pyx_n_s_attrOr, __pyx_k_attrOr, sizeof(__pyx_k_attrOr), 0, 0, 1, 1},
  {&__pyx_n_s_auth, __pyx_k_auth, sizeof(__pyx_k_auth), 0, 0, 1, 1},
  {&__pyx_n_s_brlapi, __pyx_k_brlapi, sizeof(__pyx_k_brlapi), 0, 0, 1, 1},
  {&__pyx_kp_s_brlapi_pyx, __pyx_k_brlapi_pyx, sizeof(__pyx_k_brlapi_pyx), 0, 0, 1, 0},
  {&__pyx_n_s_brlerrno, __pyx_k_brlerrno, sizeof(__pyx_k_brlerrno), 0, 0, 1, 1},
  {&__pyx_kp_u_brlerrno_2, __pyx_k_brlerrno_2, sizeof(__pyx_k_brlerrno_2), 0, 1, 0, 0},
  {&__pyx_n_s_buf, __pyx_k_buf, sizeof(__pyx_k_buf), 0, 0, 1, 1},
  {&__pyx_n_s_callbackData, __pyx_k_callbackData, sizeof(__pyx_k_callbackData), 0, 0, 1, 1},
  {&__pyx_n_s_center, __pyx_k_center, sizeof(__pyx_k_center), 0, 0, 1, 1},
  {&__pyx_n_s_cfunc, __pyx_k_cfunc, sizeof(__pyx_k_cfunc), 0, 0, 1, 1},
  {&__pyx_n_s_charset, __pyx_k_charset, sizeof(__pyx_k_charset), 0, 0, 1, 1},
  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_code, __pyx_k_code, sizeof(__pyx_k_code), 0, 0, 1, 1},
  {&__pyx_n_u_command, __pyx_k_command, sizeof(__pyx_k_command), 0, 1, 0, 1},
  {&__pyx_kp_u_couldn_t_connect_to, __pyx_k_couldn_t_connect_to, sizeof(__pyx_k_couldn_t_connect_to), 0, 1, 0, 0},
  {&__pyx_n_s_cursor, __pyx_k_cursor, sizeof(__pyx_k_cursor), 0, 0, 1, 1},
  {&__pyx_n_u_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 1, 0, 1},
  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
  {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
  {&__pyx_n_s_describeKeyCode, __pyx_k_describeKeyCode, sizeof(__pyx_k_describeKeyCode), 0, 0, 1, 1},
  {&__pyx_n_s_displayNumber, __pyx_k_displayNumber, sizeof(__pyx_k_displayNumber), 0, 0, 1, 1},
  {&__pyx_n_s_displaySize, __pyx_k_displaySize, sizeof(__pyx_k_displaySize), 0, 0, 1, 1},
  {&__pyx_n_s_dkc, __pyx_k_dkc, sizeof(__pyx_k_dkc), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_driver, __pyx_k_driver, sizeof(__pyx_k_driver), 0, 0, 1, 1},
  {&__pyx_n_s_ekc, __pyx_k_ekc, sizeof(__pyx_k_ekc), 0, 0, 1, 1},
  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
  {&__pyx_n_s_errfun, __pyx_k_errfun, sizeof(__pyx_k_errfun), 0, 0, 1, 1},
  {&__pyx_n_s_errno, __pyx_k_errno, sizeof(__pyx_k_errno), 0, 0, 1, 1},
  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
  {&__pyx_n_s_errors, __pyx_k_errors, sizeof(__pyx_k_errors), 0, 0, 1, 1},
  {&__pyx_n_s_exception, __pyx_k_exception, sizeof(__pyx_k_exception), 0, 0, 1, 1},
  {&__pyx_n_s_expandKeyCode, __pyx_k_expandKeyCode, sizeof(__pyx_k_expandKeyCode), 0, 0, 1, 1},
  {&__pyx_n_s_flag, __pyx_k_flag, sizeof(__pyx_k_flag), 0, 0, 1, 1},
  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
  {&__pyx_n_u_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 1, 0, 1},
  {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1},
  {&__pyx_n_s_gaierrno, __pyx_k_gaierrno, sizeof(__pyx_k_gaierrno), 0, 0, 1, 1},
  {&__pyx_kp_u_gaierrno_2, __pyx_k_gaierrno_2, sizeof(__pyx_k_gaierrno_2), 0, 1, 0, 0},
  {&__pyx_n_s_getLibraryVersion, __pyx_k_getLibraryVersion, sizeof(__pyx_k_getLibraryVersion), 0, 0, 1, 1},
  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
  {&__pyx_n_s_host, __pyx_k_host, sizeof(__pyx_k_host), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_s_key_type, __pyx_k_key_type, sizeof(__pyx_k_key_type), 0, 0, 1, 1},
  {&__pyx_n_u_latin1, __pyx_k_latin1, sizeof(__pyx_k_latin1), 0, 1, 0, 1},
  {&__pyx_n_s_libcerrno, __pyx_k_libcerrno, sizeof(__pyx_k_libcerrno), 0, 0, 1, 1},
  {&__pyx_kp_u_libcerrno_2, __pyx_k_libcerrno_2, sizeof(__pyx_k_libcerrno_2), 0, 1, 0, 0},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_major, __pyx_k_major, sizeof(__pyx_k_major), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_minor, __pyx_k_minor, sizeof(__pyx_k_minor), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_msg, __pyx_k_msg, sizeof(__pyx_k_msg), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_s_orMask, __pyx_k_orMask, sizeof(__pyx_k_orMask), 0, 0, 1, 1},
  {&__pyx_n_s_param, __pyx_k_param, sizeof(__pyx_k_param), 0, 0, 1, 1},
  {&__pyx_n_s_parameter, __pyx_k_parameter, sizeof(__pyx_k_parameter), 0, 0, 1, 1},
  {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_rangeType_all, __pyx_k_rangeType_all, sizeof(__pyx_k_rangeType_all), 0, 0, 1, 1},
  {&__pyx_n_s_rangeType_code, __pyx_k_rangeType_code, sizeof(__pyx_k_rangeType_code), 0, 0, 1, 1},
  {&__pyx_n_s_rangeType_command, __pyx_k_rangeType_command, sizeof(__pyx_k_rangeType_command), 0, 0, 1, 1},
  {&__pyx_n_s_rangeType_key, __pyx_k_rangeType_key, sizeof(__pyx_k_rangeType_key), 0, 0, 1, 1},
  {&__pyx_n_s_rangeType_type, __pyx_k_rangeType_type, sizeof(__pyx_k_rangeType_type), 0, 0, 1, 1},
  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
  {&__pyx_n_s_regionBegin, __pyx_k_regionBegin, sizeof(__pyx_k_regionBegin), 0, 0, 1, 1},
  {&__pyx_n_s_regionSize, __pyx_k_regionSize, sizeof(__pyx_k_regionSize), 0, 0, 1, 1},
  {&__pyx_n_u_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 1, 0, 1},
  {&__pyx_n_s_ret, __pyx_k_ret, sizeof(__pyx_k_ret), 0, 0, 1, 1},
  {&__pyx_n_s_retval, __pyx_k_retval, sizeof(__pyx_k_retval), 0, 0, 1, 1},
  {&__pyx_n_s_revision, __pyx_k_revision, sizeof(__pyx_k_revision), 0, 0, 1, 1},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_kp_s_self_h_cannot_be_converted_to_a, __pyx_k_self_h_cannot_be_converted_to_a, sizeof(__pyx_k_self_h_cannot_be_converted_to_a), 0, 0, 1, 0},
  {&__pyx_n_s_set, __pyx_k_set, sizeof(__pyx_k_set), 0, 0, 1, 1},
  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
  {&__pyx_n_s_settings, __pyx_k_settings, sizeof(__pyx_k_settings), 0, 0, 1, 1},
  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
  {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1},
  {&__pyx_n_s_str_2, __pyx_k_str_2, sizeof(__pyx_k_str_2), 0, 0, 1, 1},
  {&__pyx_n_s_subparam, __pyx_k_subparam, sizeof(__pyx_k_subparam), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1},
  {&__pyx_n_s_timeout_ms, __pyx_k_timeout_ms, sizeof(__pyx_k_timeout_ms), 0, 0, 1, 1},
  {&__pyx_n_s_tty, __pyx_k_tty, sizeof(__pyx_k_tty), 0, 0, 1, 1},
  {&__pyx_n_u_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 1, 0, 1},
  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  {&__pyx_n_s_wait, __pyx_k_wait, sizeof(__pyx_k_wait), 0, 0, 1, 1},
  {&__pyx_n_s_watchParameter_locals_cfunc, __pyx_k_watchParameter_locals_cfunc, sizeof(__pyx_k_watchParameter_locals_cfunc), 0, 0, 1, 1},
  {&__pyx_kp_u_with_key, __pyx_k_with_key, sizeof(__pyx_k_with_key), 0, 1, 0, 0},
  {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
  {&__pyx_n_s_writeArguments, __pyx_k_writeArguments, sizeof(__pyx_k_writeArguments), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 162, __pyx_L1_error)
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 216, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __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);

  /* "brlapi.pyx":216
 * 			ret = values64[0]
 * 	else:
 * 		raise ValueError("Unsupported parameter type")             # <<<<<<<<<<<<<<
 * 
 * 	return ret
 */
  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_Unsupported_parameter_type); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "brlapi.pyx":252
 * 		buf = <char*>c_brlapi.malloc(size+1)
 * 		c_brlapi.brlapi_strerror_r(&error, buf, size+1)
 * 		ret = buf.decode("ASCII", errors="replace")             # <<<<<<<<<<<<<<
 * 		c_brlapi.free(buf)
 * 		return ret
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_u_ASCII); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("Pickling of struct members such as self.props must be explicitly requested with @auto_pickle(True)")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("Pickling of struct members such as self.props must be explicitly requested with @auto_pickle(True)")
 */
  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Pickling_of_struct_members_such); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "(tree fragment)":4
 *     raise TypeError("Pickling of struct members such as self.props must be explicitly requested with @auto_pickle(True)")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("Pickling of struct members such as self.props must be explicitly requested with @auto_pickle(True)")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Pickling_of_struct_members_such); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "brlapi.pyx":965
 * 		if props.type == PARAM_TYPE_STRING:
 * 			if type(value) != unicode and type(value) != str:
 * 				raise ValueError("String value expected")             # <<<<<<<<<<<<<<
 * 
 * 		if props.type == PARAM_TYPE_BOOLEAN:
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_String_value_expected); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "brlapi.pyx":970
 * 			if props.isArray:
 * 				if type(value[0]) != bool:
 * 					raise ValueError("Boolean values expected")             # <<<<<<<<<<<<<<
 * 			else:
 * 				if type(value) != bool:
 */
  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_Boolean_values_expected); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "brlapi.pyx":973
 * 			else:
 * 				if type(value) != bool:
 * 					raise ValueError("Boolean value expected")             # <<<<<<<<<<<<<<
 * 
 * 		if props.type == PARAM_TYPE_UINT8 or \
 */
  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_Boolean_value_expected); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "brlapi.pyx":980
 * 			if props.isArray:
 * 				if type(value[0]) != int:
 * 					raise ValueError("Integer values expected")             # <<<<<<<<<<<<<<
 * 			else:
 * 				if type(value) != int:
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_Integer_values_expected); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "brlapi.pyx":983
 * 			else:
 * 				if type(value) != int:
 * 					raise ValueError("Integer value expected")             # <<<<<<<<<<<<<<
 * 
 * 		if props.type == PARAM_TYPE_STRING:
 */
  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_Integer_value_expected); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "brlapi.pyx":1068
 * 		c_flags = flags
 * 
 * 		def cfunc(param):             # <<<<<<<<<<<<<<
 * 			cdef c_brlapi.brlapi_python_callbackData_t *callbackData
 * 			callbackData = <c_brlapi.brlapi_python_callbackData_t*> <uintptr_t> param
 */
  __pyx_tuple__17 = PyTuple_Pack(6, __pyx_n_s_param, __pyx_n_s_callbackData, __pyx_n_s_parameter, __pyx_n_s_subparam, __pyx_n_s_flags, __pyx_n_s_data); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 1068, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);
  __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 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_brlapi_pyx, __pyx_n_s_cfunc, 1068, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 1068, __pyx_L1_error)

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.h cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.h cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_self_h_cannot_be_converted_to_a); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "(tree fragment)":4
 *     raise TypeError("self.h cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.h cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_self_h_cannot_be_converted_to_a); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "brlapi.pyx":126
 * include "constants.auto.pyx"
 * 
 * def getLibraryVersion():             # <<<<<<<<<<<<<<
 * 	"""Get the BrlAPI version as a three-element list (major, minor, revision).
 * 	See brlapi_getLibraryVersion(3)."""
 */
  __pyx_tuple__21 = PyTuple_Pack(3, __pyx_n_s_major, __pyx_n_s_minor, __pyx_n_s_revision); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);
  __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_brlapi_pyx, __pyx_n_s_getLibraryVersion, 126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 126, __pyx_L1_error)

  /* "brlapi.pyx":136
 * 	return (major, minor, revision)
 * 
 * def expandKeyCode(code):             # <<<<<<<<<<<<<<
 * 	"""Expand a keycode into its individual components.
 * 	See brlapi_expandKeyCode(3)."""
 */
  __pyx_tuple__23 = PyTuple_Pack(3, __pyx_n_s_code, __pyx_n_s_ekc, __pyx_n_s_retval); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);
  __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 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_brlapi_pyx, __pyx_n_s_expandKeyCode, 136, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 136, __pyx_L1_error)

  /* "brlapi.pyx":152
 * 		}
 * 
 * def describeKeyCode(code):             # <<<<<<<<<<<<<<
 * 	"""Describe the individual components of a keycode symbolically.
 * 	See brlapi_describeKeyCode(3)."""
 */
  __pyx_tuple__25 = PyTuple_Pack(5, __pyx_n_s_code, __pyx_n_s_dkc, __pyx_n_s_retval, __pyx_n_s_flags, __pyx_n_s_flag); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);
  __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_brlapi_pyx, __pyx_n_s_describeKeyCode, 152, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 152, __pyx_L1_error)

  /* "brlapi.pyx":222
 * class OperationError(Exception):
 * 	"""Error while performing some operation"""
 * 	def __init__(self):             # <<<<<<<<<<<<<<
 * 		cdef char *exception
 * 		exception = c_brlapi.brlapi_protocolException()
 */
  __pyx_tuple__27 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_exception); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 222, __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_brlapi_pyx, __pyx_n_s_init, 222, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 222, __pyx_L1_error)

  /* "brlapi.pyx":238
 * 				self.errfun = b""
 * 
 * 	def __str__(self):             # <<<<<<<<<<<<<<
 * 		cdef c_brlapi.brlapi_error_t error
 * 		cdef c_brlapi.size_t size
 */
  __pyx_tuple__29 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_error, __pyx_n_s_size, __pyx_n_s_buf, __pyx_n_s_str_2, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);
  __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_brlapi_pyx, __pyx_n_s_str, 238, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 238, __pyx_L1_error)

  /* "brlapi.pyx":259
 * 	"""Error while connecting to BrlTTY"""
 * 
 * 	def __init__(self, host, auth):             # <<<<<<<<<<<<<<
 * 		OperationError.__init__(self)
 * 		self.host = host
 */
  __pyx_tuple__31 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_host, __pyx_n_s_auth); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);
  __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_brlapi_pyx, __pyx_n_s_init, 259, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 259, __pyx_L1_error)

  /* "brlapi.pyx":264
 * 		self.auth = auth
 * 
 * 	def __str__(self):             # <<<<<<<<<<<<<<
 * 		msg = "couldn't connect to %s with key %s: %s" % (self.host,self.auth,OperationError.__str__(self))
 * 		msg = msg + "\n(brlerrno %d, libcerrno %d, gaierrno %d)" % (self.brlerrno, self.libcerrno, self.gaierrno)
 */
  __pyx_tuple__33 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);
  __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_brlapi_pyx, __pyx_n_s_str, 264, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 264, __pyx_L1_error)

  /* "brlapi.pyx":275
 * 		return msg
 * 
 * 	def host(self):             # <<<<<<<<<<<<<<
 * 		"""Host of BRLTTY server"""
 * 		return self.settings.host
 */
  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);
  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 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_brlapi_pyx, __pyx_n_s_host, 275, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 275, __pyx_L1_error)

  /* "brlapi.pyx":279
 * 		return self.settings.host
 * 
 * 	def auth(self):             # <<<<<<<<<<<<<<
 * 		"""Authentication method used"""
 * 		return self.settings.auth
 */
  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);
  __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_brlapi_pyx, __pyx_n_s_auth, 279, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 279, __pyx_L1_error)
  __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_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_9 = PyInt_FromLong(9); if (unlikely(!__pyx_int_9)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_11 = PyInt_FromLong(11); if (unlikely(!__pyx_int_11)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_12 = PyInt_FromLong(12); if (unlikely(!__pyx_int_12)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_13 = PyInt_FromLong(13); if (unlikely(!__pyx_int_13)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_14 = PyInt_FromLong(14); if (unlikely(!__pyx_int_14)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_17 = PyInt_FromLong(17); if (unlikely(!__pyx_int_17)) __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_19 = PyInt_FromLong(19); if (unlikely(!__pyx_int_19)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_20 = PyInt_FromLong(20); if (unlikely(!__pyx_int_20)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_21 = PyInt_FromLong(21); if (unlikely(!__pyx_int_21)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_22 = PyInt_FromLong(22); if (unlikely(!__pyx_int_22)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_23 = PyInt_FromLong(23); if (unlikely(!__pyx_int_23)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_24 = PyInt_FromLong(24); if (unlikely(!__pyx_int_24)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_25 = PyInt_FromLong(25); if (unlikely(!__pyx_int_25)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_26 = PyInt_FromLong(26); if (unlikely(!__pyx_int_26)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_27 = PyInt_FromLong(27); if (unlikely(!__pyx_int_27)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_28 = PyInt_FromLong(28); if (unlikely(!__pyx_int_28)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_29 = PyInt_FromLong(29); if (unlikely(!__pyx_int_29)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_30 = PyInt_FromLong(30); if (unlikely(!__pyx_int_30)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_31 = PyInt_FromLong(31); if (unlikely(!__pyx_int_31)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_33 = PyInt_FromLong(33); if (unlikely(!__pyx_int_33)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_34 = PyInt_FromLong(34); if (unlikely(!__pyx_int_34)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_35 = PyInt_FromLong(35); if (unlikely(!__pyx_int_35)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_36 = PyInt_FromLong(36); if (unlikely(!__pyx_int_36)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_37 = PyInt_FromLong(37); if (unlikely(!__pyx_int_37)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_38 = PyInt_FromLong(38); if (unlikely(!__pyx_int_38)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_39 = PyInt_FromLong(39); if (unlikely(!__pyx_int_39)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_40 = PyInt_FromLong(40); if (unlikely(!__pyx_int_40)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_41 = PyInt_FromLong(41); if (unlikely(!__pyx_int_41)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_42 = PyInt_FromLong(42); if (unlikely(!__pyx_int_42)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_43 = PyInt_FromLong(43); if (unlikely(!__pyx_int_43)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_44 = PyInt_FromLong(44); if (unlikely(!__pyx_int_44)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_45 = PyInt_FromLong(45); if (unlikely(!__pyx_int_45)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_46 = PyInt_FromLong(46); if (unlikely(!__pyx_int_46)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_47 = PyInt_FromLong(47); if (unlikely(!__pyx_int_47)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_48 = PyInt_FromLong(48); if (unlikely(!__pyx_int_48)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_49 = PyInt_FromLong(49); if (unlikely(!__pyx_int_49)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_50 = PyInt_FromLong(50); if (unlikely(!__pyx_int_50)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_51 = PyInt_FromLong(51); if (unlikely(!__pyx_int_51)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_52 = PyInt_FromLong(52); if (unlikely(!__pyx_int_52)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_53 = PyInt_FromLong(53); if (unlikely(!__pyx_int_53)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_54 = PyInt_FromLong(54); if (unlikely(!__pyx_int_54)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_55 = PyInt_FromLong(55); if (unlikely(!__pyx_int_55)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_56 = PyInt_FromLong(56); if (unlikely(!__pyx_int_56)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_57 = PyInt_FromLong(57); if (unlikely(!__pyx_int_57)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_58 = PyInt_FromLong(58); if (unlikely(!__pyx_int_58)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_59 = PyInt_FromLong(59); if (unlikely(!__pyx_int_59)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_60 = PyInt_FromLong(60); if (unlikely(!__pyx_int_60)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_61 = PyInt_FromLong(61); if (unlikely(!__pyx_int_61)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_62 = PyInt_FromLong(62); if (unlikely(!__pyx_int_62)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_63 = PyInt_FromLong(63); if (unlikely(!__pyx_int_63)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_64 = PyInt_FromLong(64); if (unlikely(!__pyx_int_64)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65 = PyInt_FromLong(65); if (unlikely(!__pyx_int_65)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_66 = PyInt_FromLong(66); if (unlikely(!__pyx_int_66)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_67 = PyInt_FromLong(67); if (unlikely(!__pyx_int_67)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_68 = PyInt_FromLong(68); if (unlikely(!__pyx_int_68)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_69 = PyInt_FromLong(69); if (unlikely(!__pyx_int_69)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_70 = PyInt_FromLong(70); if (unlikely(!__pyx_int_70)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_71 = PyInt_FromLong(71); if (unlikely(!__pyx_int_71)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_72 = PyInt_FromLong(72); if (unlikely(!__pyx_int_72)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_73 = PyInt_FromLong(73); if (unlikely(!__pyx_int_73)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_74 = PyInt_FromLong(74); if (unlikely(!__pyx_int_74)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_75 = PyInt_FromLong(75); if (unlikely(!__pyx_int_75)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_76 = PyInt_FromLong(76); if (unlikely(!__pyx_int_76)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_77 = PyInt_FromLong(77); if (unlikely(!__pyx_int_77)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_78 = PyInt_FromLong(78); if (unlikely(!__pyx_int_78)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_79 = PyInt_FromLong(79); if (unlikely(!__pyx_int_79)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_80 = PyInt_FromLong(80); if (unlikely(!__pyx_int_80)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_81 = PyInt_FromLong(81); if (unlikely(!__pyx_int_81)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_82 = PyInt_FromLong(82); if (unlikely(!__pyx_int_82)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_83 = PyInt_FromLong(83); if (unlikely(!__pyx_int_83)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_84 = PyInt_FromLong(84); if (unlikely(!__pyx_int_84)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_85 = PyInt_FromLong(85); if (unlikely(!__pyx_int_85)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_86 = PyInt_FromLong(86); if (unlikely(!__pyx_int_86)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_87 = PyInt_FromLong(87); if (unlikely(!__pyx_int_87)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_88 = PyInt_FromLong(88); if (unlikely(!__pyx_int_88)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_89 = PyInt_FromLong(89); if (unlikely(!__pyx_int_89)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_90 = PyInt_FromLong(90); if (unlikely(!__pyx_int_90)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_91 = PyInt_FromLong(91); if (unlikely(!__pyx_int_91)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_92 = PyInt_FromLong(92); if (unlikely(!__pyx_int_92)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_93 = PyInt_FromLong(93); if (unlikely(!__pyx_int_93)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_94 = PyInt_FromLong(94); if (unlikely(!__pyx_int_94)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_95 = PyInt_FromLong(95); if (unlikely(!__pyx_int_95)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_96 = PyInt_FromLong(96); if (unlikely(!__pyx_int_96)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_97 = PyInt_FromLong(97); if (unlikely(!__pyx_int_97)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_98 = PyInt_FromLong(98); if (unlikely(!__pyx_int_98)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_99 = PyInt_FromLong(99); if (unlikely(!__pyx_int_99)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_101 = PyInt_FromLong(101); if (unlikely(!__pyx_int_101)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_102 = PyInt_FromLong(102); if (unlikely(!__pyx_int_102)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_103 = PyInt_FromLong(103); if (unlikely(!__pyx_int_103)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_104 = PyInt_FromLong(104); if (unlikely(!__pyx_int_104)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_105 = PyInt_FromLong(105); if (unlikely(!__pyx_int_105)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_106 = PyInt_FromLong(106); if (unlikely(!__pyx_int_106)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_107 = PyInt_FromLong(107); if (unlikely(!__pyx_int_107)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_108 = PyInt_FromLong(108); if (unlikely(!__pyx_int_108)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_109 = PyInt_FromLong(109); if (unlikely(!__pyx_int_109)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_110 = PyInt_FromLong(110); if (unlikely(!__pyx_int_110)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_111 = PyInt_FromLong(111); if (unlikely(!__pyx_int_111)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_112 = PyInt_FromLong(112); if (unlikely(!__pyx_int_112)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_113 = PyInt_FromLong(113); if (unlikely(!__pyx_int_113)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_114 = PyInt_FromLong(114); if (unlikely(!__pyx_int_114)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_115 = PyInt_FromLong(115); if (unlikely(!__pyx_int_115)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_116 = PyInt_FromLong(116); if (unlikely(!__pyx_int_116)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_117 = PyInt_FromLong(117); if (unlikely(!__pyx_int_117)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_118 = PyInt_FromLong(118); if (unlikely(!__pyx_int_118)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_119 = PyInt_FromLong(119); if (unlikely(!__pyx_int_119)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_120 = PyInt_FromLong(120); if (unlikely(!__pyx_int_120)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_121 = PyInt_FromLong(121); if (unlikely(!__pyx_int_121)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_122 = PyInt_FromLong(122); if (unlikely(!__pyx_int_122)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_123 = PyInt_FromLong(123); if (unlikely(!__pyx_int_123)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_124 = PyInt_FromLong(124); if (unlikely(!__pyx_int_124)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_125 = PyInt_FromLong(125); if (unlikely(!__pyx_int_125)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_126 = PyInt_FromLong(126); if (unlikely(!__pyx_int_126)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_127 = PyInt_FromLong(127); if (unlikely(!__pyx_int_127)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_128 = PyInt_FromLong(128); if (unlikely(!__pyx_int_128)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_129 = PyInt_FromLong(129); if (unlikely(!__pyx_int_129)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_130 = PyInt_FromLong(130); if (unlikely(!__pyx_int_130)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_131 = PyInt_FromLong(131); if (unlikely(!__pyx_int_131)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_132 = PyInt_FromLong(132); if (unlikely(!__pyx_int_132)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_133 = PyInt_FromLong(133); if (unlikely(!__pyx_int_133)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_134 = PyInt_FromLong(134); if (unlikely(!__pyx_int_134)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_135 = PyInt_FromLong(135); if (unlikely(!__pyx_int_135)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_136 = PyInt_FromLong(136); if (unlikely(!__pyx_int_136)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_137 = PyInt_FromLong(137); if (unlikely(!__pyx_int_137)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_138 = PyInt_FromLong(138); if (unlikely(!__pyx_int_138)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_139 = PyInt_FromLong(139); if (unlikely(!__pyx_int_139)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_140 = PyInt_FromLong(140); if (unlikely(!__pyx_int_140)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_141 = PyInt_FromLong(141); if (unlikely(!__pyx_int_141)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_142 = PyInt_FromLong(142); if (unlikely(!__pyx_int_142)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_143 = PyInt_FromLong(143); if (unlikely(!__pyx_int_143)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_144 = PyInt_FromLong(144); if (unlikely(!__pyx_int_144)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_145 = PyInt_FromLong(145); if (unlikely(!__pyx_int_145)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_146 = PyInt_FromLong(146); if (unlikely(!__pyx_int_146)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_147 = PyInt_FromLong(147); if (unlikely(!__pyx_int_147)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_148 = PyInt_FromLong(148); if (unlikely(!__pyx_int_148)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_149 = PyInt_FromLong(149); if (unlikely(!__pyx_int_149)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_150 = PyInt_FromLong(150); if (unlikely(!__pyx_int_150)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_151 = PyInt_FromLong(151); if (unlikely(!__pyx_int_151)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_152 = PyInt_FromLong(152); if (unlikely(!__pyx_int_152)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_153 = PyInt_FromLong(153); if (unlikely(!__pyx_int_153)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_154 = PyInt_FromLong(154); if (unlikely(!__pyx_int_154)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_256 = PyInt_FromLong(256); if (unlikely(!__pyx_int_256)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_512 = PyInt_FromLong(512); if (unlikely(!__pyx_int_512)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1024 = PyInt_FromLong(1024); if (unlikely(!__pyx_int_1024)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_2048 = PyInt_FromLong(2048); if (unlikely(!__pyx_int_2048)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_4096 = PyInt_FromLong(4096); if (unlikely(!__pyx_int_4096)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_8192 = PyInt_FromLong(8192); if (unlikely(!__pyx_int_8192)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_16384 = PyInt_FromLong(16384L); if (unlikely(!__pyx_int_16384)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65288 = PyInt_FromLong(65288L); if (unlikely(!__pyx_int_65288)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65289 = PyInt_FromLong(65289L); if (unlikely(!__pyx_int_65289)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65293 = PyInt_FromLong(65293L); if (unlikely(!__pyx_int_65293)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65307 = PyInt_FromLong(65307L); if (unlikely(!__pyx_int_65307)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65360 = PyInt_FromLong(65360L); if (unlikely(!__pyx_int_65360)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65361 = PyInt_FromLong(65361L); if (unlikely(!__pyx_int_65361)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65362 = PyInt_FromLong(65362L); if (unlikely(!__pyx_int_65362)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65363 = PyInt_FromLong(65363L); if (unlikely(!__pyx_int_65363)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65364 = PyInt_FromLong(65364L); if (unlikely(!__pyx_int_65364)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65365 = PyInt_FromLong(65365L); if (unlikely(!__pyx_int_65365)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65366 = PyInt_FromLong(65366L); if (unlikely(!__pyx_int_65366)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65367 = PyInt_FromLong(65367L); if (unlikely(!__pyx_int_65367)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65379 = PyInt_FromLong(65379L); if (unlikely(!__pyx_int_65379)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65470 = PyInt_FromLong(65470L); if (unlikely(!__pyx_int_65470)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65471 = PyInt_FromLong(65471L); if (unlikely(!__pyx_int_65471)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65472 = PyInt_FromLong(65472L); if (unlikely(!__pyx_int_65472)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65473 = PyInt_FromLong(65473L); if (unlikely(!__pyx_int_65473)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65474 = PyInt_FromLong(65474L); if (unlikely(!__pyx_int_65474)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65475 = PyInt_FromLong(65475L); if (unlikely(!__pyx_int_65475)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65476 = PyInt_FromLong(65476L); if (unlikely(!__pyx_int_65476)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65477 = PyInt_FromLong(65477L); if (unlikely(!__pyx_int_65477)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65478 = PyInt_FromLong(65478L); if (unlikely(!__pyx_int_65478)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65479 = PyInt_FromLong(65479L); if (unlikely(!__pyx_int_65479)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65480 = PyInt_FromLong(65480L); if (unlikely(!__pyx_int_65480)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65481 = PyInt_FromLong(65481L); if (unlikely(!__pyx_int_65481)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65482 = PyInt_FromLong(65482L); if (unlikely(!__pyx_int_65482)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65483 = PyInt_FromLong(65483L); if (unlikely(!__pyx_int_65483)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65484 = PyInt_FromLong(65484L); if (unlikely(!__pyx_int_65484)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65485 = PyInt_FromLong(65485L); if (unlikely(!__pyx_int_65485)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65486 = PyInt_FromLong(65486L); if (unlikely(!__pyx_int_65486)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65487 = PyInt_FromLong(65487L); if (unlikely(!__pyx_int_65487)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65488 = PyInt_FromLong(65488L); if (unlikely(!__pyx_int_65488)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65489 = PyInt_FromLong(65489L); if (unlikely(!__pyx_int_65489)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65490 = PyInt_FromLong(65490L); if (unlikely(!__pyx_int_65490)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65491 = PyInt_FromLong(65491L); if (unlikely(!__pyx_int_65491)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65492 = PyInt_FromLong(65492L); if (unlikely(!__pyx_int_65492)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65493 = PyInt_FromLong(65493L); if (unlikely(!__pyx_int_65493)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65494 = PyInt_FromLong(65494L); if (unlikely(!__pyx_int_65494)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65495 = PyInt_FromLong(65495L); if (unlikely(!__pyx_int_65495)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65496 = PyInt_FromLong(65496L); if (unlikely(!__pyx_int_65496)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65497 = PyInt_FromLong(65497L); if (unlikely(!__pyx_int_65497)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65498 = PyInt_FromLong(65498L); if (unlikely(!__pyx_int_65498)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65499 = PyInt_FromLong(65499L); if (unlikely(!__pyx_int_65499)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65500 = PyInt_FromLong(65500L); if (unlikely(!__pyx_int_65500)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65501 = PyInt_FromLong(65501L); if (unlikely(!__pyx_int_65501)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65502 = PyInt_FromLong(65502L); if (unlikely(!__pyx_int_65502)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65503 = PyInt_FromLong(65503L); if (unlikely(!__pyx_int_65503)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65504 = PyInt_FromLong(65504L); if (unlikely(!__pyx_int_65504)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65535 = PyInt_FromLong(65535L); if (unlikely(!__pyx_int_65535)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_16777216 = PyInt_FromLong(16777216L); if (unlikely(!__pyx_int_16777216)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_536870912 = PyInt_FromLong(536870912L); if (unlikely(!__pyx_int_536870912)) __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)
  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_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_6brlapi_WriteStruct) < 0) __PYX_ERR(0, 283, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6brlapi_WriteStruct.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6brlapi_WriteStruct.tp_dictoffset && __pyx_type_6brlapi_WriteStruct.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6brlapi_WriteStruct.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_WriteStruct, (PyObject *)&__pyx_type_6brlapi_WriteStruct) < 0) __PYX_ERR(0, 283, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6brlapi_WriteStruct) < 0) __PYX_ERR(0, 283, __pyx_L1_error)
  __pyx_ptype_6brlapi_WriteStruct = &__pyx_type_6brlapi_WriteStruct;
  if (PyType_Ready(&__pyx_type_6brlapi_Connection) < 0) __PYX_ERR(0, 421, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6brlapi_Connection.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6brlapi_Connection.tp_dictoffset && __pyx_type_6brlapi_Connection.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6brlapi_Connection.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_6brlapi_Connection, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 421, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_6brlapi_10Connection___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_6brlapi_10Connection___init__.doc = __pyx_doc_6brlapi_10Connection___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6brlapi_10Connection___init__;
    }
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Connection, (PyObject *)&__pyx_type_6brlapi_Connection) < 0) __PYX_ERR(0, 421, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6brlapi_Connection) < 0) __PYX_ERR(0, 421, __pyx_L1_error)
  __pyx_ptype_6brlapi_Connection = &__pyx_type_6brlapi_Connection;
  if (PyType_Ready(&__pyx_type_6brlapi___pyx_scope_struct__watchParameter) < 0) __PYX_ERR(0, 1051, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6brlapi___pyx_scope_struct__watchParameter.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6brlapi___pyx_scope_struct__watchParameter.tp_dictoffset && __pyx_type_6brlapi___pyx_scope_struct__watchParameter.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6brlapi___pyx_scope_struct__watchParameter.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6brlapi___pyx_scope_struct__watchParameter = &__pyx_type_6brlapi___pyx_scope_struct__watchParameter;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", 
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_variable_import_code(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 initbrlapi(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC initbrlapi(void)
#else
__Pyx_PyMODINIT_FUNC PyInit_brlapi(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_brlapi(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_brlapi(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;
  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 'brlapi' 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_brlapi(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(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  PyEval_InitThreads();
  #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("brlapi", __pyx_methods, __pyx_k_This_module_implements_a_set_of, 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_brlapi) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __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, "brlapi")) {
      if (unlikely(PyDict_SetItemString(modules, "brlapi", __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)
  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  (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

  /* "brlapi.pyx":122
 * cimport c_brlapi
 * from libc.stdint cimport uint8_t, uint16_t, uint32_t, uint64_t, uintptr_t
 * import errno             # <<<<<<<<<<<<<<
 * 
 * include "constants.auto.pyx"
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_errno, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_errno, __pyx_t_1) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "constants.auto.pyx":1
 * TTY_DEFAULT = -1             # <<<<<<<<<<<<<<
 * DISPLAY_DEFAULT = -1
 * CURSOR_LEAVE = -1
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_TTY_DEFAULT, __pyx_int_neg_1) < 0) __PYX_ERR(3, 1, __pyx_L1_error)

  /* "constants.auto.pyx":2
 * TTY_DEFAULT = -1
 * DISPLAY_DEFAULT = -1             # <<<<<<<<<<<<<<
 * CURSOR_LEAVE = -1
 * CURSOR_OFF = 0
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DISPLAY_DEFAULT, __pyx_int_neg_1) < 0) __PYX_ERR(3, 2, __pyx_L1_error)

  /* "constants.auto.pyx":3
 * TTY_DEFAULT = -1
 * DISPLAY_DEFAULT = -1
 * CURSOR_LEAVE = -1             # <<<<<<<<<<<<<<
 * CURSOR_OFF = 0
 * rangeType_all = 0
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CURSOR_LEAVE, __pyx_int_neg_1) < 0) __PYX_ERR(3, 3, __pyx_L1_error)

  /* "constants.auto.pyx":4
 * DISPLAY_DEFAULT = -1
 * CURSOR_LEAVE = -1
 * CURSOR_OFF = 0             # <<<<<<<<<<<<<<
 * rangeType_all = 0
 * rangeType_type = 1
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CURSOR_OFF, __pyx_int_0) < 0) __PYX_ERR(3, 4, __pyx_L1_error)

  /* "constants.auto.pyx":5
 * CURSOR_LEAVE = -1
 * CURSOR_OFF = 0
 * rangeType_all = 0             # <<<<<<<<<<<<<<
 * rangeType_type = 1
 * rangeType_command = 2
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rangeType_all, __pyx_int_0) < 0) __PYX_ERR(3, 5, __pyx_L1_error)

  /* "constants.auto.pyx":6
 * CURSOR_OFF = 0
 * rangeType_all = 0
 * rangeType_type = 1             # <<<<<<<<<<<<<<
 * rangeType_command = 2
 * rangeType_key = 3
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rangeType_type, __pyx_int_1) < 0) __PYX_ERR(3, 6, __pyx_L1_error)

  /* "constants.auto.pyx":7
 * rangeType_all = 0
 * rangeType_type = 1
 * rangeType_command = 2             # <<<<<<<<<<<<<<
 * rangeType_key = 3
 * rangeType_code = 4
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rangeType_command, __pyx_int_2) < 0) __PYX_ERR(3, 7, __pyx_L1_error)

  /* "constants.auto.pyx":8
 * rangeType_type = 1
 * rangeType_command = 2
 * rangeType_key = 3             # <<<<<<<<<<<<<<
 * rangeType_code = 4
 * PARAMF_LOCAL = 0X00
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rangeType_key, __pyx_int_3) < 0) __PYX_ERR(3, 8, __pyx_L1_error)

  /* "constants.auto.pyx":9
 * rangeType_command = 2
 * rangeType_key = 3
 * rangeType_code = 4             # <<<<<<<<<<<<<<
 * PARAMF_LOCAL = 0X00
 * PARAMF_GLOBAL = 0X01
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rangeType_code, __pyx_int_4) < 0) __PYX_ERR(3, 9, __pyx_L1_error)

  /* "constants.auto.pyx":10
 * rangeType_key = 3
 * rangeType_code = 4
 * PARAMF_LOCAL = 0X00             # <<<<<<<<<<<<<<
 * PARAMF_GLOBAL = 0X01
 * PARAMF_SELF = 0X02
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAMF_LOCAL, __pyx_int_0) < 0) __PYX_ERR(3, 10, __pyx_L1_error)

  /* "constants.auto.pyx":11
 * rangeType_code = 4
 * PARAMF_LOCAL = 0X00
 * PARAMF_GLOBAL = 0X01             # <<<<<<<<<<<<<<
 * PARAMF_SELF = 0X02
 * ## Success
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAMF_GLOBAL, __pyx_int_1) < 0) __PYX_ERR(3, 11, __pyx_L1_error)

  /* "constants.auto.pyx":12
 * PARAMF_LOCAL = 0X00
 * PARAMF_GLOBAL = 0X01
 * PARAMF_SELF = 0X02             # <<<<<<<<<<<<<<
 * ## Success
 * ERROR_SUCCESS = 0
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAMF_SELF, __pyx_int_2) < 0) __PYX_ERR(3, 12, __pyx_L1_error)

  /* "constants.auto.pyx":14
 * PARAMF_SELF = 0X02
 * ## Success
 * ERROR_SUCCESS = 0             # <<<<<<<<<<<<<<
 * ## Not enough memory
 * ERROR_NOMEM = 1
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR_SUCCESS, __pyx_int_0) < 0) __PYX_ERR(3, 14, __pyx_L1_error)

  /* "constants.auto.pyx":16
 * ERROR_SUCCESS = 0
 * ## Not enough memory
 * ERROR_NOMEM = 1             # <<<<<<<<<<<<<<
 * ## A connection is already running in this tty
 * ERROR_TTYBUSY = 2
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR_NOMEM, __pyx_int_1) < 0) __PYX_ERR(3, 16, __pyx_L1_error)

  /* "constants.auto.pyx":18
 * ERROR_NOMEM = 1
 * ## A connection is already running in this tty
 * ERROR_TTYBUSY = 2             # <<<<<<<<<<<<<<
 * ## A connection is already using RAW or suspend mode
 * ERROR_DEVICEBUSY = 3
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR_TTYBUSY, __pyx_int_2) < 0) __PYX_ERR(3, 18, __pyx_L1_error)

  /* "constants.auto.pyx":20
 * ERROR_TTYBUSY = 2
 * ## A connection is already using RAW or suspend mode
 * ERROR_DEVICEBUSY = 3             # <<<<<<<<<<<<<<
 * ## Not implemented in protocol
 * ERROR_UNKNOWN_INSTRUCTION = 4
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR_DEVICEBUSY, __pyx_int_3) < 0) __PYX_ERR(3, 20, __pyx_L1_error)

  /* "constants.auto.pyx":22
 * ERROR_DEVICEBUSY = 3
 * ## Not implemented in protocol
 * ERROR_UNKNOWN_INSTRUCTION = 4             # <<<<<<<<<<<<<<
 * ## Forbiden in current mode
 * ERROR_ILLEGAL_INSTRUCTION = 5
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR_UNKNOWN_INSTRUCTION, __pyx_int_4) < 0) __PYX_ERR(3, 22, __pyx_L1_error)

  /* "constants.auto.pyx":24
 * ERROR_UNKNOWN_INSTRUCTION = 4
 * ## Forbiden in current mode
 * ERROR_ILLEGAL_INSTRUCTION = 5             # <<<<<<<<<<<<<<
 * ## Out of range or have no sense
 * ERROR_INVALID_PARAMETER = 6
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR_ILLEGAL_INSTRUCTION, __pyx_int_5) < 0) __PYX_ERR(3, 24, __pyx_L1_error)

  /* "constants.auto.pyx":26
 * ERROR_ILLEGAL_INSTRUCTION = 5
 * ## Out of range or have no sense
 * ERROR_INVALID_PARAMETER = 6             # <<<<<<<<<<<<<<
 * ## Invalid size
 * ERROR_INVALID_PACKET = 7
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR_INVALID_PARAMETER, __pyx_int_6) < 0) __PYX_ERR(3, 26, __pyx_L1_error)

  /* "constants.auto.pyx":28
 * ERROR_INVALID_PARAMETER = 6
 * ## Invalid size
 * ERROR_INVALID_PACKET = 7             # <<<<<<<<<<<<<<
 * ## Connection refused
 * ERROR_CONNREFUSED = 8
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR_INVALID_PACKET, __pyx_int_7) < 0) __PYX_ERR(3, 28, __pyx_L1_error)

  /* "constants.auto.pyx":30
 * ERROR_INVALID_PACKET = 7
 * ## Connection refused
 * ERROR_CONNREFUSED = 8             # <<<<<<<<<<<<<<
 * ## Operation not supported
 * ERROR_OPNOTSUPP = 9
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR_CONNREFUSED, __pyx_int_8) < 0) __PYX_ERR(3, 30, __pyx_L1_error)

  /* "constants.auto.pyx":32
 * ERROR_CONNREFUSED = 8
 * ## Operation not supported
 * ERROR_OPNOTSUPP = 9             # <<<<<<<<<<<<<<
 * ## Getaddrinfo error
 * ERROR_GAIERR = 10
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR_OPNOTSUPP, __pyx_int_9) < 0) __PYX_ERR(3, 32, __pyx_L1_error)

  /* "constants.auto.pyx":34
 * ERROR_OPNOTSUPP = 9
 * ## Getaddrinfo error
 * ERROR_GAIERR = 10             # <<<<<<<<<<<<<<
 * ## Libc error
 * ERROR_LIBCERR = 11
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR_GAIERR, __pyx_int_10) < 0) __PYX_ERR(3, 34, __pyx_L1_error)

  /* "constants.auto.pyx":36
 * ERROR_GAIERR = 10
 * ## Libc error
 * ERROR_LIBCERR = 11             # <<<<<<<<<<<<<<
 * ## Couldn't find out the tty number
 * ERROR_UNKNOWNTTY = 12
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR_LIBCERR, __pyx_int_11) < 0) __PYX_ERR(3, 36, __pyx_L1_error)

  /* "constants.auto.pyx":38
 * ERROR_LIBCERR = 11
 * ## Couldn't find out the tty number
 * ERROR_UNKNOWNTTY = 12             # <<<<<<<<<<<<<<
 * ## Bad protocol version
 * ERROR_PROTOCOL_VERSION = 13
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR_UNKNOWNTTY, __pyx_int_12) < 0) __PYX_ERR(3, 38, __pyx_L1_error)

  /* "constants.auto.pyx":40
 * ERROR_UNKNOWNTTY = 12
 * ## Bad protocol version
 * ERROR_PROTOCOL_VERSION = 13             # <<<<<<<<<<<<<<
 * ## Unexpected end of file
 * ERROR_EOF = 14
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR_PROTOCOL_VERSION, __pyx_int_13) < 0) __PYX_ERR(3, 40, __pyx_L1_error)

  /* "constants.auto.pyx":42
 * ERROR_PROTOCOL_VERSION = 13
 * ## Unexpected end of file
 * ERROR_EOF = 14             # <<<<<<<<<<<<<<
 * ## Key file empty
 * ERROR_EMPTYKEY = 15
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR_EOF, __pyx_int_14) < 0) __PYX_ERR(3, 42, __pyx_L1_error)

  /* "constants.auto.pyx":44
 * ERROR_EOF = 14
 * ## Key file empty
 * ERROR_EMPTYKEY = 15             # <<<<<<<<<<<<<<
 * ## Packet returned by driver too large
 * ERROR_DRIVERERROR = 16
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR_EMPTYKEY, __pyx_int_15) < 0) __PYX_ERR(3, 44, __pyx_L1_error)

  /* "constants.auto.pyx":46
 * ERROR_EMPTYKEY = 15
 * ## Packet returned by driver too large
 * ERROR_DRIVERERROR = 16             # <<<<<<<<<<<<<<
 * ## Authentication failed
 * ERROR_AUTHENTICATION = 17
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR_DRIVERERROR, __pyx_int_16) < 0) __PYX_ERR(3, 46, __pyx_L1_error)

  /* "constants.auto.pyx":48
 * ERROR_DRIVERERROR = 16
 * ## Authentication failed
 * ERROR_AUTHENTICATION = 17             # <<<<<<<<<<<<<<
 * ## Parameter can not be changed
 * ERROR_READONLY_PARAMETER = 18
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR_AUTHENTICATION, __pyx_int_17) < 0) __PYX_ERR(3, 48, __pyx_L1_error)

  /* "constants.auto.pyx":50
 * ERROR_AUTHENTICATION = 17
 * ## Parameter can not be changed
 * ERROR_READONLY_PARAMETER = 18             # <<<<<<<<<<<<<<
 * KEY_MAX = c_brlapi.BRLAPI_KEY_MAX
 * KEY_FLAGS_MASK = c_brlapi.BRLAPI_KEY_FLAGS_MASK
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR_READONLY_PARAMETER, __pyx_int_18) < 0) __PYX_ERR(3, 50, __pyx_L1_error)

  /* "constants.auto.pyx":51
 * ## Parameter can not be changed
 * ERROR_READONLY_PARAMETER = 18
 * KEY_MAX = c_brlapi.BRLAPI_KEY_MAX             # <<<<<<<<<<<<<<
 * KEY_FLAGS_MASK = c_brlapi.BRLAPI_KEY_FLAGS_MASK
 * KEY_FLAGS_SHIFT = 32
 */
  __pyx_t_1 = __Pyx_PyInt_From_brlapi_keyCode_t(BRLAPI_KEY_MAX); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_MAX, __pyx_t_1) < 0) __PYX_ERR(3, 51, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "constants.auto.pyx":52
 * ERROR_READONLY_PARAMETER = 18
 * KEY_MAX = c_brlapi.BRLAPI_KEY_MAX
 * KEY_FLAGS_MASK = c_brlapi.BRLAPI_KEY_FLAGS_MASK             # <<<<<<<<<<<<<<
 * KEY_FLAGS_SHIFT = 32
 * KEY_TYPE_MASK = c_brlapi.BRLAPI_KEY_TYPE_MASK
 */
  __pyx_t_1 = __Pyx_PyInt_From_brlapi_keyCode_t(BRLAPI_KEY_FLAGS_MASK); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_FLAGS_MASK, __pyx_t_1) < 0) __PYX_ERR(3, 52, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "constants.auto.pyx":53
 * KEY_MAX = c_brlapi.BRLAPI_KEY_MAX
 * KEY_FLAGS_MASK = c_brlapi.BRLAPI_KEY_FLAGS_MASK
 * KEY_FLAGS_SHIFT = 32             # <<<<<<<<<<<<<<
 * KEY_TYPE_MASK = c_brlapi.BRLAPI_KEY_TYPE_MASK
 * KEY_TYPE_SHIFT = 29
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_FLAGS_SHIFT, __pyx_int_32) < 0) __PYX_ERR(3, 53, __pyx_L1_error)

  /* "constants.auto.pyx":54
 * KEY_FLAGS_MASK = c_brlapi.BRLAPI_KEY_FLAGS_MASK
 * KEY_FLAGS_SHIFT = 32
 * KEY_TYPE_MASK = c_brlapi.BRLAPI_KEY_TYPE_MASK             # <<<<<<<<<<<<<<
 * KEY_TYPE_SHIFT = 29
 * KEY_TYPE_CMD = 0x0000000020000000
 */
  __pyx_t_1 = __Pyx_PyInt_From_brlapi_keyCode_t(BRLAPI_KEY_TYPE_MASK); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_TYPE_MASK, __pyx_t_1) < 0) __PYX_ERR(3, 54, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "constants.auto.pyx":55
 * KEY_FLAGS_SHIFT = 32
 * KEY_TYPE_MASK = c_brlapi.BRLAPI_KEY_TYPE_MASK
 * KEY_TYPE_SHIFT = 29             # <<<<<<<<<<<<<<
 * KEY_TYPE_CMD = 0x0000000020000000
 * KEY_TYPE_SYM = 0x0000000000000000
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_TYPE_SHIFT, __pyx_int_29) < 0) __PYX_ERR(3, 55, __pyx_L1_error)

  /* "constants.auto.pyx":56
 * KEY_TYPE_MASK = c_brlapi.BRLAPI_KEY_TYPE_MASK
 * KEY_TYPE_SHIFT = 29
 * KEY_TYPE_CMD = 0x0000000020000000             # <<<<<<<<<<<<<<
 * KEY_TYPE_SYM = 0x0000000000000000
 * KEY_CODE_MASK = c_brlapi.BRLAPI_KEY_CODE_MASK
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_TYPE_CMD, __pyx_int_536870912) < 0) __PYX_ERR(3, 56, __pyx_L1_error)

  /* "constants.auto.pyx":57
 * KEY_TYPE_SHIFT = 29
 * KEY_TYPE_CMD = 0x0000000020000000
 * KEY_TYPE_SYM = 0x0000000000000000             # <<<<<<<<<<<<<<
 * KEY_CODE_MASK = c_brlapi.BRLAPI_KEY_CODE_MASK
 * KEY_CODE_SHIFT = 0
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_TYPE_SYM, __pyx_int_0) < 0) __PYX_ERR(3, 57, __pyx_L1_error)

  /* "constants.auto.pyx":58
 * KEY_TYPE_CMD = 0x0000000020000000
 * KEY_TYPE_SYM = 0x0000000000000000
 * KEY_CODE_MASK = c_brlapi.BRLAPI_KEY_CODE_MASK             # <<<<<<<<<<<<<<
 * KEY_CODE_SHIFT = 0
 * KEY_CMD_BLK_MASK = c_brlapi.BRLAPI_KEY_CMD_BLK_MASK
 */
  __pyx_t_1 = __Pyx_PyInt_From_brlapi_keyCode_t(BRLAPI_KEY_CODE_MASK); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CODE_MASK, __pyx_t_1) < 0) __PYX_ERR(3, 58, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "constants.auto.pyx":59
 * KEY_TYPE_SYM = 0x0000000000000000
 * KEY_CODE_MASK = c_brlapi.BRLAPI_KEY_CODE_MASK
 * KEY_CODE_SHIFT = 0             # <<<<<<<<<<<<<<
 * KEY_CMD_BLK_MASK = c_brlapi.BRLAPI_KEY_CMD_BLK_MASK
 * KEY_CMD_BLK_SHIFT = 16
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CODE_SHIFT, __pyx_int_0) < 0) __PYX_ERR(3, 59, __pyx_L1_error)

  /* "constants.auto.pyx":60
 * KEY_CODE_MASK = c_brlapi.BRLAPI_KEY_CODE_MASK
 * KEY_CODE_SHIFT = 0
 * KEY_CMD_BLK_MASK = c_brlapi.BRLAPI_KEY_CMD_BLK_MASK             # <<<<<<<<<<<<<<
 * KEY_CMD_BLK_SHIFT = 16
 * KEY_CMD_ARG_MASK = c_brlapi.BRLAPI_KEY_CMD_ARG_MASK
 */
  __pyx_t_1 = __Pyx_PyInt_From_brlapi_keyCode_t(BRLAPI_KEY_CMD_BLK_MASK); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_BLK_MASK, __pyx_t_1) < 0) __PYX_ERR(3, 60, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "constants.auto.pyx":61
 * KEY_CODE_SHIFT = 0
 * KEY_CMD_BLK_MASK = c_brlapi.BRLAPI_KEY_CMD_BLK_MASK
 * KEY_CMD_BLK_SHIFT = 16             # <<<<<<<<<<<<<<
 * KEY_CMD_ARG_MASK = c_brlapi.BRLAPI_KEY_CMD_ARG_MASK
 * KEY_CMD_ARG_SHIFT = 0
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_BLK_SHIFT, __pyx_int_16) < 0) __PYX_ERR(3, 61, __pyx_L1_error)

  /* "constants.auto.pyx":62
 * KEY_CMD_BLK_MASK = c_brlapi.BRLAPI_KEY_CMD_BLK_MASK
 * KEY_CMD_BLK_SHIFT = 16
 * KEY_CMD_ARG_MASK = c_brlapi.BRLAPI_KEY_CMD_ARG_MASK             # <<<<<<<<<<<<<<
 * KEY_CMD_ARG_SHIFT = 0
 * KEY_SYM_BACKSPACE = 0x0000ff08
 */
  __pyx_t_1 = __Pyx_PyInt_From_brlapi_keyCode_t(BRLAPI_KEY_CMD_ARG_MASK); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_ARG_MASK, __pyx_t_1) < 0) __PYX_ERR(3, 62, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "constants.auto.pyx":63
 * KEY_CMD_BLK_SHIFT = 16
 * KEY_CMD_ARG_MASK = c_brlapi.BRLAPI_KEY_CMD_ARG_MASK
 * KEY_CMD_ARG_SHIFT = 0             # <<<<<<<<<<<<<<
 * KEY_SYM_BACKSPACE = 0x0000ff08
 * KEY_SYM_TAB = 0x0000ff09
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_ARG_SHIFT, __pyx_int_0) < 0) __PYX_ERR(3, 63, __pyx_L1_error)

  /* "constants.auto.pyx":64
 * KEY_CMD_ARG_MASK = c_brlapi.BRLAPI_KEY_CMD_ARG_MASK
 * KEY_CMD_ARG_SHIFT = 0
 * KEY_SYM_BACKSPACE = 0x0000ff08             # <<<<<<<<<<<<<<
 * KEY_SYM_TAB = 0x0000ff09
 * KEY_SYM_LINEFEED = 0x0000ff0d
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_BACKSPACE, __pyx_int_65288) < 0) __PYX_ERR(3, 64, __pyx_L1_error)

  /* "constants.auto.pyx":65
 * KEY_CMD_ARG_SHIFT = 0
 * KEY_SYM_BACKSPACE = 0x0000ff08
 * KEY_SYM_TAB = 0x0000ff09             # <<<<<<<<<<<<<<
 * KEY_SYM_LINEFEED = 0x0000ff0d
 * KEY_SYM_ESCAPE = 0x0000ff1b
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_TAB, __pyx_int_65289) < 0) __PYX_ERR(3, 65, __pyx_L1_error)

  /* "constants.auto.pyx":66
 * KEY_SYM_BACKSPACE = 0x0000ff08
 * KEY_SYM_TAB = 0x0000ff09
 * KEY_SYM_LINEFEED = 0x0000ff0d             # <<<<<<<<<<<<<<
 * KEY_SYM_ESCAPE = 0x0000ff1b
 * KEY_SYM_HOME = 0x0000ff50
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_LINEFEED, __pyx_int_65293) < 0) __PYX_ERR(3, 66, __pyx_L1_error)

  /* "constants.auto.pyx":67
 * KEY_SYM_TAB = 0x0000ff09
 * KEY_SYM_LINEFEED = 0x0000ff0d
 * KEY_SYM_ESCAPE = 0x0000ff1b             # <<<<<<<<<<<<<<
 * KEY_SYM_HOME = 0x0000ff50
 * KEY_SYM_LEFT = 0x0000ff51
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_ESCAPE, __pyx_int_65307) < 0) __PYX_ERR(3, 67, __pyx_L1_error)

  /* "constants.auto.pyx":68
 * KEY_SYM_LINEFEED = 0x0000ff0d
 * KEY_SYM_ESCAPE = 0x0000ff1b
 * KEY_SYM_HOME = 0x0000ff50             # <<<<<<<<<<<<<<
 * KEY_SYM_LEFT = 0x0000ff51
 * KEY_SYM_UP = 0x0000ff52
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_HOME, __pyx_int_65360) < 0) __PYX_ERR(3, 68, __pyx_L1_error)

  /* "constants.auto.pyx":69
 * KEY_SYM_ESCAPE = 0x0000ff1b
 * KEY_SYM_HOME = 0x0000ff50
 * KEY_SYM_LEFT = 0x0000ff51             # <<<<<<<<<<<<<<
 * KEY_SYM_UP = 0x0000ff52
 * KEY_SYM_RIGHT = 0x0000ff53
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_LEFT, __pyx_int_65361) < 0) __PYX_ERR(3, 69, __pyx_L1_error)

  /* "constants.auto.pyx":70
 * KEY_SYM_HOME = 0x0000ff50
 * KEY_SYM_LEFT = 0x0000ff51
 * KEY_SYM_UP = 0x0000ff52             # <<<<<<<<<<<<<<
 * KEY_SYM_RIGHT = 0x0000ff53
 * KEY_SYM_DOWN = 0x0000ff54
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_UP, __pyx_int_65362) < 0) __PYX_ERR(3, 70, __pyx_L1_error)

  /* "constants.auto.pyx":71
 * KEY_SYM_LEFT = 0x0000ff51
 * KEY_SYM_UP = 0x0000ff52
 * KEY_SYM_RIGHT = 0x0000ff53             # <<<<<<<<<<<<<<
 * KEY_SYM_DOWN = 0x0000ff54
 * KEY_SYM_PAGE_UP = 0x0000ff55
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_RIGHT, __pyx_int_65363) < 0) __PYX_ERR(3, 71, __pyx_L1_error)

  /* "constants.auto.pyx":72
 * KEY_SYM_UP = 0x0000ff52
 * KEY_SYM_RIGHT = 0x0000ff53
 * KEY_SYM_DOWN = 0x0000ff54             # <<<<<<<<<<<<<<
 * KEY_SYM_PAGE_UP = 0x0000ff55
 * KEY_SYM_PAGE_DOWN = 0x0000ff56
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_DOWN, __pyx_int_65364) < 0) __PYX_ERR(3, 72, __pyx_L1_error)

  /* "constants.auto.pyx":73
 * KEY_SYM_RIGHT = 0x0000ff53
 * KEY_SYM_DOWN = 0x0000ff54
 * KEY_SYM_PAGE_UP = 0x0000ff55             # <<<<<<<<<<<<<<
 * KEY_SYM_PAGE_DOWN = 0x0000ff56
 * KEY_SYM_END = 0x0000ff57
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_PAGE_UP, __pyx_int_65365) < 0) __PYX_ERR(3, 73, __pyx_L1_error)

  /* "constants.auto.pyx":74
 * KEY_SYM_DOWN = 0x0000ff54
 * KEY_SYM_PAGE_UP = 0x0000ff55
 * KEY_SYM_PAGE_DOWN = 0x0000ff56             # <<<<<<<<<<<<<<
 * KEY_SYM_END = 0x0000ff57
 * KEY_SYM_INSERT = 0x0000ff63
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_PAGE_DOWN, __pyx_int_65366) < 0) __PYX_ERR(3, 74, __pyx_L1_error)

  /* "constants.auto.pyx":75
 * KEY_SYM_PAGE_UP = 0x0000ff55
 * KEY_SYM_PAGE_DOWN = 0x0000ff56
 * KEY_SYM_END = 0x0000ff57             # <<<<<<<<<<<<<<
 * KEY_SYM_INSERT = 0x0000ff63
 * ## the F1 key
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_END, __pyx_int_65367) < 0) __PYX_ERR(3, 75, __pyx_L1_error)

  /* "constants.auto.pyx":76
 * KEY_SYM_PAGE_DOWN = 0x0000ff56
 * KEY_SYM_END = 0x0000ff57
 * KEY_SYM_INSERT = 0x0000ff63             # <<<<<<<<<<<<<<
 * ## the F1 key
 * KEY_SYM_F1 = (0x0000ffbe + 0)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_INSERT, __pyx_int_65379) < 0) __PYX_ERR(3, 76, __pyx_L1_error)

  /* "constants.auto.pyx":78
 * KEY_SYM_INSERT = 0x0000ff63
 * ## the F1 key
 * KEY_SYM_F1 = (0x0000ffbe + 0)             # <<<<<<<<<<<<<<
 * ## the F2 key
 * KEY_SYM_F2 = (0x0000ffbe + 1)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F1, __pyx_int_65470) < 0) __PYX_ERR(3, 78, __pyx_L1_error)

  /* "constants.auto.pyx":80
 * KEY_SYM_F1 = (0x0000ffbe + 0)
 * ## the F2 key
 * KEY_SYM_F2 = (0x0000ffbe + 1)             # <<<<<<<<<<<<<<
 * ## the F3 key
 * KEY_SYM_F3 = (0x0000ffbe + 2)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F2, __pyx_int_65471) < 0) __PYX_ERR(3, 80, __pyx_L1_error)

  /* "constants.auto.pyx":82
 * KEY_SYM_F2 = (0x0000ffbe + 1)
 * ## the F3 key
 * KEY_SYM_F3 = (0x0000ffbe + 2)             # <<<<<<<<<<<<<<
 * ## the F4 key
 * KEY_SYM_F4 = (0x0000ffbe + 3)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F3, __pyx_int_65472) < 0) __PYX_ERR(3, 82, __pyx_L1_error)

  /* "constants.auto.pyx":84
 * KEY_SYM_F3 = (0x0000ffbe + 2)
 * ## the F4 key
 * KEY_SYM_F4 = (0x0000ffbe + 3)             # <<<<<<<<<<<<<<
 * ## the F5 key
 * KEY_SYM_F5 = (0x0000ffbe + 4)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F4, __pyx_int_65473) < 0) __PYX_ERR(3, 84, __pyx_L1_error)

  /* "constants.auto.pyx":86
 * KEY_SYM_F4 = (0x0000ffbe + 3)
 * ## the F5 key
 * KEY_SYM_F5 = (0x0000ffbe + 4)             # <<<<<<<<<<<<<<
 * ## the F6 key
 * KEY_SYM_F6 = (0x0000ffbe + 5)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F5, __pyx_int_65474) < 0) __PYX_ERR(3, 86, __pyx_L1_error)

  /* "constants.auto.pyx":88
 * KEY_SYM_F5 = (0x0000ffbe + 4)
 * ## the F6 key
 * KEY_SYM_F6 = (0x0000ffbe + 5)             # <<<<<<<<<<<<<<
 * ## the F7 key
 * KEY_SYM_F7 = (0x0000ffbe + 6)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F6, __pyx_int_65475) < 0) __PYX_ERR(3, 88, __pyx_L1_error)

  /* "constants.auto.pyx":90
 * KEY_SYM_F6 = (0x0000ffbe + 5)
 * ## the F7 key
 * KEY_SYM_F7 = (0x0000ffbe + 6)             # <<<<<<<<<<<<<<
 * ## the F8 key
 * KEY_SYM_F8 = (0x0000ffbe + 7)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F7, __pyx_int_65476) < 0) __PYX_ERR(3, 90, __pyx_L1_error)

  /* "constants.auto.pyx":92
 * KEY_SYM_F7 = (0x0000ffbe + 6)
 * ## the F8 key
 * KEY_SYM_F8 = (0x0000ffbe + 7)             # <<<<<<<<<<<<<<
 * ## the F9 key
 * KEY_SYM_F9 = (0x0000ffbe + 8)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F8, __pyx_int_65477) < 0) __PYX_ERR(3, 92, __pyx_L1_error)

  /* "constants.auto.pyx":94
 * KEY_SYM_F8 = (0x0000ffbe + 7)
 * ## the F9 key
 * KEY_SYM_F9 = (0x0000ffbe + 8)             # <<<<<<<<<<<<<<
 * ## the F10 key
 * KEY_SYM_F10 = (0x0000ffbe + 9)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F9, __pyx_int_65478) < 0) __PYX_ERR(3, 94, __pyx_L1_error)

  /* "constants.auto.pyx":96
 * KEY_SYM_F9 = (0x0000ffbe + 8)
 * ## the F10 key
 * KEY_SYM_F10 = (0x0000ffbe + 9)             # <<<<<<<<<<<<<<
 * ## the F11 key
 * KEY_SYM_F11 = (0x0000ffbe + 10)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F10, __pyx_int_65479) < 0) __PYX_ERR(3, 96, __pyx_L1_error)

  /* "constants.auto.pyx":98
 * KEY_SYM_F10 = (0x0000ffbe + 9)
 * ## the F11 key
 * KEY_SYM_F11 = (0x0000ffbe + 10)             # <<<<<<<<<<<<<<
 * ## the F12 key
 * KEY_SYM_F12 = (0x0000ffbe + 11)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F11, __pyx_int_65480) < 0) __PYX_ERR(3, 98, __pyx_L1_error)

  /* "constants.auto.pyx":100
 * KEY_SYM_F11 = (0x0000ffbe + 10)
 * ## the F12 key
 * KEY_SYM_F12 = (0x0000ffbe + 11)             # <<<<<<<<<<<<<<
 * ## the F13 key
 * KEY_SYM_F13 = (0x0000ffbe + 12)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F12, __pyx_int_65481) < 0) __PYX_ERR(3, 100, __pyx_L1_error)

  /* "constants.auto.pyx":102
 * KEY_SYM_F12 = (0x0000ffbe + 11)
 * ## the F13 key
 * KEY_SYM_F13 = (0x0000ffbe + 12)             # <<<<<<<<<<<<<<
 * ## the F14 key
 * KEY_SYM_F14 = (0x0000ffbe + 13)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F13, __pyx_int_65482) < 0) __PYX_ERR(3, 102, __pyx_L1_error)

  /* "constants.auto.pyx":104
 * KEY_SYM_F13 = (0x0000ffbe + 12)
 * ## the F14 key
 * KEY_SYM_F14 = (0x0000ffbe + 13)             # <<<<<<<<<<<<<<
 * ## the F15 key
 * KEY_SYM_F15 = (0x0000ffbe + 14)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F14, __pyx_int_65483) < 0) __PYX_ERR(3, 104, __pyx_L1_error)

  /* "constants.auto.pyx":106
 * KEY_SYM_F14 = (0x0000ffbe + 13)
 * ## the F15 key
 * KEY_SYM_F15 = (0x0000ffbe + 14)             # <<<<<<<<<<<<<<
 * ## the F16 key
 * KEY_SYM_F16 = (0x0000ffbe + 15)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F15, __pyx_int_65484) < 0) __PYX_ERR(3, 106, __pyx_L1_error)

  /* "constants.auto.pyx":108
 * KEY_SYM_F15 = (0x0000ffbe + 14)
 * ## the F16 key
 * KEY_SYM_F16 = (0x0000ffbe + 15)             # <<<<<<<<<<<<<<
 * ## the F17 key
 * KEY_SYM_F17 = (0x0000ffbe + 16)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F16, __pyx_int_65485) < 0) __PYX_ERR(3, 108, __pyx_L1_error)

  /* "constants.auto.pyx":110
 * KEY_SYM_F16 = (0x0000ffbe + 15)
 * ## the F17 key
 * KEY_SYM_F17 = (0x0000ffbe + 16)             # <<<<<<<<<<<<<<
 * ## the F18 key
 * KEY_SYM_F18 = (0x0000ffbe + 17)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F17, __pyx_int_65486) < 0) __PYX_ERR(3, 110, __pyx_L1_error)

  /* "constants.auto.pyx":112
 * KEY_SYM_F17 = (0x0000ffbe + 16)
 * ## the F18 key
 * KEY_SYM_F18 = (0x0000ffbe + 17)             # <<<<<<<<<<<<<<
 * ## the F19 key
 * KEY_SYM_F19 = (0x0000ffbe + 18)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F18, __pyx_int_65487) < 0) __PYX_ERR(3, 112, __pyx_L1_error)

  /* "constants.auto.pyx":114
 * KEY_SYM_F18 = (0x0000ffbe + 17)
 * ## the F19 key
 * KEY_SYM_F19 = (0x0000ffbe + 18)             # <<<<<<<<<<<<<<
 * ## the F20 key
 * KEY_SYM_F20 = (0x0000ffbe + 19)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F19, __pyx_int_65488) < 0) __PYX_ERR(3, 114, __pyx_L1_error)

  /* "constants.auto.pyx":116
 * KEY_SYM_F19 = (0x0000ffbe + 18)
 * ## the F20 key
 * KEY_SYM_F20 = (0x0000ffbe + 19)             # <<<<<<<<<<<<<<
 * ## the F21 key
 * KEY_SYM_F21 = (0x0000ffbe + 20)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F20, __pyx_int_65489) < 0) __PYX_ERR(3, 116, __pyx_L1_error)

  /* "constants.auto.pyx":118
 * KEY_SYM_F20 = (0x0000ffbe + 19)
 * ## the F21 key
 * KEY_SYM_F21 = (0x0000ffbe + 20)             # <<<<<<<<<<<<<<
 * ## the F22 key
 * KEY_SYM_F22 = (0x0000ffbe + 21)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F21, __pyx_int_65490) < 0) __PYX_ERR(3, 118, __pyx_L1_error)

  /* "constants.auto.pyx":120
 * KEY_SYM_F21 = (0x0000ffbe + 20)
 * ## the F22 key
 * KEY_SYM_F22 = (0x0000ffbe + 21)             # <<<<<<<<<<<<<<
 * ## the F23 key
 * KEY_SYM_F23 = (0x0000ffbe + 22)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F22, __pyx_int_65491) < 0) __PYX_ERR(3, 120, __pyx_L1_error)

  /* "constants.auto.pyx":122
 * KEY_SYM_F22 = (0x0000ffbe + 21)
 * ## the F23 key
 * KEY_SYM_F23 = (0x0000ffbe + 22)             # <<<<<<<<<<<<<<
 * ## the F24 key
 * KEY_SYM_F24 = (0x0000ffbe + 23)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F23, __pyx_int_65492) < 0) __PYX_ERR(3, 122, __pyx_L1_error)

  /* "constants.auto.pyx":124
 * KEY_SYM_F23 = (0x0000ffbe + 22)
 * ## the F24 key
 * KEY_SYM_F24 = (0x0000ffbe + 23)             # <<<<<<<<<<<<<<
 * ## the F25 key
 * KEY_SYM_F25 = (0x0000ffbe + 24)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F24, __pyx_int_65493) < 0) __PYX_ERR(3, 124, __pyx_L1_error)

  /* "constants.auto.pyx":126
 * KEY_SYM_F24 = (0x0000ffbe + 23)
 * ## the F25 key
 * KEY_SYM_F25 = (0x0000ffbe + 24)             # <<<<<<<<<<<<<<
 * ## the F26 key
 * KEY_SYM_F26 = (0x0000ffbe + 25)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F25, __pyx_int_65494) < 0) __PYX_ERR(3, 126, __pyx_L1_error)

  /* "constants.auto.pyx":128
 * KEY_SYM_F25 = (0x0000ffbe + 24)
 * ## the F26 key
 * KEY_SYM_F26 = (0x0000ffbe + 25)             # <<<<<<<<<<<<<<
 * ## the F27 key
 * KEY_SYM_F27 = (0x0000ffbe + 26)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F26, __pyx_int_65495) < 0) __PYX_ERR(3, 128, __pyx_L1_error)

  /* "constants.auto.pyx":130
 * KEY_SYM_F26 = (0x0000ffbe + 25)
 * ## the F27 key
 * KEY_SYM_F27 = (0x0000ffbe + 26)             # <<<<<<<<<<<<<<
 * ## the F28 key
 * KEY_SYM_F28 = (0x0000ffbe + 27)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F27, __pyx_int_65496) < 0) __PYX_ERR(3, 130, __pyx_L1_error)

  /* "constants.auto.pyx":132
 * KEY_SYM_F27 = (0x0000ffbe + 26)
 * ## the F28 key
 * KEY_SYM_F28 = (0x0000ffbe + 27)             # <<<<<<<<<<<<<<
 * ## the F29 key
 * KEY_SYM_F29 = (0x0000ffbe + 28)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F28, __pyx_int_65497) < 0) __PYX_ERR(3, 132, __pyx_L1_error)

  /* "constants.auto.pyx":134
 * KEY_SYM_F28 = (0x0000ffbe + 27)
 * ## the F29 key
 * KEY_SYM_F29 = (0x0000ffbe + 28)             # <<<<<<<<<<<<<<
 * ## the F30 key
 * KEY_SYM_F30 = (0x0000ffbe + 29)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F29, __pyx_int_65498) < 0) __PYX_ERR(3, 134, __pyx_L1_error)

  /* "constants.auto.pyx":136
 * KEY_SYM_F29 = (0x0000ffbe + 28)
 * ## the F30 key
 * KEY_SYM_F30 = (0x0000ffbe + 29)             # <<<<<<<<<<<<<<
 * ## the F31 key
 * KEY_SYM_F31 = (0x0000ffbe + 30)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F30, __pyx_int_65499) < 0) __PYX_ERR(3, 136, __pyx_L1_error)

  /* "constants.auto.pyx":138
 * KEY_SYM_F30 = (0x0000ffbe + 29)
 * ## the F31 key
 * KEY_SYM_F31 = (0x0000ffbe + 30)             # <<<<<<<<<<<<<<
 * ## the F32 key
 * KEY_SYM_F32 = (0x0000ffbe + 31)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F31, __pyx_int_65500) < 0) __PYX_ERR(3, 138, __pyx_L1_error)

  /* "constants.auto.pyx":140
 * KEY_SYM_F31 = (0x0000ffbe + 30)
 * ## the F32 key
 * KEY_SYM_F32 = (0x0000ffbe + 31)             # <<<<<<<<<<<<<<
 * ## the F33 key
 * KEY_SYM_F33 = (0x0000ffbe + 32)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F32, __pyx_int_65501) < 0) __PYX_ERR(3, 140, __pyx_L1_error)

  /* "constants.auto.pyx":142
 * KEY_SYM_F32 = (0x0000ffbe + 31)
 * ## the F33 key
 * KEY_SYM_F33 = (0x0000ffbe + 32)             # <<<<<<<<<<<<<<
 * ## the F34 key
 * KEY_SYM_F34 = (0x0000ffbe + 33)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F33, __pyx_int_65502) < 0) __PYX_ERR(3, 142, __pyx_L1_error)

  /* "constants.auto.pyx":144
 * KEY_SYM_F33 = (0x0000ffbe + 32)
 * ## the F34 key
 * KEY_SYM_F34 = (0x0000ffbe + 33)             # <<<<<<<<<<<<<<
 * ## the F35 key
 * KEY_SYM_F35 = (0x0000ffbe + 34)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F34, __pyx_int_65503) < 0) __PYX_ERR(3, 144, __pyx_L1_error)

  /* "constants.auto.pyx":146
 * KEY_SYM_F34 = (0x0000ffbe + 33)
 * ## the F35 key
 * KEY_SYM_F35 = (0x0000ffbe + 34)             # <<<<<<<<<<<<<<
 * KEY_SYM_DELETE = 0x0000ffff
 * KEY_SYM_UNICODE = 0x01000000
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_F35, __pyx_int_65504) < 0) __PYX_ERR(3, 146, __pyx_L1_error)

  /* "constants.auto.pyx":147
 * ## the F35 key
 * KEY_SYM_F35 = (0x0000ffbe + 34)
 * KEY_SYM_DELETE = 0x0000ffff             # <<<<<<<<<<<<<<
 * KEY_SYM_UNICODE = 0x01000000
 * ## Version of the server: uint32_t
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_DELETE, __pyx_int_65535) < 0) __PYX_ERR(3, 147, __pyx_L1_error)

  /* "constants.auto.pyx":148
 * KEY_SYM_F35 = (0x0000ffbe + 34)
 * KEY_SYM_DELETE = 0x0000ffff
 * KEY_SYM_UNICODE = 0x01000000             # <<<<<<<<<<<<<<
 * ## Version of the server: uint32_t
 * PARAM_SERVER_VERSION = 0
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_SYM_UNICODE, __pyx_int_16777216) < 0) __PYX_ERR(3, 148, __pyx_L1_error)

  /* "constants.auto.pyx":150
 * KEY_SYM_UNICODE = 0x01000000
 * ## Version of the server: uint32_t
 * PARAM_SERVER_VERSION = 0             # <<<<<<<<<<<<<<
 * ## Priority of the client: uint32_t (from 0 through 100, default is 50)
 * PARAM_CLIENT_PRIORITY = 1
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_SERVER_VERSION, __pyx_int_0) < 0) __PYX_ERR(3, 150, __pyx_L1_error)

  /* "constants.auto.pyx":152
 * PARAM_SERVER_VERSION = 0
 * ## Priority of the client: uint32_t (from 0 through 100, default is 50)
 * PARAM_CLIENT_PRIORITY = 1             # <<<<<<<<<<<<<<
 * ## Full name of the driver: string
 * PARAM_DRIVER_NAME = 2
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_CLIENT_PRIORITY, __pyx_int_1) < 0) __PYX_ERR(3, 152, __pyx_L1_error)

  /* "constants.auto.pyx":154
 * PARAM_CLIENT_PRIORITY = 1
 * ## Full name of the driver: string
 * PARAM_DRIVER_NAME = 2             # <<<<<<<<<<<<<<
 * ## Code (short name) of the driver: string
 * PARAM_DRIVER_CODE = 3
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_DRIVER_NAME, __pyx_int_2) < 0) __PYX_ERR(3, 154, __pyx_L1_error)

  /* "constants.auto.pyx":156
 * PARAM_DRIVER_NAME = 2
 * ## Code (short name) of the driver: string
 * PARAM_DRIVER_CODE = 3             # <<<<<<<<<<<<<<
 * ## Version of the driver: string
 * PARAM_DRIVER_VERSION = 4
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_DRIVER_CODE, __pyx_int_3) < 0) __PYX_ERR(3, 156, __pyx_L1_error)

  /* "constants.auto.pyx":158
 * PARAM_DRIVER_CODE = 3
 * ## Version of the driver: string
 * PARAM_DRIVER_VERSION = 4             # <<<<<<<<<<<<<<
 * ## Model of the device: string
 * PARAM_DEVICE_MODEL = 5
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_DRIVER_VERSION, __pyx_int_4) < 0) __PYX_ERR(3, 158, __pyx_L1_error)

  /* "constants.auto.pyx":160
 * PARAM_DRIVER_VERSION = 4
 * ## Model of the device: string
 * PARAM_DEVICE_MODEL = 5             # <<<<<<<<<<<<<<
 * ## Number of dots in a cell: uint8_t
 * PARAM_DEVICE_CELL_SIZE = 31
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_DEVICE_MODEL, __pyx_int_5) < 0) __PYX_ERR(3, 160, __pyx_L1_error)

  /* "constants.auto.pyx":162
 * PARAM_DEVICE_MODEL = 5
 * ## Number of dots in a cell: uint8_t
 * PARAM_DEVICE_CELL_SIZE = 31             # <<<<<<<<<<<<<<
 * ## Dimensions of the braille display: { uint32_t columns; uint32_t rows; }
 * PARAM_DISPLAY_SIZE = 6
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_DEVICE_CELL_SIZE, __pyx_int_31) < 0) __PYX_ERR(3, 162, __pyx_L1_error)

  /* "constants.auto.pyx":164
 * PARAM_DEVICE_CELL_SIZE = 31
 * ## Dimensions of the braille display: { uint32_t columns; uint32_t rows; }
 * PARAM_DISPLAY_SIZE = 6             # <<<<<<<<<<<<<<
 * ## Identifier of the device: string
 * PARAM_DEVICE_IDENTIFIER = 7
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_DISPLAY_SIZE, __pyx_int_6) < 0) __PYX_ERR(3, 164, __pyx_L1_error)

  /* "constants.auto.pyx":166
 * PARAM_DISPLAY_SIZE = 6
 * ## Identifier of the device: string
 * PARAM_DEVICE_IDENTIFIER = 7             # <<<<<<<<<<<<<<
 * ## Speed of the device: uint32_t
 * PARAM_DEVICE_SPEED = 8
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_DEVICE_IDENTIFIER, __pyx_int_7) < 0) __PYX_ERR(3, 166, __pyx_L1_error)

  /* "constants.auto.pyx":168
 * PARAM_DEVICE_IDENTIFIER = 7
 * ## Speed of the device: uint32_t
 * PARAM_DEVICE_SPEED = 8             # <<<<<<<<<<<<<<
 * ## Device is online: boolean
 * PARAM_DEVICE_ONLINE = 9
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_DEVICE_SPEED, __pyx_int_8) < 0) __PYX_ERR(3, 168, __pyx_L1_error)

  /* "constants.auto.pyx":170
 * PARAM_DEVICE_SPEED = 8
 * ## Device is online: boolean
 * PARAM_DEVICE_ONLINE = 9             # <<<<<<<<<<<<<<
 * ## Pass dot combinations (rather than characters): boolean
 * PARAM_RETAIN_DOTS = 10
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_DEVICE_ONLINE, __pyx_int_9) < 0) __PYX_ERR(3, 170, __pyx_L1_error)

  /* "constants.auto.pyx":172
 * PARAM_DEVICE_ONLINE = 9
 * ## Pass dot combinations (rather than characters): boolean
 * PARAM_RETAIN_DOTS = 10             # <<<<<<<<<<<<<<
 * ## Number of dots used to render a computer braille character: uint8_t (8 or 6)
 * PARAM_COMPUTER_BRAILLE_CELL_SIZE = 11
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_RETAIN_DOTS, __pyx_int_10) < 0) __PYX_ERR(3, 172, __pyx_L1_error)

  /* "constants.auto.pyx":174
 * PARAM_RETAIN_DOTS = 10
 * ## Number of dots used to render a computer braille character: uint8_t (8 or 6)
 * PARAM_COMPUTER_BRAILLE_CELL_SIZE = 11             # <<<<<<<<<<<<<<
 * ## Whether braille is literary (rather than computer): boolean
 * PARAM_LITERARY_BRAILLE = 12
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_COMPUTER_BRAILLE_CELL_SIZE, __pyx_int_11) < 0) __PYX_ERR(3, 174, __pyx_L1_error)

  /* "constants.auto.pyx":176
 * PARAM_COMPUTER_BRAILLE_CELL_SIZE = 11
 * ## Whether braille is literary (rather than computer): boolean
 * PARAM_LITERARY_BRAILLE = 12             # <<<<<<<<<<<<<<
 * ## Representation of the cursor: uint8_t (ISO 11548-1)
 * PARAM_CURSOR_DOTS = 13
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_LITERARY_BRAILLE, __pyx_int_12) < 0) __PYX_ERR(3, 176, __pyx_L1_error)

  /* "constants.auto.pyx":178
 * PARAM_LITERARY_BRAILLE = 12
 * ## Representation of the cursor: uint8_t (ISO 11548-1)
 * PARAM_CURSOR_DOTS = 13             # <<<<<<<<<<<<<<
 * ## Blinking period of the cursor: uint32_t (milliseconds)
 * PARAM_CURSOR_BLINK_PERIOD = 14
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_CURSOR_DOTS, __pyx_int_13) < 0) __PYX_ERR(3, 178, __pyx_L1_error)

  /* "constants.auto.pyx":180
 * PARAM_CURSOR_DOTS = 13
 * ## Blinking period of the cursor: uint32_t (milliseconds)
 * PARAM_CURSOR_BLINK_PERIOD = 14             # <<<<<<<<<<<<<<
 * ## Portion of the blinking period that the cursor is visible: uint8_t (from 0 through 100)
 * PARAM_CURSOR_BLINK_PERCENTAGE = 15
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_CURSOR_BLINK_PERIOD, __pyx_int_14) < 0) __PYX_ERR(3, 180, __pyx_L1_error)

  /* "constants.auto.pyx":182
 * PARAM_CURSOR_BLINK_PERIOD = 14
 * ## Portion of the blinking period that the cursor is visible: uint8_t (from 0 through 100)
 * PARAM_CURSOR_BLINK_PERCENTAGE = 15             # <<<<<<<<<<<<<<
 * ## Cells rendered by the client: uint8_t[] (ISO 11548-1), one cell per element
 * PARAM_RENDERED_CELLS = 16
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_CURSOR_BLINK_PERCENTAGE, __pyx_int_15) < 0) __PYX_ERR(3, 182, __pyx_L1_error)

  /* "constants.auto.pyx":184
 * PARAM_CURSOR_BLINK_PERCENTAGE = 15
 * ## Cells rendered by the client: uint8_t[] (ISO 11548-1), one cell per element
 * PARAM_RENDERED_CELLS = 16             # <<<<<<<<<<<<<<
 * ## Whether to skip identical screen lines: boolean
 * PARAM_SKIP_IDENTICAL_LINES = 17
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_RENDERED_CELLS, __pyx_int_16) < 0) __PYX_ERR(3, 184, __pyx_L1_error)

  /* "constants.auto.pyx":186
 * PARAM_RENDERED_CELLS = 16
 * ## Whether to skip identical screen lines: boolean
 * PARAM_SKIP_IDENTICAL_LINES = 17             # <<<<<<<<<<<<<<
 * ## Whether to use audible alerts: boolean
 * PARAM_AUDIBLE_ALERTS = 18
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_SKIP_IDENTICAL_LINES, __pyx_int_17) < 0) __PYX_ERR(3, 186, __pyx_L1_error)

  /* "constants.auto.pyx":188
 * PARAM_SKIP_IDENTICAL_LINES = 17
 * ## Whether to use audible alerts: boolean
 * PARAM_AUDIBLE_ALERTS = 18             # <<<<<<<<<<<<<<
 * ## Content of the clipboard: UTF-8 string
 * PARAM_CLIPBOARD_CONTENT = 19
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_AUDIBLE_ALERTS, __pyx_int_18) < 0) __PYX_ERR(3, 188, __pyx_L1_error)

  /* "constants.auto.pyx":190
 * PARAM_AUDIBLE_ALERTS = 18
 * ## Content of the clipboard: UTF-8 string
 * PARAM_CLIPBOARD_CONTENT = 19             # <<<<<<<<<<<<<<
 * ## Commands bound by the driver: uint64_t[], one command keycode per element
 * PARAM_BOUND_COMMAND_KEYCODES = 20
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_CLIPBOARD_CONTENT, __pyx_int_19) < 0) __PYX_ERR(3, 190, __pyx_L1_error)

  /* "constants.auto.pyx":192
 * PARAM_CLIPBOARD_CONTENT = 19
 * ## Commands bound by the driver: uint64_t[], one command keycode per element
 * PARAM_BOUND_COMMAND_KEYCODES = 20             # <<<<<<<<<<<<<<
 * ## Name for a command keycode (specified via the subparam argument): string (usually a few characters)
 * PARAM_COMMAND_KEYCODE_NAME = 21
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_BOUND_COMMAND_KEYCODES, __pyx_int_20) < 0) __PYX_ERR(3, 192, __pyx_L1_error)

  /* "constants.auto.pyx":194
 * PARAM_BOUND_COMMAND_KEYCODES = 20
 * ## Name for a command keycode (specified via the subparam argument): string (usually a few characters)
 * PARAM_COMMAND_KEYCODE_NAME = 21             # <<<<<<<<<<<<<<
 * ## Description for a command keycode (specified via the subparam argument): string (usually a few words)
 * PARAM_COMMAND_KEYCODE_SUMMARY = 22
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_COMMAND_KEYCODE_NAME, __pyx_int_21) < 0) __PYX_ERR(3, 194, __pyx_L1_error)

  /* "constants.auto.pyx":196
 * PARAM_COMMAND_KEYCODE_NAME = 21
 * ## Description for a command keycode (specified via the subparam argument): string (usually a few words)
 * PARAM_COMMAND_KEYCODE_SUMMARY = 22             # <<<<<<<<<<<<<<
 * ## Keycodes defined by the driver: uint64_t[], one keycode per element
 * PARAM_DEFINED_DRIVER_KEYCODES = 23
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_COMMAND_KEYCODE_SUMMARY, __pyx_int_22) < 0) __PYX_ERR(3, 196, __pyx_L1_error)

  /* "constants.auto.pyx":198
 * PARAM_COMMAND_KEYCODE_SUMMARY = 22
 * ## Keycodes defined by the driver: uint64_t[], one keycode per element
 * PARAM_DEFINED_DRIVER_KEYCODES = 23             # <<<<<<<<<<<<<<
 * ## Name for a driver keycode (specified via the subparam argument): string (usually a few characters)
 * PARAM_DRIVER_KEYCODE_NAME = 24
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_DEFINED_DRIVER_KEYCODES, __pyx_int_23) < 0) __PYX_ERR(3, 198, __pyx_L1_error)

  /* "constants.auto.pyx":200
 * PARAM_DEFINED_DRIVER_KEYCODES = 23
 * ## Name for a driver keycode (specified via the subparam argument): string (usually a few characters)
 * PARAM_DRIVER_KEYCODE_NAME = 24             # <<<<<<<<<<<<<<
 * ## Description for a driver keycode (specified via the subparam argument): string (usually a few words)
 * PARAM_DRIVER_KEYCODE_SUMMARY = 25
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_DRIVER_KEYCODE_NAME, __pyx_int_24) < 0) __PYX_ERR(3, 200, __pyx_L1_error)

  /* "constants.auto.pyx":202
 * PARAM_DRIVER_KEYCODE_NAME = 24
 * ## Description for a driver keycode (specified via the subparam argument): string (usually a few words)
 * PARAM_DRIVER_KEYCODE_SUMMARY = 25             # <<<<<<<<<<<<<<
 * ## Set of Unicode rows that are defined for computer braille (from U+0000 through U+10FFFF): uint8_t[544], one bit per row, eight rows per element
 * PARAM_COMPUTER_BRAILLE_ROWS_MASK = 26
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_DRIVER_KEYCODE_SUMMARY, __pyx_int_25) < 0) __PYX_ERR(3, 202, __pyx_L1_error)

  /* "constants.auto.pyx":204
 * PARAM_DRIVER_KEYCODE_SUMMARY = 25
 * ## Set of Unicode rows that are defined for computer braille (from U+0000 through U+10FFFF): uint8_t[544], one bit per row, eight rows per element
 * PARAM_COMPUTER_BRAILLE_ROWS_MASK = 26             # <<<<<<<<<<<<<<
 * ## Computer braille cells for a Unicode row (specified via the subparam argument): uint8_t[256] (ISO 11548-1), one cell per element
 * PARAM_COMPUTER_BRAILLE_ROW_CELLS = 27
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_COMPUTER_BRAILLE_ROWS_MASK, __pyx_int_26) < 0) __PYX_ERR(3, 204, __pyx_L1_error)

  /* "constants.auto.pyx":206
 * PARAM_COMPUTER_BRAILLE_ROWS_MASK = 26
 * ## Computer braille cells for a Unicode row (specified via the subparam argument): uint8_t[256] (ISO 11548-1), one cell per element
 * PARAM_COMPUTER_BRAILLE_ROW_CELLS = 27             # <<<<<<<<<<<<<<
 * ## Name of the computer braille table: string
 * PARAM_COMPUTER_BRAILLE_TABLE = 28
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_COMPUTER_BRAILLE_ROW_CELLS, __pyx_int_27) < 0) __PYX_ERR(3, 206, __pyx_L1_error)

  /* "constants.auto.pyx":208
 * PARAM_COMPUTER_BRAILLE_ROW_CELLS = 27
 * ## Name of the computer braille table: string
 * PARAM_COMPUTER_BRAILLE_TABLE = 28             # <<<<<<<<<<<<<<
 * ## Name of the literary braille table: string
 * PARAM_LITERARY_BRAILLE_TABLE = 29
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_COMPUTER_BRAILLE_TABLE, __pyx_int_28) < 0) __PYX_ERR(3, 208, __pyx_L1_error)

  /* "constants.auto.pyx":210
 * PARAM_COMPUTER_BRAILLE_TABLE = 28
 * ## Name of the literary braille table: string
 * PARAM_LITERARY_BRAILLE_TABLE = 29             # <<<<<<<<<<<<<<
 * ## Locale to use for messages: string
 * PARAM_MESSAGE_LOCALE = 30
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_LITERARY_BRAILLE_TABLE, __pyx_int_29) < 0) __PYX_ERR(3, 210, __pyx_L1_error)

  /* "constants.auto.pyx":212
 * PARAM_LITERARY_BRAILLE_TABLE = 29
 * ## Locale to use for messages: string
 * PARAM_MESSAGE_LOCALE = 30             # <<<<<<<<<<<<<<
 * ## Number of parameters
 * PARAM_COUNT = 32
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_MESSAGE_LOCALE, __pyx_int_30) < 0) __PYX_ERR(3, 212, __pyx_L1_error)

  /* "constants.auto.pyx":214
 * PARAM_MESSAGE_LOCALE = 30
 * ## Number of parameters
 * PARAM_COUNT = 32             # <<<<<<<<<<<<<<
 * ## Parameter is a string of UTF-8 characters
 * PARAM_TYPE_STRING = 0
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_COUNT, __pyx_int_32) < 0) __PYX_ERR(3, 214, __pyx_L1_error)

  /* "constants.auto.pyx":216
 * PARAM_COUNT = 32
 * ## Parameter is a string of UTF-8 characters
 * PARAM_TYPE_STRING = 0             # <<<<<<<<<<<<<<
 * ## Parameter is one or more booleans represented by a uint8_t
 * PARAM_TYPE_BOOLEAN = 1
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_TYPE_STRING, __pyx_int_0) < 0) __PYX_ERR(3, 216, __pyx_L1_error)

  /* "constants.auto.pyx":218
 * PARAM_TYPE_STRING = 0
 * ## Parameter is one or more booleans represented by a uint8_t
 * PARAM_TYPE_BOOLEAN = 1             # <<<<<<<<<<<<<<
 * ## Parameter is one or more 8-bit unsigned integers
 * PARAM_TYPE_UINT8 = 2
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_TYPE_BOOLEAN, __pyx_int_1) < 0) __PYX_ERR(3, 218, __pyx_L1_error)

  /* "constants.auto.pyx":220
 * PARAM_TYPE_BOOLEAN = 1
 * ## Parameter is one or more 8-bit unsigned integers
 * PARAM_TYPE_UINT8 = 2             # <<<<<<<<<<<<<<
 * ## Parameter is one or more 16-bit unsigned integers
 * PARAM_TYPE_UINT16 = 3
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_TYPE_UINT8, __pyx_int_2) < 0) __PYX_ERR(3, 220, __pyx_L1_error)

  /* "constants.auto.pyx":222
 * PARAM_TYPE_UINT8 = 2
 * ## Parameter is one or more 16-bit unsigned integers
 * PARAM_TYPE_UINT16 = 3             # <<<<<<<<<<<<<<
 * ## Parameter is one or more 32-bit unsigned integers
 * PARAM_TYPE_UINT32 = 4
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_TYPE_UINT16, __pyx_int_3) < 0) __PYX_ERR(3, 222, __pyx_L1_error)

  /* "constants.auto.pyx":224
 * PARAM_TYPE_UINT16 = 3
 * ## Parameter is one or more 32-bit unsigned integers
 * PARAM_TYPE_UINT32 = 4             # <<<<<<<<<<<<<<
 * ## Parameter is one or more 64-bit unsigned integers
 * PARAM_TYPE_UINT64 = 5
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_TYPE_UINT32, __pyx_int_4) < 0) __PYX_ERR(3, 224, __pyx_L1_error)

  /* "constants.auto.pyx":226
 * PARAM_TYPE_UINT32 = 4
 * ## Parameter is one or more 64-bit unsigned integers
 * PARAM_TYPE_UINT64 = 5             # <<<<<<<<<<<<<<
 * ## Parameter is one or more key codes
 * PARAM_TYPE_KEYCODE = 5
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_TYPE_UINT64, __pyx_int_5) < 0) __PYX_ERR(3, 226, __pyx_L1_error)

  /* "constants.auto.pyx":228
 * PARAM_TYPE_UINT64 = 5
 * ## Parameter is one or more key codes
 * PARAM_TYPE_KEYCODE = 5             # <<<<<<<<<<<<<<
 * ## do nothing
 * KEY_CMD_NOOP = 0
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PARAM_TYPE_KEYCODE, __pyx_int_5) < 0) __PYX_ERR(3, 228, __pyx_L1_error)

  /* "constants.auto.pyx":230
 * PARAM_TYPE_KEYCODE = 5
 * ## do nothing
 * KEY_CMD_NOOP = 0             # <<<<<<<<<<<<<<
 * ## go up one line
 * KEY_CMD_LNUP = 1
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_NOOP, __pyx_int_0) < 0) __PYX_ERR(3, 230, __pyx_L1_error)

  /* "constants.auto.pyx":232
 * KEY_CMD_NOOP = 0
 * ## go up one line
 * KEY_CMD_LNUP = 1             # <<<<<<<<<<<<<<
 * ## go down one line
 * KEY_CMD_LNDN = 2
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_LNUP, __pyx_int_1) < 0) __PYX_ERR(3, 232, __pyx_L1_error)

  /* "constants.auto.pyx":234
 * KEY_CMD_LNUP = 1
 * ## go down one line
 * KEY_CMD_LNDN = 2             # <<<<<<<<<<<<<<
 * ## go up several lines
 * KEY_CMD_WINUP = 3
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_LNDN, __pyx_int_2) < 0) __PYX_ERR(3, 234, __pyx_L1_error)

  /* "constants.auto.pyx":236
 * KEY_CMD_LNDN = 2
 * ## go up several lines
 * KEY_CMD_WINUP = 3             # <<<<<<<<<<<<<<
 * ## go down several lines
 * KEY_CMD_WINDN = 4
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_WINUP, __pyx_int_3) < 0) __PYX_ERR(3, 236, __pyx_L1_error)

  /* "constants.auto.pyx":238
 * KEY_CMD_WINUP = 3
 * ## go down several lines
 * KEY_CMD_WINDN = 4             # <<<<<<<<<<<<<<
 * ## go up to nearest line with different content
 * KEY_CMD_PRDIFLN = 5
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_WINDN, __pyx_int_4) < 0) __PYX_ERR(3, 238, __pyx_L1_error)

  /* "constants.auto.pyx":240
 * KEY_CMD_WINDN = 4
 * ## go up to nearest line with different content
 * KEY_CMD_PRDIFLN = 5             # <<<<<<<<<<<<<<
 * ## go down to nearest line with different content
 * KEY_CMD_NXDIFLN = 6
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_PRDIFLN, __pyx_int_5) < 0) __PYX_ERR(3, 240, __pyx_L1_error)

  /* "constants.auto.pyx":242
 * KEY_CMD_PRDIFLN = 5
 * ## go down to nearest line with different content
 * KEY_CMD_NXDIFLN = 6             # <<<<<<<<<<<<<<
 * ## go up to nearest line with different highlighting
 * KEY_CMD_ATTRUP = 7
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_NXDIFLN, __pyx_int_6) < 0) __PYX_ERR(3, 242, __pyx_L1_error)

  /* "constants.auto.pyx":244
 * KEY_CMD_NXDIFLN = 6
 * ## go up to nearest line with different highlighting
 * KEY_CMD_ATTRUP = 7             # <<<<<<<<<<<<<<
 * ## go down to nearest line with different highlighting
 * KEY_CMD_ATTRDN = 8
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_ATTRUP, __pyx_int_7) < 0) __PYX_ERR(3, 244, __pyx_L1_error)

  /* "constants.auto.pyx":246
 * KEY_CMD_ATTRUP = 7
 * ## go down to nearest line with different highlighting
 * KEY_CMD_ATTRDN = 8             # <<<<<<<<<<<<<<
 * ## go to top line
 * KEY_CMD_TOP = 9
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_ATTRDN, __pyx_int_8) < 0) __PYX_ERR(3, 246, __pyx_L1_error)

  /* "constants.auto.pyx":248
 * KEY_CMD_ATTRDN = 8
 * ## go to top line
 * KEY_CMD_TOP = 9             # <<<<<<<<<<<<<<
 * ## go to bottom line
 * KEY_CMD_BOT = 10
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_TOP, __pyx_int_9) < 0) __PYX_ERR(3, 248, __pyx_L1_error)

  /* "constants.auto.pyx":250
 * KEY_CMD_TOP = 9
 * ## go to bottom line
 * KEY_CMD_BOT = 10             # <<<<<<<<<<<<<<
 * ## go to beginning of top line
 * KEY_CMD_TOP_LEFT = 11
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_BOT, __pyx_int_10) < 0) __PYX_ERR(3, 250, __pyx_L1_error)

  /* "constants.auto.pyx":252
 * KEY_CMD_BOT = 10
 * ## go to beginning of top line
 * KEY_CMD_TOP_LEFT = 11             # <<<<<<<<<<<<<<
 * ## go to beginning of bottom line
 * KEY_CMD_BOT_LEFT = 12
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_TOP_LEFT, __pyx_int_11) < 0) __PYX_ERR(3, 252, __pyx_L1_error)

  /* "constants.auto.pyx":254
 * KEY_CMD_TOP_LEFT = 11
 * ## go to beginning of bottom line
 * KEY_CMD_BOT_LEFT = 12             # <<<<<<<<<<<<<<
 * ## go up to first line of paragraph
 * KEY_CMD_PRPGRPH = 13
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_BOT_LEFT, __pyx_int_12) < 0) __PYX_ERR(3, 254, __pyx_L1_error)

  /* "constants.auto.pyx":256
 * KEY_CMD_BOT_LEFT = 12
 * ## go up to first line of paragraph
 * KEY_CMD_PRPGRPH = 13             # <<<<<<<<<<<<<<
 * ## go down to first line of next paragraph
 * KEY_CMD_NXPGRPH = 14
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_PRPGRPH, __pyx_int_13) < 0) __PYX_ERR(3, 256, __pyx_L1_error)

  /* "constants.auto.pyx":258
 * KEY_CMD_PRPGRPH = 13
 * ## go down to first line of next paragraph
 * KEY_CMD_NXPGRPH = 14             # <<<<<<<<<<<<<<
 * ## go up to previous command prompt
 * KEY_CMD_PRPROMPT = 15
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_NXPGRPH, __pyx_int_14) < 0) __PYX_ERR(3, 258, __pyx_L1_error)

  /* "constants.auto.pyx":260
 * KEY_CMD_NXPGRPH = 14
 * ## go up to previous command prompt
 * KEY_CMD_PRPROMPT = 15             # <<<<<<<<<<<<<<
 * ## go down to next command prompt
 * KEY_CMD_NXPROMPT = 16
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_PRPROMPT, __pyx_int_15) < 0) __PYX_ERR(3, 260, __pyx_L1_error)

  /* "constants.auto.pyx":262
 * KEY_CMD_PRPROMPT = 15
 * ## go down to next command prompt
 * KEY_CMD_NXPROMPT = 16             # <<<<<<<<<<<<<<
 * ## search backward for clipboard text
 * KEY_CMD_PRSEARCH = 17
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_NXPROMPT, __pyx_int_16) < 0) __PYX_ERR(3, 262, __pyx_L1_error)

  /* "constants.auto.pyx":264
 * KEY_CMD_NXPROMPT = 16
 * ## search backward for clipboard text
 * KEY_CMD_PRSEARCH = 17             # <<<<<<<<<<<<<<
 * ## search forward for clipboard text
 * KEY_CMD_NXSEARCH = 18
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_PRSEARCH, __pyx_int_17) < 0) __PYX_ERR(3, 264, __pyx_L1_error)

  /* "constants.auto.pyx":266
 * KEY_CMD_PRSEARCH = 17
 * ## search forward for clipboard text
 * KEY_CMD_NXSEARCH = 18             # <<<<<<<<<<<<<<
 * ## go left one character
 * KEY_CMD_CHRLT = 19
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_NXSEARCH, __pyx_int_18) < 0) __PYX_ERR(3, 266, __pyx_L1_error)

  /* "constants.auto.pyx":268
 * KEY_CMD_NXSEARCH = 18
 * ## go left one character
 * KEY_CMD_CHRLT = 19             # <<<<<<<<<<<<<<
 * ## go right one character
 * KEY_CMD_CHRRT = 20
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_CHRLT, __pyx_int_19) < 0) __PYX_ERR(3, 268, __pyx_L1_error)

  /* "constants.auto.pyx":270
 * KEY_CMD_CHRLT = 19
 * ## go right one character
 * KEY_CMD_CHRRT = 20             # <<<<<<<<<<<<<<
 * ## go left half a braille window
 * KEY_CMD_HWINLT = 21
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_CHRRT, __pyx_int_20) < 0) __PYX_ERR(3, 270, __pyx_L1_error)

  /* "constants.auto.pyx":272
 * KEY_CMD_CHRRT = 20
 * ## go left half a braille window
 * KEY_CMD_HWINLT = 21             # <<<<<<<<<<<<<<
 * ## go right half a braille window
 * KEY_CMD_HWINRT = 22
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_HWINLT, __pyx_int_21) < 0) __PYX_ERR(3, 272, __pyx_L1_error)

  /* "constants.auto.pyx":274
 * KEY_CMD_HWINLT = 21
 * ## go right half a braille window
 * KEY_CMD_HWINRT = 22             # <<<<<<<<<<<<<<
 * ## go backward one braille window
 * KEY_CMD_FWINLT = 23
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_HWINRT, __pyx_int_22) < 0) __PYX_ERR(3, 274, __pyx_L1_error)

  /* "constants.auto.pyx":276
 * KEY_CMD_HWINRT = 22
 * ## go backward one braille window
 * KEY_CMD_FWINLT = 23             # <<<<<<<<<<<<<<
 * ## go forward one braille window
 * KEY_CMD_FWINRT = 24
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_FWINLT, __pyx_int_23) < 0) __PYX_ERR(3, 276, __pyx_L1_error)

  /* "constants.auto.pyx":278
 * KEY_CMD_FWINLT = 23
 * ## go forward one braille window
 * KEY_CMD_FWINRT = 24             # <<<<<<<<<<<<<<
 * ## go backward skipping blank braille windows
 * KEY_CMD_FWINLTSKIP = 25
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_FWINRT, __pyx_int_24) < 0) __PYX_ERR(3, 278, __pyx_L1_error)

  /* "constants.auto.pyx":280
 * KEY_CMD_FWINRT = 24
 * ## go backward skipping blank braille windows
 * KEY_CMD_FWINLTSKIP = 25             # <<<<<<<<<<<<<<
 * ## go forward skipping blank braille windows
 * KEY_CMD_FWINRTSKIP = 26
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_FWINLTSKIP, __pyx_int_25) < 0) __PYX_ERR(3, 280, __pyx_L1_error)

  /* "constants.auto.pyx":282
 * KEY_CMD_FWINLTSKIP = 25
 * ## go forward skipping blank braille windows
 * KEY_CMD_FWINRTSKIP = 26             # <<<<<<<<<<<<<<
 * ## go to beginning of line
 * KEY_CMD_LNBEG = 27
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_FWINRTSKIP, __pyx_int_26) < 0) __PYX_ERR(3, 282, __pyx_L1_error)

  /* "constants.auto.pyx":284
 * KEY_CMD_FWINRTSKIP = 26
 * ## go to beginning of line
 * KEY_CMD_LNBEG = 27             # <<<<<<<<<<<<<<
 * ## go to end of line
 * KEY_CMD_LNEND = 28
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_LNBEG, __pyx_int_27) < 0) __PYX_ERR(3, 284, __pyx_L1_error)

  /* "constants.auto.pyx":286
 * KEY_CMD_LNBEG = 27
 * ## go to end of line
 * KEY_CMD_LNEND = 28             # <<<<<<<<<<<<<<
 * ## go to screen cursor
 * KEY_CMD_HOME = 29
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_LNEND, __pyx_int_28) < 0) __PYX_ERR(3, 286, __pyx_L1_error)

  /* "constants.auto.pyx":288
 * KEY_CMD_LNEND = 28
 * ## go to screen cursor
 * KEY_CMD_HOME = 29             # <<<<<<<<<<<<<<
 * ## go back after cursor tracking
 * KEY_CMD_BACK = 30
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_HOME, __pyx_int_29) < 0) __PYX_ERR(3, 288, __pyx_L1_error)

  /* "constants.auto.pyx":290
 * KEY_CMD_HOME = 29
 * ## go back after cursor tracking
 * KEY_CMD_BACK = 30             # <<<<<<<<<<<<<<
 * ## go to screen cursor or go back after cursor tracking
 * KEY_CMD_RETURN = 31
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_BACK, __pyx_int_30) < 0) __PYX_ERR(3, 290, __pyx_L1_error)

  /* "constants.auto.pyx":292
 * KEY_CMD_BACK = 30
 * ## go to screen cursor or go back after cursor tracking
 * KEY_CMD_RETURN = 31             # <<<<<<<<<<<<<<
 * ## set screen image frozen/unfrozen
 * KEY_CMD_FREEZE = 32
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_RETURN, __pyx_int_31) < 0) __PYX_ERR(3, 292, __pyx_L1_error)

  /* "constants.auto.pyx":294
 * KEY_CMD_RETURN = 31
 * ## set screen image frozen/unfrozen
 * KEY_CMD_FREEZE = 32             # <<<<<<<<<<<<<<
 * ## set display mode attributes/text
 * KEY_CMD_DISPMD = 33
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_FREEZE, __pyx_int_32) < 0) __PYX_ERR(3, 294, __pyx_L1_error)

  /* "constants.auto.pyx":296
 * KEY_CMD_FREEZE = 32
 * ## set display mode attributes/text
 * KEY_CMD_DISPMD = 33             # <<<<<<<<<<<<<<
 * ## set text style 6-dot/8-dot
 * KEY_CMD_SIXDOTS = 34
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_DISPMD, __pyx_int_33) < 0) __PYX_ERR(3, 296, __pyx_L1_error)

  /* "constants.auto.pyx":298
 * KEY_CMD_DISPMD = 33
 * ## set text style 6-dot/8-dot
 * KEY_CMD_SIXDOTS = 34             # <<<<<<<<<<<<<<
 * ## set sliding braille window on/off
 * KEY_CMD_SLIDEWIN = 35
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SIXDOTS, __pyx_int_34) < 0) __PYX_ERR(3, 298, __pyx_L1_error)

  /* "constants.auto.pyx":300
 * KEY_CMD_SIXDOTS = 34
 * ## set sliding braille window on/off
 * KEY_CMD_SLIDEWIN = 35             # <<<<<<<<<<<<<<
 * ## set skipping of lines with identical content on/off
 * KEY_CMD_SKPIDLNS = 36
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SLIDEWIN, __pyx_int_35) < 0) __PYX_ERR(3, 300, __pyx_L1_error)

  /* "constants.auto.pyx":302
 * KEY_CMD_SLIDEWIN = 35
 * ## set skipping of lines with identical content on/off
 * KEY_CMD_SKPIDLNS = 36             # <<<<<<<<<<<<<<
 * ## set skipping of blank braille windows on/off
 * KEY_CMD_SKPBLNKWINS = 37
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SKPIDLNS, __pyx_int_36) < 0) __PYX_ERR(3, 302, __pyx_L1_error)

  /* "constants.auto.pyx":304
 * KEY_CMD_SKPIDLNS = 36
 * ## set skipping of blank braille windows on/off
 * KEY_CMD_SKPBLNKWINS = 37             # <<<<<<<<<<<<<<
 * ## set screen cursor visibility on/off
 * KEY_CMD_CSRVIS = 38
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SKPBLNKWINS, __pyx_int_37) < 0) __PYX_ERR(3, 304, __pyx_L1_error)

  /* "constants.auto.pyx":306
 * KEY_CMD_SKPBLNKWINS = 37
 * ## set screen cursor visibility on/off
 * KEY_CMD_CSRVIS = 38             # <<<<<<<<<<<<<<
 * ## set hidden screen cursor on/off
 * KEY_CMD_CSRHIDE = 39
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_CSRVIS, __pyx_int_38) < 0) __PYX_ERR(3, 306, __pyx_L1_error)

  /* "constants.auto.pyx":308
 * KEY_CMD_CSRVIS = 38
 * ## set hidden screen cursor on/off
 * KEY_CMD_CSRHIDE = 39             # <<<<<<<<<<<<<<
 * ## set track screen cursor on/off
 * KEY_CMD_CSRTRK = 40
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_CSRHIDE, __pyx_int_39) < 0) __PYX_ERR(3, 308, __pyx_L1_error)

  /* "constants.auto.pyx":310
 * KEY_CMD_CSRHIDE = 39
 * ## set track screen cursor on/off
 * KEY_CMD_CSRTRK = 40             # <<<<<<<<<<<<<<
 * ## set screen cursor style block/underline
 * KEY_CMD_CSRSIZE = 41
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_CSRTRK, __pyx_int_40) < 0) __PYX_ERR(3, 310, __pyx_L1_error)

  /* "constants.auto.pyx":312
 * KEY_CMD_CSRTRK = 40
 * ## set screen cursor style block/underline
 * KEY_CMD_CSRSIZE = 41             # <<<<<<<<<<<<<<
 * ## set screen cursor blinking on/off
 * KEY_CMD_CSRBLINK = 42
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_CSRSIZE, __pyx_int_41) < 0) __PYX_ERR(3, 312, __pyx_L1_error)

  /* "constants.auto.pyx":314
 * KEY_CMD_CSRSIZE = 41
 * ## set screen cursor blinking on/off
 * KEY_CMD_CSRBLINK = 42             # <<<<<<<<<<<<<<
 * ## set attribute underlining on/off
 * KEY_CMD_ATTRVIS = 43
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_CSRBLINK, __pyx_int_42) < 0) __PYX_ERR(3, 314, __pyx_L1_error)

  /* "constants.auto.pyx":316
 * KEY_CMD_CSRBLINK = 42
 * ## set attribute underlining on/off
 * KEY_CMD_ATTRVIS = 43             # <<<<<<<<<<<<<<
 * ## set attribute blinking on/off
 * KEY_CMD_ATTRBLINK = 44
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_ATTRVIS, __pyx_int_43) < 0) __PYX_ERR(3, 316, __pyx_L1_error)

  /* "constants.auto.pyx":318
 * KEY_CMD_ATTRVIS = 43
 * ## set attribute blinking on/off
 * KEY_CMD_ATTRBLINK = 44             # <<<<<<<<<<<<<<
 * ## set capital letter blinking on/off
 * KEY_CMD_CAPBLINK = 45
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_ATTRBLINK, __pyx_int_44) < 0) __PYX_ERR(3, 318, __pyx_L1_error)

  /* "constants.auto.pyx":320
 * KEY_CMD_ATTRBLINK = 44
 * ## set capital letter blinking on/off
 * KEY_CMD_CAPBLINK = 45             # <<<<<<<<<<<<<<
 * ## set alert tunes on/off
 * KEY_CMD_TUNES = 46
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_CAPBLINK, __pyx_int_45) < 0) __PYX_ERR(3, 320, __pyx_L1_error)

  /* "constants.auto.pyx":322
 * KEY_CMD_CAPBLINK = 45
 * ## set alert tunes on/off
 * KEY_CMD_TUNES = 46             # <<<<<<<<<<<<<<
 * ## set autorepeat on/off
 * KEY_CMD_AUTOREPEAT = 47
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_TUNES, __pyx_int_46) < 0) __PYX_ERR(3, 322, __pyx_L1_error)

  /* "constants.auto.pyx":324
 * KEY_CMD_TUNES = 46
 * ## set autorepeat on/off
 * KEY_CMD_AUTOREPEAT = 47             # <<<<<<<<<<<<<<
 * ## set autospeak on/off
 * KEY_CMD_AUTOSPEAK = 48
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_AUTOREPEAT, __pyx_int_47) < 0) __PYX_ERR(3, 324, __pyx_L1_error)

  /* "constants.auto.pyx":326
 * KEY_CMD_AUTOREPEAT = 47
 * ## set autospeak on/off
 * KEY_CMD_AUTOSPEAK = 48             # <<<<<<<<<<<<<<
 * ## enter/leave help display
 * KEY_CMD_HELP = 49
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_AUTOSPEAK, __pyx_int_48) < 0) __PYX_ERR(3, 326, __pyx_L1_error)

  /* "constants.auto.pyx":328
 * KEY_CMD_AUTOSPEAK = 48
 * ## enter/leave help display
 * KEY_CMD_HELP = 49             # <<<<<<<<<<<<<<
 * ## enter/leave status display
 * KEY_CMD_INFO = 50
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_HELP, __pyx_int_49) < 0) __PYX_ERR(3, 328, __pyx_L1_error)

  /* "constants.auto.pyx":330
 * KEY_CMD_HELP = 49
 * ## enter/leave status display
 * KEY_CMD_INFO = 50             # <<<<<<<<<<<<<<
 * ## enter/leave command learn mode
 * KEY_CMD_LEARN = 51
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_INFO, __pyx_int_50) < 0) __PYX_ERR(3, 330, __pyx_L1_error)

  /* "constants.auto.pyx":332
 * KEY_CMD_INFO = 50
 * ## enter/leave command learn mode
 * KEY_CMD_LEARN = 51             # <<<<<<<<<<<<<<
 * ## enter/leave preferences menu
 * KEY_CMD_PREFMENU = 52
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_LEARN, __pyx_int_51) < 0) __PYX_ERR(3, 332, __pyx_L1_error)

  /* "constants.auto.pyx":334
 * KEY_CMD_LEARN = 51
 * ## enter/leave preferences menu
 * KEY_CMD_PREFMENU = 52             # <<<<<<<<<<<<<<
 * ## save preferences to disk
 * KEY_CMD_PREFSAVE = 53
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_PREFMENU, __pyx_int_52) < 0) __PYX_ERR(3, 334, __pyx_L1_error)

  /* "constants.auto.pyx":336
 * KEY_CMD_PREFMENU = 52
 * ## save preferences to disk
 * KEY_CMD_PREFSAVE = 53             # <<<<<<<<<<<<<<
 * ## restore preferences from disk
 * KEY_CMD_PREFLOAD = 54
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_PREFSAVE, __pyx_int_53) < 0) __PYX_ERR(3, 336, __pyx_L1_error)

  /* "constants.auto.pyx":338
 * KEY_CMD_PREFSAVE = 53
 * ## restore preferences from disk
 * KEY_CMD_PREFLOAD = 54             # <<<<<<<<<<<<<<
 * ## go up to first item
 * KEY_CMD_MENU_FIRST_ITEM = 55
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_PREFLOAD, __pyx_int_54) < 0) __PYX_ERR(3, 338, __pyx_L1_error)

  /* "constants.auto.pyx":340
 * KEY_CMD_PREFLOAD = 54
 * ## go up to first item
 * KEY_CMD_MENU_FIRST_ITEM = 55             # <<<<<<<<<<<<<<
 * ## go down to last item
 * KEY_CMD_MENU_LAST_ITEM = 56
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_MENU_FIRST_ITEM, __pyx_int_55) < 0) __PYX_ERR(3, 340, __pyx_L1_error)

  /* "constants.auto.pyx":342
 * KEY_CMD_MENU_FIRST_ITEM = 55
 * ## go down to last item
 * KEY_CMD_MENU_LAST_ITEM = 56             # <<<<<<<<<<<<<<
 * ## go up to previous item
 * KEY_CMD_MENU_PREV_ITEM = 57
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_MENU_LAST_ITEM, __pyx_int_56) < 0) __PYX_ERR(3, 342, __pyx_L1_error)

  /* "constants.auto.pyx":344
 * KEY_CMD_MENU_LAST_ITEM = 56
 * ## go up to previous item
 * KEY_CMD_MENU_PREV_ITEM = 57             # <<<<<<<<<<<<<<
 * ## go down to next item
 * KEY_CMD_MENU_NEXT_ITEM = 58
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_MENU_PREV_ITEM, __pyx_int_57) < 0) __PYX_ERR(3, 344, __pyx_L1_error)

  /* "constants.auto.pyx":346
 * KEY_CMD_MENU_PREV_ITEM = 57
 * ## go down to next item
 * KEY_CMD_MENU_NEXT_ITEM = 58             # <<<<<<<<<<<<<<
 * ## select previous choice
 * KEY_CMD_MENU_PREV_SETTING = 59
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_MENU_NEXT_ITEM, __pyx_int_58) < 0) __PYX_ERR(3, 346, __pyx_L1_error)

  /* "constants.auto.pyx":348
 * KEY_CMD_MENU_NEXT_ITEM = 58
 * ## select previous choice
 * KEY_CMD_MENU_PREV_SETTING = 59             # <<<<<<<<<<<<<<
 * ## select next choice
 * KEY_CMD_MENU_NEXT_SETTING = 60
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_MENU_PREV_SETTING, __pyx_int_59) < 0) __PYX_ERR(3, 348, __pyx_L1_error)

  /* "constants.auto.pyx":350
 * KEY_CMD_MENU_PREV_SETTING = 59
 * ## select next choice
 * KEY_CMD_MENU_NEXT_SETTING = 60             # <<<<<<<<<<<<<<
 * ## stop speaking
 * KEY_CMD_MUTE = 61
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_MENU_NEXT_SETTING, __pyx_int_60) < 0) __PYX_ERR(3, 350, __pyx_L1_error)

  /* "constants.auto.pyx":352
 * KEY_CMD_MENU_NEXT_SETTING = 60
 * ## stop speaking
 * KEY_CMD_MUTE = 61             # <<<<<<<<<<<<<<
 * ## go to current speaking position
 * KEY_CMD_SPKHOME = 62
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_MUTE, __pyx_int_61) < 0) __PYX_ERR(3, 352, __pyx_L1_error)

  /* "constants.auto.pyx":354
 * KEY_CMD_MUTE = 61
 * ## go to current speaking position
 * KEY_CMD_SPKHOME = 62             # <<<<<<<<<<<<<<
 * ## speak current line
 * KEY_CMD_SAY_LINE = 63
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SPKHOME, __pyx_int_62) < 0) __PYX_ERR(3, 354, __pyx_L1_error)

  /* "constants.auto.pyx":356
 * KEY_CMD_SPKHOME = 62
 * ## speak current line
 * KEY_CMD_SAY_LINE = 63             # <<<<<<<<<<<<<<
 * ## speak from top of screen through current line
 * KEY_CMD_SAY_ABOVE = 64
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SAY_LINE, __pyx_int_63) < 0) __PYX_ERR(3, 356, __pyx_L1_error)

  /* "constants.auto.pyx":358
 * KEY_CMD_SAY_LINE = 63
 * ## speak from top of screen through current line
 * KEY_CMD_SAY_ABOVE = 64             # <<<<<<<<<<<<<<
 * ## speak from current line through bottom of screen
 * KEY_CMD_SAY_BELOW = 65
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SAY_ABOVE, __pyx_int_64) < 0) __PYX_ERR(3, 358, __pyx_L1_error)

  /* "constants.auto.pyx":360
 * KEY_CMD_SAY_ABOVE = 64
 * ## speak from current line through bottom of screen
 * KEY_CMD_SAY_BELOW = 65             # <<<<<<<<<<<<<<
 * ## decrease speaking rate
 * KEY_CMD_SAY_SLOWER = 66
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SAY_BELOW, __pyx_int_65) < 0) __PYX_ERR(3, 360, __pyx_L1_error)

  /* "constants.auto.pyx":362
 * KEY_CMD_SAY_BELOW = 65
 * ## decrease speaking rate
 * KEY_CMD_SAY_SLOWER = 66             # <<<<<<<<<<<<<<
 * ## increase speaking rate
 * KEY_CMD_SAY_FASTER = 67
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SAY_SLOWER, __pyx_int_66) < 0) __PYX_ERR(3, 362, __pyx_L1_error)

  /* "constants.auto.pyx":364
 * KEY_CMD_SAY_SLOWER = 66
 * ## increase speaking rate
 * KEY_CMD_SAY_FASTER = 67             # <<<<<<<<<<<<<<
 * ## decrease speaking volume
 * KEY_CMD_SAY_SOFTER = 68
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SAY_FASTER, __pyx_int_67) < 0) __PYX_ERR(3, 364, __pyx_L1_error)

  /* "constants.auto.pyx":366
 * KEY_CMD_SAY_FASTER = 67
 * ## decrease speaking volume
 * KEY_CMD_SAY_SOFTER = 68             # <<<<<<<<<<<<<<
 * ## increase speaking volume
 * KEY_CMD_SAY_LOUDER = 69
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SAY_SOFTER, __pyx_int_68) < 0) __PYX_ERR(3, 366, __pyx_L1_error)

  /* "constants.auto.pyx":368
 * KEY_CMD_SAY_SOFTER = 68
 * ## increase speaking volume
 * KEY_CMD_SAY_LOUDER = 69             # <<<<<<<<<<<<<<
 * ## switch to the previous virtual terminal
 * KEY_CMD_SWITCHVT_PREV = 70
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SAY_LOUDER, __pyx_int_69) < 0) __PYX_ERR(3, 368, __pyx_L1_error)

  /* "constants.auto.pyx":370
 * KEY_CMD_SAY_LOUDER = 69
 * ## switch to the previous virtual terminal
 * KEY_CMD_SWITCHVT_PREV = 70             # <<<<<<<<<<<<<<
 * ## switch to the next virtual terminal
 * KEY_CMD_SWITCHVT_NEXT = 71
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SWITCHVT_PREV, __pyx_int_70) < 0) __PYX_ERR(3, 370, __pyx_L1_error)

  /* "constants.auto.pyx":372
 * KEY_CMD_SWITCHVT_PREV = 70
 * ## switch to the next virtual terminal
 * KEY_CMD_SWITCHVT_NEXT = 71             # <<<<<<<<<<<<<<
 * ## bring screen cursor to current line
 * KEY_CMD_CSRJMP_VERT = 72
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SWITCHVT_NEXT, __pyx_int_71) < 0) __PYX_ERR(3, 372, __pyx_L1_error)

  /* "constants.auto.pyx":374
 * KEY_CMD_SWITCHVT_NEXT = 71
 * ## bring screen cursor to current line
 * KEY_CMD_CSRJMP_VERT = 72             # <<<<<<<<<<<<<<
 * ## insert clipboard text after screen cursor
 * KEY_CMD_PASTE = 73
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_CSRJMP_VERT, __pyx_int_72) < 0) __PYX_ERR(3, 374, __pyx_L1_error)

  /* "constants.auto.pyx":376
 * KEY_CMD_CSRJMP_VERT = 72
 * ## insert clipboard text after screen cursor
 * KEY_CMD_PASTE = 73             # <<<<<<<<<<<<<<
 * ## restart braille driver
 * KEY_CMD_RESTARTBRL = 74
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_PASTE, __pyx_int_73) < 0) __PYX_ERR(3, 376, __pyx_L1_error)

  /* "constants.auto.pyx":378
 * KEY_CMD_PASTE = 73
 * ## restart braille driver
 * KEY_CMD_RESTARTBRL = 74             # <<<<<<<<<<<<<<
 * ## restart speech driver
 * KEY_CMD_RESTARTSPEECH = 75
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_RESTARTBRL, __pyx_int_74) < 0) __PYX_ERR(3, 378, __pyx_L1_error)

  /* "constants.auto.pyx":380
 * KEY_CMD_RESTARTBRL = 74
 * ## restart speech driver
 * KEY_CMD_RESTARTSPEECH = 75             # <<<<<<<<<<<<<<
 * ## braille display temporarily unavailable
 * KEY_CMD_OFFLINE = 76
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_RESTARTSPEECH, __pyx_int_75) < 0) __PYX_ERR(3, 380, __pyx_L1_error)

  /* "constants.auto.pyx":382
 * KEY_CMD_RESTARTSPEECH = 75
 * ## braille display temporarily unavailable
 * KEY_CMD_OFFLINE = 76             # <<<<<<<<<<<<<<
 * ## cycle the Shift sticky input modifier (next, on, off)
 * KEY_CMD_SHIFT = 77
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_OFFLINE, __pyx_int_76) < 0) __PYX_ERR(3, 382, __pyx_L1_error)

  /* "constants.auto.pyx":384
 * KEY_CMD_OFFLINE = 76
 * ## cycle the Shift sticky input modifier (next, on, off)
 * KEY_CMD_SHIFT = 77             # <<<<<<<<<<<<<<
 * ## cycle the Upper sticky input modifier (next, on, off)
 * KEY_CMD_UPPER = 78
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SHIFT, __pyx_int_77) < 0) __PYX_ERR(3, 384, __pyx_L1_error)

  /* "constants.auto.pyx":386
 * KEY_CMD_SHIFT = 77
 * ## cycle the Upper sticky input modifier (next, on, off)
 * KEY_CMD_UPPER = 78             # <<<<<<<<<<<<<<
 * ## cycle the Control sticky input modifier (next, on, off)
 * KEY_CMD_CONTROL = 79
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_UPPER, __pyx_int_78) < 0) __PYX_ERR(3, 386, __pyx_L1_error)

  /* "constants.auto.pyx":388
 * KEY_CMD_UPPER = 78
 * ## cycle the Control sticky input modifier (next, on, off)
 * KEY_CMD_CONTROL = 79             # <<<<<<<<<<<<<<
 * ## cycle the Meta (Left Alt) sticky input modifier (next, on, off)
 * KEY_CMD_META = 80
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_CONTROL, __pyx_int_79) < 0) __PYX_ERR(3, 388, __pyx_L1_error)

  /* "constants.auto.pyx":390
 * KEY_CMD_CONTROL = 79
 * ## cycle the Meta (Left Alt) sticky input modifier (next, on, off)
 * KEY_CMD_META = 80             # <<<<<<<<<<<<<<
 * ## show current date and time
 * KEY_CMD_TIME = 81
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_META, __pyx_int_80) < 0) __PYX_ERR(3, 390, __pyx_L1_error)

  /* "constants.auto.pyx":392
 * KEY_CMD_META = 80
 * ## show current date and time
 * KEY_CMD_TIME = 81             # <<<<<<<<<<<<<<
 * ## go to previous menu level
 * KEY_CMD_MENU_PREV_LEVEL = 82
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_TIME, __pyx_int_81) < 0) __PYX_ERR(3, 392, __pyx_L1_error)

  /* "constants.auto.pyx":394
 * KEY_CMD_TIME = 81
 * ## go to previous menu level
 * KEY_CMD_MENU_PREV_LEVEL = 82             # <<<<<<<<<<<<<<
 * ## set autospeak selected line on/off
 * KEY_CMD_ASPK_SEL_LINE = 83
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_MENU_PREV_LEVEL, __pyx_int_82) < 0) __PYX_ERR(3, 394, __pyx_L1_error)

  /* "constants.auto.pyx":396
 * KEY_CMD_MENU_PREV_LEVEL = 82
 * ## set autospeak selected line on/off
 * KEY_CMD_ASPK_SEL_LINE = 83             # <<<<<<<<<<<<<<
 * ## set autospeak selected character on/off
 * KEY_CMD_ASPK_SEL_CHAR = 84
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_ASPK_SEL_LINE, __pyx_int_83) < 0) __PYX_ERR(3, 396, __pyx_L1_error)

  /* "constants.auto.pyx":398
 * KEY_CMD_ASPK_SEL_LINE = 83
 * ## set autospeak selected character on/off
 * KEY_CMD_ASPK_SEL_CHAR = 84             # <<<<<<<<<<<<<<
 * ## set autospeak inserted characters on/off
 * KEY_CMD_ASPK_INS_CHARS = 85
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_ASPK_SEL_CHAR, __pyx_int_84) < 0) __PYX_ERR(3, 398, __pyx_L1_error)

  /* "constants.auto.pyx":400
 * KEY_CMD_ASPK_SEL_CHAR = 84
 * ## set autospeak inserted characters on/off
 * KEY_CMD_ASPK_INS_CHARS = 85             # <<<<<<<<<<<<<<
 * ## set autospeak deleted characters on/off
 * KEY_CMD_ASPK_DEL_CHARS = 86
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_ASPK_INS_CHARS, __pyx_int_85) < 0) __PYX_ERR(3, 400, __pyx_L1_error)

  /* "constants.auto.pyx":402
 * KEY_CMD_ASPK_INS_CHARS = 85
 * ## set autospeak deleted characters on/off
 * KEY_CMD_ASPK_DEL_CHARS = 86             # <<<<<<<<<<<<<<
 * ## set autospeak replaced characters on/off
 * KEY_CMD_ASPK_REP_CHARS = 87
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_ASPK_DEL_CHARS, __pyx_int_86) < 0) __PYX_ERR(3, 402, __pyx_L1_error)

  /* "constants.auto.pyx":404
 * KEY_CMD_ASPK_DEL_CHARS = 86
 * ## set autospeak replaced characters on/off
 * KEY_CMD_ASPK_REP_CHARS = 87             # <<<<<<<<<<<<<<
 * ## set autospeak completed words on/off
 * KEY_CMD_ASPK_CMP_WORDS = 88
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_ASPK_REP_CHARS, __pyx_int_87) < 0) __PYX_ERR(3, 404, __pyx_L1_error)

  /* "constants.auto.pyx":406
 * KEY_CMD_ASPK_REP_CHARS = 87
 * ## set autospeak completed words on/off
 * KEY_CMD_ASPK_CMP_WORDS = 88             # <<<<<<<<<<<<<<
 * ## speak current character
 * KEY_CMD_SPEAK_CURR_CHAR = 89
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_ASPK_CMP_WORDS, __pyx_int_88) < 0) __PYX_ERR(3, 406, __pyx_L1_error)

  /* "constants.auto.pyx":408
 * KEY_CMD_ASPK_CMP_WORDS = 88
 * ## speak current character
 * KEY_CMD_SPEAK_CURR_CHAR = 89             # <<<<<<<<<<<<<<
 * ## go to and speak previous character
 * KEY_CMD_SPEAK_PREV_CHAR = 90
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SPEAK_CURR_CHAR, __pyx_int_89) < 0) __PYX_ERR(3, 408, __pyx_L1_error)

  /* "constants.auto.pyx":410
 * KEY_CMD_SPEAK_CURR_CHAR = 89
 * ## go to and speak previous character
 * KEY_CMD_SPEAK_PREV_CHAR = 90             # <<<<<<<<<<<<<<
 * ## go to and speak next character
 * KEY_CMD_SPEAK_NEXT_CHAR = 91
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SPEAK_PREV_CHAR, __pyx_int_90) < 0) __PYX_ERR(3, 410, __pyx_L1_error)

  /* "constants.auto.pyx":412
 * KEY_CMD_SPEAK_PREV_CHAR = 90
 * ## go to and speak next character
 * KEY_CMD_SPEAK_NEXT_CHAR = 91             # <<<<<<<<<<<<<<
 * ## speak current word
 * KEY_CMD_SPEAK_CURR_WORD = 92
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SPEAK_NEXT_CHAR, __pyx_int_91) < 0) __PYX_ERR(3, 412, __pyx_L1_error)

  /* "constants.auto.pyx":414
 * KEY_CMD_SPEAK_NEXT_CHAR = 91
 * ## speak current word
 * KEY_CMD_SPEAK_CURR_WORD = 92             # <<<<<<<<<<<<<<
 * ## go to and speak previous word
 * KEY_CMD_SPEAK_PREV_WORD = 93
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SPEAK_CURR_WORD, __pyx_int_92) < 0) __PYX_ERR(3, 414, __pyx_L1_error)

  /* "constants.auto.pyx":416
 * KEY_CMD_SPEAK_CURR_WORD = 92
 * ## go to and speak previous word
 * KEY_CMD_SPEAK_PREV_WORD = 93             # <<<<<<<<<<<<<<
 * ## go to and speak next word
 * KEY_CMD_SPEAK_NEXT_WORD = 94
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SPEAK_PREV_WORD, __pyx_int_93) < 0) __PYX_ERR(3, 416, __pyx_L1_error)

  /* "constants.auto.pyx":418
 * KEY_CMD_SPEAK_PREV_WORD = 93
 * ## go to and speak next word
 * KEY_CMD_SPEAK_NEXT_WORD = 94             # <<<<<<<<<<<<<<
 * ## speak current line
 * KEY_CMD_SPEAK_CURR_LINE = 95
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SPEAK_NEXT_WORD, __pyx_int_94) < 0) __PYX_ERR(3, 418, __pyx_L1_error)

  /* "constants.auto.pyx":420
 * KEY_CMD_SPEAK_NEXT_WORD = 94
 * ## speak current line
 * KEY_CMD_SPEAK_CURR_LINE = 95             # <<<<<<<<<<<<<<
 * ## go to and speak previous line
 * KEY_CMD_SPEAK_PREV_LINE = 96
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SPEAK_CURR_LINE, __pyx_int_95) < 0) __PYX_ERR(3, 420, __pyx_L1_error)

  /* "constants.auto.pyx":422
 * KEY_CMD_SPEAK_CURR_LINE = 95
 * ## go to and speak previous line
 * KEY_CMD_SPEAK_PREV_LINE = 96             # <<<<<<<<<<<<<<
 * ## go to and speak next line
 * KEY_CMD_SPEAK_NEXT_LINE = 97
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SPEAK_PREV_LINE, __pyx_int_96) < 0) __PYX_ERR(3, 422, __pyx_L1_error)

  /* "constants.auto.pyx":424
 * KEY_CMD_SPEAK_PREV_LINE = 96
 * ## go to and speak next line
 * KEY_CMD_SPEAK_NEXT_LINE = 97             # <<<<<<<<<<<<<<
 * ## go to and speak first non-blank character on line
 * KEY_CMD_SPEAK_FRST_CHAR = 98
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SPEAK_NEXT_LINE, __pyx_int_97) < 0) __PYX_ERR(3, 424, __pyx_L1_error)

  /* "constants.auto.pyx":426
 * KEY_CMD_SPEAK_NEXT_LINE = 97
 * ## go to and speak first non-blank character on line
 * KEY_CMD_SPEAK_FRST_CHAR = 98             # <<<<<<<<<<<<<<
 * ## go to and speak last non-blank character on line
 * KEY_CMD_SPEAK_LAST_CHAR = 99
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SPEAK_FRST_CHAR, __pyx_int_98) < 0) __PYX_ERR(3, 426, __pyx_L1_error)

  /* "constants.auto.pyx":428
 * KEY_CMD_SPEAK_FRST_CHAR = 98
 * ## go to and speak last non-blank character on line
 * KEY_CMD_SPEAK_LAST_CHAR = 99             # <<<<<<<<<<<<<<
 * ## go to and speak first non-blank line on screen
 * KEY_CMD_SPEAK_FRST_LINE = 100
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SPEAK_LAST_CHAR, __pyx_int_99) < 0) __PYX_ERR(3, 428, __pyx_L1_error)

  /* "constants.auto.pyx":430
 * KEY_CMD_SPEAK_LAST_CHAR = 99
 * ## go to and speak first non-blank line on screen
 * KEY_CMD_SPEAK_FRST_LINE = 100             # <<<<<<<<<<<<<<
 * ## go to and speak last non-blank line on screen
 * KEY_CMD_SPEAK_LAST_LINE = 101
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SPEAK_FRST_LINE, __pyx_int_100) < 0) __PYX_ERR(3, 430, __pyx_L1_error)

  /* "constants.auto.pyx":432
 * KEY_CMD_SPEAK_FRST_LINE = 100
 * ## go to and speak last non-blank line on screen
 * KEY_CMD_SPEAK_LAST_LINE = 101             # <<<<<<<<<<<<<<
 * ## describe current character
 * KEY_CMD_DESC_CURR_CHAR = 102
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SPEAK_LAST_LINE, __pyx_int_101) < 0) __PYX_ERR(3, 432, __pyx_L1_error)

  /* "constants.auto.pyx":434
 * KEY_CMD_SPEAK_LAST_LINE = 101
 * ## describe current character
 * KEY_CMD_DESC_CURR_CHAR = 102             # <<<<<<<<<<<<<<
 * ## spell current word
 * KEY_CMD_SPELL_CURR_WORD = 103
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_DESC_CURR_CHAR, __pyx_int_102) < 0) __PYX_ERR(3, 434, __pyx_L1_error)

  /* "constants.auto.pyx":436
 * KEY_CMD_DESC_CURR_CHAR = 102
 * ## spell current word
 * KEY_CMD_SPELL_CURR_WORD = 103             # <<<<<<<<<<<<<<
 * ## bring screen cursor to speech cursor
 * KEY_CMD_ROUTE_CURR_LOCN = 104
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SPELL_CURR_WORD, __pyx_int_103) < 0) __PYX_ERR(3, 436, __pyx_L1_error)

  /* "constants.auto.pyx":438
 * KEY_CMD_SPELL_CURR_WORD = 103
 * ## bring screen cursor to speech cursor
 * KEY_CMD_ROUTE_CURR_LOCN = 104             # <<<<<<<<<<<<<<
 * ## speak speech cursor location
 * KEY_CMD_SPEAK_CURR_LOCN = 105
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_ROUTE_CURR_LOCN, __pyx_int_104) < 0) __PYX_ERR(3, 438, __pyx_L1_error)

  /* "constants.auto.pyx":440
 * KEY_CMD_ROUTE_CURR_LOCN = 104
 * ## speak speech cursor location
 * KEY_CMD_SPEAK_CURR_LOCN = 105             # <<<<<<<<<<<<<<
 * ## set speech cursor visibility on/off
 * KEY_CMD_SHOW_CURR_LOCN = 106
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SPEAK_CURR_LOCN, __pyx_int_105) < 0) __PYX_ERR(3, 440, __pyx_L1_error)

  /* "constants.auto.pyx":442
 * KEY_CMD_SPEAK_CURR_LOCN = 105
 * ## set speech cursor visibility on/off
 * KEY_CMD_SHOW_CURR_LOCN = 106             # <<<<<<<<<<<<<<
 * ## save clipboard to disk
 * KEY_CMD_CLIP_SAVE = 107
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SHOW_CURR_LOCN, __pyx_int_106) < 0) __PYX_ERR(3, 442, __pyx_L1_error)

  /* "constants.auto.pyx":444
 * KEY_CMD_SHOW_CURR_LOCN = 106
 * ## save clipboard to disk
 * KEY_CMD_CLIP_SAVE = 107             # <<<<<<<<<<<<<<
 * ## restore clipboard from disk
 * KEY_CMD_CLIP_RESTORE = 108
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_CLIP_SAVE, __pyx_int_107) < 0) __PYX_ERR(3, 444, __pyx_L1_error)

  /* "constants.auto.pyx":446
 * KEY_CMD_CLIP_SAVE = 107
 * ## restore clipboard from disk
 * KEY_CMD_CLIP_RESTORE = 108             # <<<<<<<<<<<<<<
 * ## set braille typing mode dots/text
 * KEY_CMD_BRLUCDOTS = 109
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_CLIP_RESTORE, __pyx_int_108) < 0) __PYX_ERR(3, 446, __pyx_L1_error)

  /* "constants.auto.pyx":448
 * KEY_CMD_CLIP_RESTORE = 108
 * ## set braille typing mode dots/text
 * KEY_CMD_BRLUCDOTS = 109             # <<<<<<<<<<<<<<
 * ## set braille keyboard enabled/disabled
 * KEY_CMD_BRLKBD = 110
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_BRLUCDOTS, __pyx_int_109) < 0) __PYX_ERR(3, 448, __pyx_L1_error)

  /* "constants.auto.pyx":450
 * KEY_CMD_BRLUCDOTS = 109
 * ## set braille keyboard enabled/disabled
 * KEY_CMD_BRLKBD = 110             # <<<<<<<<<<<<<<
 * ## clear all sticky input modifiers
 * KEY_CMD_UNSTICK = 111
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_BRLKBD, __pyx_int_110) < 0) __PYX_ERR(3, 450, __pyx_L1_error)

  /* "constants.auto.pyx":452
 * KEY_CMD_BRLKBD = 110
 * ## clear all sticky input modifiers
 * KEY_CMD_UNSTICK = 111             # <<<<<<<<<<<<<<
 * ## cycle the AltGr (Right Alt) sticky input modifier (next, on, off)
 * KEY_CMD_ALTGR = 112
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_UNSTICK, __pyx_int_111) < 0) __PYX_ERR(3, 452, __pyx_L1_error)

  /* "constants.auto.pyx":454
 * KEY_CMD_UNSTICK = 111
 * ## cycle the AltGr (Right Alt) sticky input modifier (next, on, off)
 * KEY_CMD_ALTGR = 112             # <<<<<<<<<<<<<<
 * ## cycle the GUI (Windows) sticky input modifier (next, on, off)
 * KEY_CMD_GUI = 113
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_ALTGR, __pyx_int_112) < 0) __PYX_ERR(3, 454, __pyx_L1_error)

  /* "constants.auto.pyx":456
 * KEY_CMD_ALTGR = 112
 * ## cycle the GUI (Windows) sticky input modifier (next, on, off)
 * KEY_CMD_GUI = 113             # <<<<<<<<<<<<<<
 * ## stop the braille driver
 * KEY_CMD_BRL_STOP = 114
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_GUI, __pyx_int_113) < 0) __PYX_ERR(3, 456, __pyx_L1_error)

  /* "constants.auto.pyx":458
 * KEY_CMD_GUI = 113
 * ## stop the braille driver
 * KEY_CMD_BRL_STOP = 114             # <<<<<<<<<<<<<<
 * ## start the braille driver
 * KEY_CMD_BRL_START = 115
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_BRL_STOP, __pyx_int_114) < 0) __PYX_ERR(3, 458, __pyx_L1_error)

  /* "constants.auto.pyx":460
 * KEY_CMD_BRL_STOP = 114
 * ## start the braille driver
 * KEY_CMD_BRL_START = 115             # <<<<<<<<<<<<<<
 * ## stop the speech driver
 * KEY_CMD_SPK_STOP = 116
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_BRL_START, __pyx_int_115) < 0) __PYX_ERR(3, 460, __pyx_L1_error)

  /* "constants.auto.pyx":462
 * KEY_CMD_BRL_START = 115
 * ## stop the speech driver
 * KEY_CMD_SPK_STOP = 116             # <<<<<<<<<<<<<<
 * ## start the speech driver
 * KEY_CMD_SPK_START = 117
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SPK_STOP, __pyx_int_116) < 0) __PYX_ERR(3, 462, __pyx_L1_error)

  /* "constants.auto.pyx":464
 * KEY_CMD_SPK_STOP = 116
 * ## start the speech driver
 * KEY_CMD_SPK_START = 117             # <<<<<<<<<<<<<<
 * ## stop the screen driver
 * KEY_CMD_SCR_STOP = 118
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SPK_START, __pyx_int_117) < 0) __PYX_ERR(3, 464, __pyx_L1_error)

  /* "constants.auto.pyx":466
 * KEY_CMD_SPK_START = 117
 * ## stop the screen driver
 * KEY_CMD_SCR_STOP = 118             # <<<<<<<<<<<<<<
 * ## start the screen driver
 * KEY_CMD_SCR_START = 119
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SCR_STOP, __pyx_int_118) < 0) __PYX_ERR(3, 466, __pyx_L1_error)

  /* "constants.auto.pyx":468
 * KEY_CMD_SCR_STOP = 118
 * ## start the screen driver
 * KEY_CMD_SCR_START = 119             # <<<<<<<<<<<<<<
 * ## bind to the previous virtual terminal
 * KEY_CMD_SELECTVT_PREV = 120
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SCR_START, __pyx_int_119) < 0) __PYX_ERR(3, 468, __pyx_L1_error)

  /* "constants.auto.pyx":470
 * KEY_CMD_SCR_START = 119
 * ## bind to the previous virtual terminal
 * KEY_CMD_SELECTVT_PREV = 120             # <<<<<<<<<<<<<<
 * ## bind to the next virtual terminal
 * KEY_CMD_SELECTVT_NEXT = 121
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SELECTVT_PREV, __pyx_int_120) < 0) __PYX_ERR(3, 470, __pyx_L1_error)

  /* "constants.auto.pyx":472
 * KEY_CMD_SELECTVT_PREV = 120
 * ## bind to the next virtual terminal
 * KEY_CMD_SELECTVT_NEXT = 121             # <<<<<<<<<<<<<<
 * ## go backward to nearest non-blank braille window
 * KEY_CMD_PRNBWIN = 122
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SELECTVT_NEXT, __pyx_int_121) < 0) __PYX_ERR(3, 472, __pyx_L1_error)

  /* "constants.auto.pyx":474
 * KEY_CMD_SELECTVT_NEXT = 121
 * ## go backward to nearest non-blank braille window
 * KEY_CMD_PRNBWIN = 122             # <<<<<<<<<<<<<<
 * ## go forward to nearest non-blank braille window
 * KEY_CMD_NXNBWIN = 123
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_PRNBWIN, __pyx_int_122) < 0) __PYX_ERR(3, 474, __pyx_L1_error)

  /* "constants.auto.pyx":476
 * KEY_CMD_PRNBWIN = 122
 * ## go forward to nearest non-blank braille window
 * KEY_CMD_NXNBWIN = 123             # <<<<<<<<<<<<<<
 * ## set touch navigation on/off
 * KEY_CMD_TOUCH_NAV = 124
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_NXNBWIN, __pyx_int_123) < 0) __PYX_ERR(3, 476, __pyx_L1_error)

  /* "constants.auto.pyx":478
 * KEY_CMD_NXNBWIN = 123
 * ## set touch navigation on/off
 * KEY_CMD_TOUCH_NAV = 124             # <<<<<<<<<<<<<<
 * ## speak indent of current line
 * KEY_CMD_SPEAK_INDENT = 125
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_TOUCH_NAV, __pyx_int_124) < 0) __PYX_ERR(3, 478, __pyx_L1_error)

  /* "constants.auto.pyx":480
 * KEY_CMD_TOUCH_NAV = 124
 * ## speak indent of current line
 * KEY_CMD_SPEAK_INDENT = 125             # <<<<<<<<<<<<<<
 * ## set autospeak indent of current line on/off
 * KEY_CMD_ASPK_INDENT = 126
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SPEAK_INDENT, __pyx_int_125) < 0) __PYX_ERR(3, 480, __pyx_L1_error)

  /* "constants.auto.pyx":482
 * KEY_CMD_SPEAK_INDENT = 125
 * ## set autospeak indent of current line on/off
 * KEY_CMD_ASPK_INDENT = 126             # <<<<<<<<<<<<<<
 * ## refresh braille display
 * KEY_CMD_REFRESH = 127
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_ASPK_INDENT, __pyx_int_126) < 0) __PYX_ERR(3, 482, __pyx_L1_error)

  /* "constants.auto.pyx":484
 * KEY_CMD_ASPK_INDENT = 126
 * ## refresh braille display
 * KEY_CMD_REFRESH = 127             # <<<<<<<<<<<<<<
 * ## show various device status indicators
 * KEY_CMD_INDICATORS = 128
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_REFRESH, __pyx_int_127) < 0) __PYX_ERR(3, 484, __pyx_L1_error)

  /* "constants.auto.pyx":486
 * KEY_CMD_REFRESH = 127
 * ## show various device status indicators
 * KEY_CMD_INDICATORS = 128             # <<<<<<<<<<<<<<
 * ## clear the text selection
 * KEY_CMD_TXTSEL_CLEAR = 129
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_INDICATORS, __pyx_int_128) < 0) __PYX_ERR(3, 486, __pyx_L1_error)

  /* "constants.auto.pyx":488
 * KEY_CMD_INDICATORS = 128
 * ## clear the text selection
 * KEY_CMD_TXTSEL_CLEAR = 129             # <<<<<<<<<<<<<<
 * ## select all of the text
 * KEY_CMD_TXTSEL_ALL = 130
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_TXTSEL_CLEAR, __pyx_int_129) < 0) __PYX_ERR(3, 488, __pyx_L1_error)

  /* "constants.auto.pyx":490
 * KEY_CMD_TXTSEL_CLEAR = 129
 * ## select all of the text
 * KEY_CMD_TXTSEL_ALL = 130             # <<<<<<<<<<<<<<
 * ## copy selected text to host clipboard
 * KEY_CMD_HOST_COPY = 131
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_TXTSEL_ALL, __pyx_int_130) < 0) __PYX_ERR(3, 490, __pyx_L1_error)

  /* "constants.auto.pyx":492
 * KEY_CMD_TXTSEL_ALL = 130
 * ## copy selected text to host clipboard
 * KEY_CMD_HOST_COPY = 131             # <<<<<<<<<<<<<<
 * ## cut selected text to host clipboard
 * KEY_CMD_HOST_CUT = 132
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_HOST_COPY, __pyx_int_131) < 0) __PYX_ERR(3, 492, __pyx_L1_error)

  /* "constants.auto.pyx":494
 * KEY_CMD_HOST_COPY = 131
 * ## cut selected text to host clipboard
 * KEY_CMD_HOST_CUT = 132             # <<<<<<<<<<<<<<
 * ## insert host clipboard text after screen cursor
 * KEY_CMD_HOST_PASTE = 133
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_HOST_CUT, __pyx_int_132) < 0) __PYX_ERR(3, 494, __pyx_L1_error)

  /* "constants.auto.pyx":496
 * KEY_CMD_HOST_CUT = 132
 * ## insert host clipboard text after screen cursor
 * KEY_CMD_HOST_PASTE = 133             # <<<<<<<<<<<<<<
 * ## show the window title
 * KEY_CMD_GUI_TITLE = 134
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_HOST_PASTE, __pyx_int_133) < 0) __PYX_ERR(3, 496, __pyx_L1_error)

  /* "constants.auto.pyx":498
 * KEY_CMD_HOST_PASTE = 133
 * ## show the window title
 * KEY_CMD_GUI_TITLE = 134             # <<<<<<<<<<<<<<
 * ## open the braille actions window
 * KEY_CMD_GUI_BRL_ACTIONS = 135
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_GUI_TITLE, __pyx_int_134) < 0) __PYX_ERR(3, 498, __pyx_L1_error)

  /* "constants.auto.pyx":500
 * KEY_CMD_GUI_TITLE = 134
 * ## open the braille actions window
 * KEY_CMD_GUI_BRL_ACTIONS = 135             # <<<<<<<<<<<<<<
 * ## go to the home screen
 * KEY_CMD_GUI_HOME = 136
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_GUI_BRL_ACTIONS, __pyx_int_135) < 0) __PYX_ERR(3, 500, __pyx_L1_error)

  /* "constants.auto.pyx":502
 * KEY_CMD_GUI_BRL_ACTIONS = 135
 * ## go to the home screen
 * KEY_CMD_GUI_HOME = 136             # <<<<<<<<<<<<<<
 * ## go back to the previous screen
 * KEY_CMD_GUI_BACK = 137
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_GUI_HOME, __pyx_int_136) < 0) __PYX_ERR(3, 502, __pyx_L1_error)

  /* "constants.auto.pyx":504
 * KEY_CMD_GUI_HOME = 136
 * ## go back to the previous screen
 * KEY_CMD_GUI_BACK = 137             # <<<<<<<<<<<<<<
 * ## open the device settings window
 * KEY_CMD_GUI_DEV_SETTINGS = 138
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_GUI_BACK, __pyx_int_137) < 0) __PYX_ERR(3, 504, __pyx_L1_error)

  /* "constants.auto.pyx":506
 * KEY_CMD_GUI_BACK = 137
 * ## open the device settings window
 * KEY_CMD_GUI_DEV_SETTINGS = 138             # <<<<<<<<<<<<<<
 * ## open the device options window
 * KEY_CMD_GUI_DEV_OPTIONS = 139
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_GUI_DEV_SETTINGS, __pyx_int_138) < 0) __PYX_ERR(3, 506, __pyx_L1_error)

  /* "constants.auto.pyx":508
 * KEY_CMD_GUI_DEV_SETTINGS = 138
 * ## open the device options window
 * KEY_CMD_GUI_DEV_OPTIONS = 139             # <<<<<<<<<<<<<<
 * ## open the application list window
 * KEY_CMD_GUI_APP_LIST = 140
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_GUI_DEV_OPTIONS, __pyx_int_139) < 0) __PYX_ERR(3, 508, __pyx_L1_error)

  /* "constants.auto.pyx":510
 * KEY_CMD_GUI_DEV_OPTIONS = 139
 * ## open the application list window
 * KEY_CMD_GUI_APP_LIST = 140             # <<<<<<<<<<<<<<
 * ## open the application-specific menu
 * KEY_CMD_GUI_APP_MENU = 141
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_GUI_APP_LIST, __pyx_int_140) < 0) __PYX_ERR(3, 510, __pyx_L1_error)

  /* "constants.auto.pyx":512
 * KEY_CMD_GUI_APP_LIST = 140
 * ## open the application-specific menu
 * KEY_CMD_GUI_APP_MENU = 141             # <<<<<<<<<<<<<<
 * ## open the application alerts window
 * KEY_CMD_GUI_APP_ALERTS = 142
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_GUI_APP_MENU, __pyx_int_141) < 0) __PYX_ERR(3, 512, __pyx_L1_error)

  /* "constants.auto.pyx":514
 * KEY_CMD_GUI_APP_MENU = 141
 * ## open the application alerts window
 * KEY_CMD_GUI_APP_ALERTS = 142             # <<<<<<<<<<<<<<
 * ## return to the active screen area
 * KEY_CMD_GUI_AREA_ACTV = 143
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_GUI_APP_ALERTS, __pyx_int_142) < 0) __PYX_ERR(3, 514, __pyx_L1_error)

  /* "constants.auto.pyx":516
 * KEY_CMD_GUI_APP_ALERTS = 142
 * ## return to the active screen area
 * KEY_CMD_GUI_AREA_ACTV = 143             # <<<<<<<<<<<<<<
 * ## switch to the previous screen area
 * KEY_CMD_GUI_AREA_PREV = 144
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_GUI_AREA_ACTV, __pyx_int_143) < 0) __PYX_ERR(3, 516, __pyx_L1_error)

  /* "constants.auto.pyx":518
 * KEY_CMD_GUI_AREA_ACTV = 143
 * ## switch to the previous screen area
 * KEY_CMD_GUI_AREA_PREV = 144             # <<<<<<<<<<<<<<
 * ## switch to the next screen area
 * KEY_CMD_GUI_AREA_NEXT = 145
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_GUI_AREA_PREV, __pyx_int_144) < 0) __PYX_ERR(3, 518, __pyx_L1_error)

  /* "constants.auto.pyx":520
 * KEY_CMD_GUI_AREA_PREV = 144
 * ## switch to the next screen area
 * KEY_CMD_GUI_AREA_NEXT = 145             # <<<<<<<<<<<<<<
 * ## move to the first item in the screen area
 * KEY_CMD_GUI_ITEM_FRST = 146
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_GUI_AREA_NEXT, __pyx_int_145) < 0) __PYX_ERR(3, 520, __pyx_L1_error)

  /* "constants.auto.pyx":522
 * KEY_CMD_GUI_AREA_NEXT = 145
 * ## move to the first item in the screen area
 * KEY_CMD_GUI_ITEM_FRST = 146             # <<<<<<<<<<<<<<
 * ## move to the previous item in the screen area
 * KEY_CMD_GUI_ITEM_PREV = 147
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_GUI_ITEM_FRST, __pyx_int_146) < 0) __PYX_ERR(3, 522, __pyx_L1_error)

  /* "constants.auto.pyx":524
 * KEY_CMD_GUI_ITEM_FRST = 146
 * ## move to the previous item in the screen area
 * KEY_CMD_GUI_ITEM_PREV = 147             # <<<<<<<<<<<<<<
 * ## move to the next item in the screen area
 * KEY_CMD_GUI_ITEM_NEXT = 148
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_GUI_ITEM_PREV, __pyx_int_147) < 0) __PYX_ERR(3, 524, __pyx_L1_error)

  /* "constants.auto.pyx":526
 * KEY_CMD_GUI_ITEM_PREV = 147
 * ## move to the next item in the screen area
 * KEY_CMD_GUI_ITEM_NEXT = 148             # <<<<<<<<<<<<<<
 * ## move to the last item in the screen area
 * KEY_CMD_GUI_ITEM_LAST = 149
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_GUI_ITEM_NEXT, __pyx_int_148) < 0) __PYX_ERR(3, 526, __pyx_L1_error)

  /* "constants.auto.pyx":528
 * KEY_CMD_GUI_ITEM_NEXT = 148
 * ## move to the last item in the screen area
 * KEY_CMD_GUI_ITEM_LAST = 149             # <<<<<<<<<<<<<<
 * ## decrease speaking pitch
 * KEY_CMD_SAY_LOWER = 150
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_GUI_ITEM_LAST, __pyx_int_149) < 0) __PYX_ERR(3, 528, __pyx_L1_error)

  /* "constants.auto.pyx":530
 * KEY_CMD_GUI_ITEM_LAST = 149
 * ## decrease speaking pitch
 * KEY_CMD_SAY_LOWER = 150             # <<<<<<<<<<<<<<
 * ## increase speaking pitch
 * KEY_CMD_SAY_HIGHER = 151
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SAY_LOWER, __pyx_int_150) < 0) __PYX_ERR(3, 530, __pyx_L1_error)

  /* "constants.auto.pyx":532
 * KEY_CMD_SAY_LOWER = 150
 * ## increase speaking pitch
 * KEY_CMD_SAY_HIGHER = 151             # <<<<<<<<<<<<<<
 * ## speak from top of screen through bottom of screen
 * KEY_CMD_SAY_ALL = 152
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SAY_HIGHER, __pyx_int_151) < 0) __PYX_ERR(3, 532, __pyx_L1_error)

  /* "constants.auto.pyx":534
 * KEY_CMD_SAY_HIGHER = 151
 * ## speak from top of screen through bottom of screen
 * KEY_CMD_SAY_ALL = 152             # <<<<<<<<<<<<<<
 * ## set contracted/computer braille
 * KEY_CMD_CONTRACTED = 153
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_SAY_ALL, __pyx_int_152) < 0) __PYX_ERR(3, 534, __pyx_L1_error)

  /* "constants.auto.pyx":536
 * KEY_CMD_SAY_ALL = 152
 * ## set contracted/computer braille
 * KEY_CMD_CONTRACTED = 153             # <<<<<<<<<<<<<<
 * ## set six/eight dot computer braille
 * KEY_CMD_COMPBRL6 = 154
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_CONTRACTED, __pyx_int_153) < 0) __PYX_ERR(3, 536, __pyx_L1_error)

  /* "constants.auto.pyx":538
 * KEY_CMD_CONTRACTED = 153
 * ## set six/eight dot computer braille
 * KEY_CMD_COMPBRL6 = 154             # <<<<<<<<<<<<<<
 * ## bring screen cursor to character
 * KEY_CMD_ROUTE = (1 << KEY_CMD_BLK_SHIFT)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_CMD_COMPBRL6, __pyx_int_154) < 0) __PYX_ERR(3, 538, __pyx_L1_error)

  /* "constants.auto.pyx":540
 * KEY_CMD_COMPBRL6 = 154
 * ## bring screen cursor to character
 * KEY_CMD_ROUTE = (1 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## start new clipboard at character
 * KEY_CMD_CLIP_NEW = (2 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Lshift(__pyx_int_1, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 540, __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_KEY_CMD_ROUTE, __pyx_t_2) < 0) __PYX_ERR(3, 540, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "constants.auto.pyx":542
 * KEY_CMD_ROUTE = (1 << KEY_CMD_BLK_SHIFT)
 * ## start new clipboard at character
 * KEY_CMD_CLIP_NEW = (2 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## deprecated definition of CLIP_NEW - start new clipboard at character
 * KEY_CMD_CUTBEGIN = (2 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Lshift(__pyx_int_2, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 542, __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_KEY_CMD_CLIP_NEW, __pyx_t_1) < 0) __PYX_ERR(3, 542, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "constants.auto.pyx":544
 * KEY_CMD_CLIP_NEW = (2 << KEY_CMD_BLK_SHIFT)
 * ## deprecated definition of CLIP_NEW - start new clipboard at character
 * KEY_CMD_CUTBEGIN = (2 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## append to clipboard from character
 * KEY_CMD_CLIP_ADD = (3 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Lshift(__pyx_int_2, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 544, __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_KEY_CMD_CUTBEGIN, __pyx_t_2) < 0) __PYX_ERR(3, 544, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "constants.auto.pyx":546
 * KEY_CMD_CUTBEGIN = (2 << KEY_CMD_BLK_SHIFT)
 * ## append to clipboard from character
 * KEY_CMD_CLIP_ADD = (3 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## deprecated definition of CLIP_ADD - append to clipboard from character
 * KEY_CMD_CUTAPPEND = (3 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Lshift(__pyx_int_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 546, __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_KEY_CMD_CLIP_ADD, __pyx_t_1) < 0) __PYX_ERR(3, 546, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "constants.auto.pyx":548
 * KEY_CMD_CLIP_ADD = (3 << KEY_CMD_BLK_SHIFT)
 * ## deprecated definition of CLIP_ADD - append to clipboard from character
 * KEY_CMD_CUTAPPEND = (3 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## rectangular copy to character
 * KEY_CMD_COPY_RECT = (4 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Lshift(__pyx_int_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 548, __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_KEY_CMD_CUTAPPEND, __pyx_t_2) < 0) __PYX_ERR(3, 548, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "constants.auto.pyx":550
 * KEY_CMD_CUTAPPEND = (3 << KEY_CMD_BLK_SHIFT)
 * ## rectangular copy to character
 * KEY_CMD_COPY_RECT = (4 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## deprecated definition of COPY_RECT - rectangular copy to character
 * KEY_CMD_CUTRECT = (4 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Lshift(__pyx_int_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 550, __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_KEY_CMD_COPY_RECT, __pyx_t_1) < 0) __PYX_ERR(3, 550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "constants.auto.pyx":552
 * KEY_CMD_COPY_RECT = (4 << KEY_CMD_BLK_SHIFT)
 * ## deprecated definition of COPY_RECT - rectangular copy to character
 * KEY_CMD_CUTRECT = (4 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## linear copy to character
 * KEY_CMD_COPY_LINE = (5 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Lshift(__pyx_int_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 552, __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_KEY_CMD_CUTRECT, __pyx_t_2) < 0) __PYX_ERR(3, 552, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "constants.auto.pyx":554
 * KEY_CMD_CUTRECT = (4 << KEY_CMD_BLK_SHIFT)
 * ## linear copy to character
 * KEY_CMD_COPY_LINE = (5 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## deprecated definition of COPY_LINE - linear copy to character
 * KEY_CMD_CUTLINE = (5 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Lshift(__pyx_int_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 554, __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_KEY_CMD_COPY_LINE, __pyx_t_1) < 0) __PYX_ERR(3, 554, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "constants.auto.pyx":556
 * KEY_CMD_COPY_LINE = (5 << KEY_CMD_BLK_SHIFT)
 * ## deprecated definition of COPY_LINE - linear copy to character
 * KEY_CMD_CUTLINE = (5 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## switch to specific virtual terminal
 * KEY_CMD_SWITCHVT = (6 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Lshift(__pyx_int_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 556, __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_KEY_CMD_CUTLINE, __pyx_t_2) < 0) __PYX_ERR(3, 556, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "constants.auto.pyx":558
 * KEY_CMD_CUTLINE = (5 << KEY_CMD_BLK_SHIFT)
 * ## switch to specific virtual terminal
 * KEY_CMD_SWITCHVT = (6 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## go up to nearest line with less indent than character
 * KEY_CMD_PRINDENT = (7 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Lshift(__pyx_int_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 558, __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_KEY_CMD_SWITCHVT, __pyx_t_1) < 0) __PYX_ERR(3, 558, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "constants.auto.pyx":560
 * KEY_CMD_SWITCHVT = (6 << KEY_CMD_BLK_SHIFT)
 * ## go up to nearest line with less indent than character
 * KEY_CMD_PRINDENT = (7 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## go down to nearest line with less indent than character
 * KEY_CMD_NXINDENT = (8 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Lshift(__pyx_int_7, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 560, __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_KEY_CMD_PRINDENT, __pyx_t_2) < 0) __PYX_ERR(3, 560, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "constants.auto.pyx":562
 * KEY_CMD_PRINDENT = (7 << KEY_CMD_BLK_SHIFT)
 * ## go down to nearest line with less indent than character
 * KEY_CMD_NXINDENT = (8 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## describe character
 * KEY_CMD_DESCCHAR = (9 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Lshift(__pyx_int_8, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 562, __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_KEY_CMD_NXINDENT, __pyx_t_1) < 0) __PYX_ERR(3, 562, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "constants.auto.pyx":564
 * KEY_CMD_NXINDENT = (8 << KEY_CMD_BLK_SHIFT)
 * ## describe character
 * KEY_CMD_DESCCHAR = (9 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## place left end of braille window at character
 * KEY_CMD_SETLEFT = (10 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Lshift(__pyx_int_9, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 564, __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_KEY_CMD_DESCCHAR, __pyx_t_2) < 0) __PYX_ERR(3, 564, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "constants.auto.pyx":566
 * KEY_CMD_DESCCHAR = (9 << KEY_CMD_BLK_SHIFT)
 * ## place left end of braille window at character
 * KEY_CMD_SETLEFT = (10 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## remember current braille window position
 * KEY_CMD_SETMARK = (11 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Lshift(__pyx_int_10, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 566, __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_KEY_CMD_SETLEFT, __pyx_t_1) < 0) __PYX_ERR(3, 566, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "constants.auto.pyx":568
 * KEY_CMD_SETLEFT = (10 << KEY_CMD_BLK_SHIFT)
 * ## remember current braille window position
 * KEY_CMD_SETMARK = (11 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## go to remembered braille window position
 * KEY_CMD_GOTOMARK = (12 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Lshift(__pyx_int_11, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 568, __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_KEY_CMD_SETMARK, __pyx_t_2) < 0) __PYX_ERR(3, 568, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "constants.auto.pyx":570
 * KEY_CMD_SETMARK = (11 << KEY_CMD_BLK_SHIFT)
 * ## go to remembered braille window position
 * KEY_CMD_GOTOMARK = (12 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## go to selected line
 * KEY_CMD_GOTOLINE = (13 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Lshift(__pyx_int_12, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 570, __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_KEY_CMD_GOTOMARK, __pyx_t_1) < 0) __PYX_ERR(3, 570, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "constants.auto.pyx":572
 * KEY_CMD_GOTOMARK = (12 << KEY_CMD_BLK_SHIFT)
 * ## go to selected line
 * KEY_CMD_GOTOLINE = (13 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## go up to nearest line with different character
 * KEY_CMD_PRDIFCHAR = (14 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Lshift(__pyx_int_13, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 572, __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_KEY_CMD_GOTOLINE, __pyx_t_2) < 0) __PYX_ERR(3, 572, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "constants.auto.pyx":574
 * KEY_CMD_GOTOLINE = (13 << KEY_CMD_BLK_SHIFT)
 * ## go up to nearest line with different character
 * KEY_CMD_PRDIFCHAR = (14 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## go down to nearest line with different character
 * KEY_CMD_NXDIFCHAR = (15 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Lshift(__pyx_int_14, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 574, __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_KEY_CMD_PRDIFCHAR, __pyx_t_1) < 0) __PYX_ERR(3, 574, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "constants.auto.pyx":576
 * KEY_CMD_PRDIFCHAR = (14 << KEY_CMD_BLK_SHIFT)
 * ## go down to nearest line with different character
 * KEY_CMD_NXDIFCHAR = (15 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## copy characters to clipboard
 * KEY_CMD_CLIP_COPY = (16 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Lshift(__pyx_int_15, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 576, __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_KEY_CMD_NXDIFCHAR, __pyx_t_2) < 0) __PYX_ERR(3, 576, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "constants.auto.pyx":578
 * KEY_CMD_NXDIFCHAR = (15 << KEY_CMD_BLK_SHIFT)
 * ## copy characters to clipboard
 * KEY_CMD_CLIP_COPY = (16 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## deprecated definition of CLIP_COPY - copy characters to clipboard
 * KEY_CMD_COPYCHARS = (16 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Lshift(__pyx_int_16, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 578, __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_KEY_CMD_CLIP_COPY, __pyx_t_1) < 0) __PYX_ERR(3, 578, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "constants.auto.pyx":580
 * KEY_CMD_CLIP_COPY = (16 << KEY_CMD_BLK_SHIFT)
 * ## deprecated definition of CLIP_COPY - copy characters to clipboard
 * KEY_CMD_COPYCHARS = (16 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## append characters to clipboard
 * KEY_CMD_CLIP_APPEND = (17 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Lshift(__pyx_int_16, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 580, __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_KEY_CMD_COPYCHARS, __pyx_t_2) < 0) __PYX_ERR(3, 580, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "constants.auto.pyx":582
 * KEY_CMD_COPYCHARS = (16 << KEY_CMD_BLK_SHIFT)
 * ## append characters to clipboard
 * KEY_CMD_CLIP_APPEND = (17 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## deprecated definition of CLIP_APPEND - append characters to clipboard
 * KEY_CMD_APNDCHARS = (17 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Lshift(__pyx_int_17, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 582, __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_KEY_CMD_CLIP_APPEND, __pyx_t_1) < 0) __PYX_ERR(3, 582, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "constants.auto.pyx":584
 * KEY_CMD_CLIP_APPEND = (17 << KEY_CMD_BLK_SHIFT)
 * ## deprecated definition of CLIP_APPEND - append characters to clipboard
 * KEY_CMD_APNDCHARS = (17 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## insert clipboard history entry after screen cursor
 * KEY_CMD_PASTE_HISTORY = (18 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Lshift(__pyx_int_17, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 584, __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_KEY_CMD_APNDCHARS, __pyx_t_2) < 0) __PYX_ERR(3, 584, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "constants.auto.pyx":586
 * KEY_CMD_APNDCHARS = (17 << KEY_CMD_BLK_SHIFT)
 * ## insert clipboard history entry after screen cursor
 * KEY_CMD_PASTE_HISTORY = (18 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## set text table
 * KEY_CMD_SET_TEXT_TABLE = (19 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Lshift(__pyx_int_18, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 586, __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_KEY_CMD_PASTE_HISTORY, __pyx_t_1) < 0) __PYX_ERR(3, 586, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "constants.auto.pyx":588
 * KEY_CMD_PASTE_HISTORY = (18 << KEY_CMD_BLK_SHIFT)
 * ## set text table
 * KEY_CMD_SET_TEXT_TABLE = (19 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## set attributes table
 * KEY_CMD_SET_ATTRIBUTES_TABLE = (20 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Lshift(__pyx_int_19, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 588, __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_KEY_CMD_SET_TEXT_TABLE, __pyx_t_2) < 0) __PYX_ERR(3, 588, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "constants.auto.pyx":590
 * KEY_CMD_SET_TEXT_TABLE = (19 << KEY_CMD_BLK_SHIFT)
 * ## set attributes table
 * KEY_CMD_SET_ATTRIBUTES_TABLE = (20 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## set contraction table
 * KEY_CMD_SET_CONTRACTION_TABLE = (21 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Lshift(__pyx_int_20, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 590, __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_KEY_CMD_SET_ATTRIBUTES_TABLE, __pyx_t_1) < 0) __PYX_ERR(3, 590, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "constants.auto.pyx":592
 * KEY_CMD_SET_ATTRIBUTES_TABLE = (20 << KEY_CMD_BLK_SHIFT)
 * ## set contraction table
 * KEY_CMD_SET_CONTRACTION_TABLE = (21 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## set keyboard table
 * KEY_CMD_SET_KEYBOARD_TABLE = (22 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Lshift(__pyx_int_21, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 592, __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_KEY_CMD_SET_CONTRACTION_TABLE, __pyx_t_2) < 0) __PYX_ERR(3, 592, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "constants.auto.pyx":594
 * KEY_CMD_SET_CONTRACTION_TABLE = (21 << KEY_CMD_BLK_SHIFT)
 * ## set keyboard table
 * KEY_CMD_SET_KEYBOARD_TABLE = (22 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## set language profile
 * KEY_CMD_SET_LANGUAGE_PROFILE = (23 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Lshift(__pyx_int_22, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 594, __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_KEY_CMD_SET_KEYBOARD_TABLE, __pyx_t_1) < 0) __PYX_ERR(3, 594, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "constants.auto.pyx":596
 * KEY_CMD_SET_KEYBOARD_TABLE = (22 << KEY_CMD_BLK_SHIFT)
 * ## set language profile
 * KEY_CMD_SET_LANGUAGE_PROFILE = (23 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## bring screen cursor to line
 * KEY_CMD_ROUTE_LINE = (24 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Lshift(__pyx_int_23, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 596, __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_KEY_CMD_SET_LANGUAGE_PROFILE, __pyx_t_2) < 0) __PYX_ERR(3, 596, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "constants.auto.pyx":598
 * KEY_CMD_SET_LANGUAGE_PROFILE = (23 << KEY_CMD_BLK_SHIFT)
 * ## bring screen cursor to line
 * KEY_CMD_ROUTE_LINE = (24 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## refresh braille line
 * KEY_CMD_REFRESH_LINE = (25 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Lshift(__pyx_int_24, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 598, __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_KEY_CMD_ROUTE_LINE, __pyx_t_1) < 0) __PYX_ERR(3, 598, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "constants.auto.pyx":600
 * KEY_CMD_ROUTE_LINE = (24 << KEY_CMD_BLK_SHIFT)
 * ## refresh braille line
 * KEY_CMD_REFRESH_LINE = (25 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## start text selection
 * KEY_CMD_TXTSEL_START = (26 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Lshift(__pyx_int_25, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 600, __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_KEY_CMD_REFRESH_LINE, __pyx_t_2) < 0) __PYX_ERR(3, 600, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "constants.auto.pyx":602
 * KEY_CMD_REFRESH_LINE = (25 << KEY_CMD_BLK_SHIFT)
 * ## start text selection
 * KEY_CMD_TXTSEL_START = (26 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## set text selection
 * KEY_CMD_TXTSEL_SET = (27 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Lshift(__pyx_int_26, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 602, __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_KEY_CMD_TXTSEL_START, __pyx_t_1) < 0) __PYX_ERR(3, 602, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "constants.auto.pyx":604
 * KEY_CMD_TXTSEL_START = (26 << KEY_CMD_BLK_SHIFT)
 * ## set text selection
 * KEY_CMD_TXTSEL_SET = (27 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## bind to specific virtual terminal
 * KEY_CMD_SELECTVT = (30 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Lshift(__pyx_int_27, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 604, __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_KEY_CMD_TXTSEL_SET, __pyx_t_2) < 0) __PYX_ERR(3, 604, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "constants.auto.pyx":606
 * KEY_CMD_TXTSEL_SET = (27 << KEY_CMD_BLK_SHIFT)
 * ## bind to specific virtual terminal
 * KEY_CMD_SELECTVT = (30 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## render an alert
 * KEY_CMD_ALERT = (31 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Lshift(__pyx_int_30, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 606, __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_KEY_CMD_SELECTVT, __pyx_t_1) < 0) __PYX_ERR(3, 606, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "constants.auto.pyx":608
 * KEY_CMD_SELECTVT = (30 << KEY_CMD_BLK_SHIFT)
 * ## render an alert
 * KEY_CMD_ALERT = (31 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## type braille dots
 * KEY_CMD_PASSDOTS = (34 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Lshift(__pyx_int_31, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 608, __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_KEY_CMD_ALERT, __pyx_t_2) < 0) __PYX_ERR(3, 608, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "constants.auto.pyx":610
 * KEY_CMD_ALERT = (31 << KEY_CMD_BLK_SHIFT)
 * ## type braille dots
 * KEY_CMD_PASSDOTS = (34 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## AT (set 2) keyboard scan code
 * KEY_CMD_PASSAT = (35 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Lshift(__pyx_int_34, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 610, __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_KEY_CMD_PASSDOTS, __pyx_t_1) < 0) __PYX_ERR(3, 610, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "constants.auto.pyx":612
 * KEY_CMD_PASSDOTS = (34 << KEY_CMD_BLK_SHIFT)
 * ## AT (set 2) keyboard scan code
 * KEY_CMD_PASSAT = (35 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## XT (set 1) keyboard scan code
 * KEY_CMD_PASSXT = (36 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Lshift(__pyx_int_35, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 612, __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_KEY_CMD_PASSAT, __pyx_t_2) < 0) __PYX_ERR(3, 612, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "constants.auto.pyx":614
 * KEY_CMD_PASSAT = (35 << KEY_CMD_BLK_SHIFT)
 * ## XT (set 1) keyboard scan code
 * KEY_CMD_PASSXT = (36 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## PS/2 (set 3) keyboard scan code
 * KEY_CMD_PASSPS2 = (37 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Lshift(__pyx_int_36, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 614, __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_KEY_CMD_PASSXT, __pyx_t_1) < 0) __PYX_ERR(3, 614, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "constants.auto.pyx":616
 * KEY_CMD_PASSXT = (36 << KEY_CMD_BLK_SHIFT)
 * ## PS/2 (set 3) keyboard scan code
 * KEY_CMD_PASSPS2 = (37 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## switch to command context
 * KEY_CMD_CONTEXT = (38 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Lshift(__pyx_int_37, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 616, __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_KEY_CMD_PASSPS2, __pyx_t_2) < 0) __PYX_ERR(3, 616, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "constants.auto.pyx":618
 * KEY_CMD_PASSPS2 = (37 << KEY_CMD_BLK_SHIFT)
 * ## switch to command context
 * KEY_CMD_CONTEXT = (38 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## current reading location
 * KEY_CMD_TOUCH_AT = (39 << KEY_CMD_BLK_SHIFT)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Lshift(__pyx_int_38, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 618, __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_KEY_CMD_CONTEXT, __pyx_t_1) < 0) __PYX_ERR(3, 618, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "constants.auto.pyx":620
 * KEY_CMD_CONTEXT = (38 << KEY_CMD_BLK_SHIFT)
 * ## current reading location
 * KEY_CMD_TOUCH_AT = (39 << KEY_CMD_BLK_SHIFT)             # <<<<<<<<<<<<<<
 * ## enable feature
 * KEY_FLG_TOGGLE_ON = 0x0100
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KEY_CMD_BLK_SHIFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 620, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Lshift(__pyx_int_39, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 620, __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_KEY_CMD_TOUCH_AT, __pyx_t_2) < 0) __PYX_ERR(3, 620, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "constants.auto.pyx":622
 * KEY_CMD_TOUCH_AT = (39 << KEY_CMD_BLK_SHIFT)
 * ## enable feature
 * KEY_FLG_TOGGLE_ON = 0x0100             # <<<<<<<<<<<<<<
 * ## disable feature
 * KEY_FLG_TOGGLE_OFF = 0x0200
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_FLG_TOGGLE_ON, __pyx_int_256) < 0) __PYX_ERR(3, 622, __pyx_L1_error)

  /* "constants.auto.pyx":624
 * KEY_FLG_TOGGLE_ON = 0x0100
 * ## disable feature
 * KEY_FLG_TOGGLE_OFF = 0x0200             # <<<<<<<<<<<<<<
 * ## mask for all toggle flags
 * KEY_FLG_TOGGLE_MASK = (KEY_FLG_TOGGLE_ON | KEY_FLG_TOGGLE_OFF)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_FLG_TOGGLE_OFF, __pyx_int_512) < 0) __PYX_ERR(3, 624, __pyx_L1_error)

  /* "constants.auto.pyx":626
 * KEY_FLG_TOGGLE_OFF = 0x0200
 * ## mask for all toggle flags
 * KEY_FLG_TOGGLE_MASK = (KEY_FLG_TOGGLE_ON | KEY_FLG_TOGGLE_OFF)             # <<<<<<<<<<<<<<
 * ## bring screen cursor into braille window after function
 * KEY_FLG_MOTION_ROUTE = 0x0400
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_KEY_FLG_TOGGLE_ON); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KEY_FLG_TOGGLE_OFF); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_Or(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 626, __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;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_FLG_TOGGLE_MASK, __pyx_t_3) < 0) __PYX_ERR(3, 626, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "constants.auto.pyx":628
 * KEY_FLG_TOGGLE_MASK = (KEY_FLG_TOGGLE_ON | KEY_FLG_TOGGLE_OFF)
 * ## bring screen cursor into braille window after function
 * KEY_FLG_MOTION_ROUTE = 0x0400             # <<<<<<<<<<<<<<
 * ## scale arg=0X00-0XFF to screen height
 * KEY_FLG_MOTION_SCALED = 0x0800
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_FLG_MOTION_ROUTE, __pyx_int_1024) < 0) __PYX_ERR(3, 628, __pyx_L1_error)

  /* "constants.auto.pyx":630
 * KEY_FLG_MOTION_ROUTE = 0x0400
 * ## scale arg=0X00-0XFF to screen height
 * KEY_FLG_MOTION_SCALED = 0x0800             # <<<<<<<<<<<<<<
 * ## go to beginning of line
 * KEY_FLG_MOTION_TOLEFT = 0x1000
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_FLG_MOTION_SCALED, __pyx_int_2048) < 0) __PYX_ERR(3, 630, __pyx_L1_error)

  /* "constants.auto.pyx":632
 * KEY_FLG_MOTION_SCALED = 0x0800
 * ## go to beginning of line
 * KEY_FLG_MOTION_TOLEFT = 0x1000             # <<<<<<<<<<<<<<
 * ## shift key pressed
 * KEY_FLG_INPUT_SHIFT = 0x0100
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_FLG_MOTION_TOLEFT, __pyx_int_4096) < 0) __PYX_ERR(3, 632, __pyx_L1_error)

  /* "constants.auto.pyx":634
 * KEY_FLG_MOTION_TOLEFT = 0x1000
 * ## shift key pressed
 * KEY_FLG_INPUT_SHIFT = 0x0100             # <<<<<<<<<<<<<<
 * ## convert to uppercase
 * KEY_FLG_INPUT_UPPER = 0x0200
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_FLG_INPUT_SHIFT, __pyx_int_256) < 0) __PYX_ERR(3, 634, __pyx_L1_error)

  /* "constants.auto.pyx":636
 * KEY_FLG_INPUT_SHIFT = 0x0100
 * ## convert to uppercase
 * KEY_FLG_INPUT_UPPER = 0x0200             # <<<<<<<<<<<<<<
 * ## control key pressed
 * KEY_FLG_INPUT_CONTROL = 0x0400
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_FLG_INPUT_UPPER, __pyx_int_512) < 0) __PYX_ERR(3, 636, __pyx_L1_error)

  /* "constants.auto.pyx":638
 * KEY_FLG_INPUT_UPPER = 0x0200
 * ## control key pressed
 * KEY_FLG_INPUT_CONTROL = 0x0400             # <<<<<<<<<<<<<<
 * ## meta (left alt) key pressed
 * KEY_FLG_INPUT_META = 0x0800
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_FLG_INPUT_CONTROL, __pyx_int_1024) < 0) __PYX_ERR(3, 638, __pyx_L1_error)

  /* "constants.auto.pyx":640
 * KEY_FLG_INPUT_CONTROL = 0x0400
 * ## meta (left alt) key pressed
 * KEY_FLG_INPUT_META = 0x0800             # <<<<<<<<<<<<<<
 * ## altgr (right alt) key pressed
 * KEY_FLG_INPUT_ALTGR = 0x1000
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_FLG_INPUT_META, __pyx_int_2048) < 0) __PYX_ERR(3, 640, __pyx_L1_error)

  /* "constants.auto.pyx":642
 * KEY_FLG_INPUT_META = 0x0800
 * ## altgr (right alt) key pressed
 * KEY_FLG_INPUT_ALTGR = 0x1000             # <<<<<<<<<<<<<<
 * ## gui (windows) key pressed
 * KEY_FLG_INPUT_GUI = 0x2000
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_FLG_INPUT_ALTGR, __pyx_int_4096) < 0) __PYX_ERR(3, 642, __pyx_L1_error)

  /* "constants.auto.pyx":644
 * KEY_FLG_INPUT_ALTGR = 0x1000
 * ## gui (windows) key pressed
 * KEY_FLG_INPUT_GUI = 0x2000             # <<<<<<<<<<<<<<
 * ## prefix with escape
 * KEY_FLG_INPUT_ESCAPED = 0x4000
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_FLG_INPUT_GUI, __pyx_int_8192) < 0) __PYX_ERR(3, 644, __pyx_L1_error)

  /* "constants.auto.pyx":646
 * KEY_FLG_INPUT_GUI = 0x2000
 * ## prefix with escape
 * KEY_FLG_INPUT_ESCAPED = 0x4000             # <<<<<<<<<<<<<<
 * ## it is a release scan code
 * KEY_FLG_KBD_RELEASE = 0x0100
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_FLG_INPUT_ESCAPED, __pyx_int_16384) < 0) __PYX_ERR(3, 646, __pyx_L1_error)

  /* "constants.auto.pyx":648
 * KEY_FLG_INPUT_ESCAPED = 0x4000
 * ## it is a release scan code
 * KEY_FLG_KBD_RELEASE = 0x0100             # <<<<<<<<<<<<<<
 * ## it is an emulation 0 scan code
 * KEY_FLG_KBD_EMUL0 = 0x0200
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_FLG_KBD_RELEASE, __pyx_int_256) < 0) __PYX_ERR(3, 648, __pyx_L1_error)

  /* "constants.auto.pyx":650
 * KEY_FLG_KBD_RELEASE = 0x0100
 * ## it is an emulation 0 scan code
 * KEY_FLG_KBD_EMUL0 = 0x0200             # <<<<<<<<<<<<<<
 * ## it is an emulation 1 scan code
 * KEY_FLG_KBD_EMUL1 = 0x0400
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_FLG_KBD_EMUL0, __pyx_int_512) < 0) __PYX_ERR(3, 650, __pyx_L1_error)

  /* "constants.auto.pyx":652
 * KEY_FLG_KBD_EMUL0 = 0x0200
 * ## it is an emulation 1 scan code
 * KEY_FLG_KBD_EMUL1 = 0x0400             # <<<<<<<<<<<<<<
 * ## upper-left dot of standard braille cell
 * DOT1 = 1
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEY_FLG_KBD_EMUL1, __pyx_int_1024) < 0) __PYX_ERR(3, 652, __pyx_L1_error)

  /* "constants.auto.pyx":654
 * KEY_FLG_KBD_EMUL1 = 0x0400
 * ## upper-left dot of standard braille cell
 * DOT1 = 1             # <<<<<<<<<<<<<<
 * ## middle-left dot of standard braille cell
 * DOT2 = 2
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DOT1, __pyx_int_1) < 0) __PYX_ERR(3, 654, __pyx_L1_error)

  /* "constants.auto.pyx":656
 * DOT1 = 1
 * ## middle-left dot of standard braille cell
 * DOT2 = 2             # <<<<<<<<<<<<<<
 * ## lower-left dot of standard braille cell
 * DOT3 = 4
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DOT2, __pyx_int_2) < 0) __PYX_ERR(3, 656, __pyx_L1_error)

  /* "constants.auto.pyx":658
 * DOT2 = 2
 * ## lower-left dot of standard braille cell
 * DOT3 = 4             # <<<<<<<<<<<<<<
 * ## upper-right dot of standard braille cell
 * DOT4 = 8
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DOT3, __pyx_int_4) < 0) __PYX_ERR(3, 658, __pyx_L1_error)

  /* "constants.auto.pyx":660
 * DOT3 = 4
 * ## upper-right dot of standard braille cell
 * DOT4 = 8             # <<<<<<<<<<<<<<
 * ## middle-right dot of standard braille cell
 * DOT5 = 16
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DOT4, __pyx_int_8) < 0) __PYX_ERR(3, 660, __pyx_L1_error)

  /* "constants.auto.pyx":662
 * DOT4 = 8
 * ## middle-right dot of standard braille cell
 * DOT5 = 16             # <<<<<<<<<<<<<<
 * ## lower-right dot of standard braille cell
 * DOT6 = 32
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DOT5, __pyx_int_16) < 0) __PYX_ERR(3, 662, __pyx_L1_error)

  /* "constants.auto.pyx":664
 * DOT5 = 16
 * ## lower-right dot of standard braille cell
 * DOT6 = 32             # <<<<<<<<<<<<<<
 * ## lower-left dot of computer braille cell
 * DOT7 = 64
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DOT6, __pyx_int_32) < 0) __PYX_ERR(3, 664, __pyx_L1_error)

  /* "constants.auto.pyx":666
 * DOT6 = 32
 * ## lower-left dot of computer braille cell
 * DOT7 = 64             # <<<<<<<<<<<<<<
 * ## lower-right dot of computer braille cell
 * DOT8 = 128
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DOT7, __pyx_int_64) < 0) __PYX_ERR(3, 666, __pyx_L1_error)

  /* "constants.auto.pyx":668
 * DOT7 = 64
 * ## lower-right dot of computer braille cell
 * DOT8 = 128             # <<<<<<<<<<<<<<
 * ## chord (space bar on braille keyboard)
 * DOTC = 256
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DOT8, __pyx_int_128) < 0) __PYX_ERR(3, 668, __pyx_L1_error)

  /* "constants.auto.pyx":670
 * DOT8 = 128
 * ## chord (space bar on braille keyboard)
 * DOTC = 256             # <<<<<<<<<<<<<<
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DOTC, __pyx_int_256) < 0) __PYX_ERR(3, 670, __pyx_L1_error)

  /* "brlapi.pyx":126
 * include "constants.auto.pyx"
 * 
 * def getLibraryVersion():             # <<<<<<<<<<<<<<
 * 	"""Get the BrlAPI version as a three-element list (major, minor, revision).
 * 	See brlapi_getLibraryVersion(3)."""
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6brlapi_1getLibraryVersion, NULL, __pyx_n_s_brlapi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_getLibraryVersion, __pyx_t_3) < 0) __PYX_ERR(0, 126, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "brlapi.pyx":136
 * 	return (major, minor, revision)
 * 
 * def expandKeyCode(code):             # <<<<<<<<<<<<<<
 * 	"""Expand a keycode into its individual components.
 * 	See brlapi_expandKeyCode(3)."""
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6brlapi_3expandKeyCode, NULL, __pyx_n_s_brlapi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_expandKeyCode, __pyx_t_3) < 0) __PYX_ERR(0, 136, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "brlapi.pyx":152
 * 		}
 * 
 * def describeKeyCode(code):             # <<<<<<<<<<<<<<
 * 	"""Describe the individual components of a keycode symbolically.
 * 	See brlapi_describeKeyCode(3)."""
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6brlapi_5describeKeyCode, NULL, __pyx_n_s_brlapi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_describeKeyCode, __pyx_t_3) < 0) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "brlapi.pyx":220
 * 	return ret
 * 
 * class OperationError(Exception):             # <<<<<<<<<<<<<<
 * 	"""Error while performing some operation"""
 * 	def __init__(self):
 */
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_3, __pyx_n_s_OperationError, __pyx_n_s_OperationError, (PyObject *) NULL, __pyx_n_s_brlapi, __pyx_kp_s_Error_while_performing_some_oper); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "brlapi.pyx":222
 * class OperationError(Exception):
 * 	"""Error while performing some operation"""
 * 	def __init__(self):             # <<<<<<<<<<<<<<
 * 		cdef char *exception
 * 		exception = c_brlapi.brlapi_protocolException()
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6brlapi_14OperationError_1__init__, 0, __pyx_n_s_OperationError___init, NULL, __pyx_n_s_brlapi, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 222, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "brlapi.pyx":238
 * 				self.errfun = b""
 * 
 * 	def __str__(self):             # <<<<<<<<<<<<<<
 * 		cdef c_brlapi.brlapi_error_t error
 * 		cdef c_brlapi.size_t size
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6brlapi_14OperationError_3__str__, 0, __pyx_n_s_OperationError___str, NULL, __pyx_n_s_brlapi, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_str, __pyx_t_4) < 0) __PYX_ERR(0, 238, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "brlapi.pyx":220
 * 	return ret
 * 
 * class OperationError(Exception):             # <<<<<<<<<<<<<<
 * 	"""Error while performing some operation"""
 * 	def __init__(self):
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_OperationError, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_OperationError, __pyx_t_4) < 0) __PYX_ERR(0, 220, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __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;

  /* "brlapi.pyx":256
 * 		return ret
 * 
 * class ConnectionError(OperationError):             # <<<<<<<<<<<<<<
 * 	"""Error while connecting to BrlTTY"""
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_OperationError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_1, __pyx_n_s_ConnectionError, __pyx_n_s_ConnectionError, (PyObject *) NULL, __pyx_n_s_brlapi, __pyx_kp_s_Error_while_connecting_to_BrlTTY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "brlapi.pyx":259
 * 	"""Error while connecting to BrlTTY"""
 * 
 * 	def __init__(self, host, auth):             # <<<<<<<<<<<<<<
 * 		OperationError.__init__(self)
 * 		self.host = host
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6brlapi_15ConnectionError_1__init__, 0, __pyx_n_s_ConnectionError___init, NULL, __pyx_n_s_brlapi, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 259, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "brlapi.pyx":264
 * 		self.auth = auth
 * 
 * 	def __str__(self):             # <<<<<<<<<<<<<<
 * 		msg = "couldn't connect to %s with key %s: %s" % (self.host,self.auth,OperationError.__str__(self))
 * 		msg = msg + "\n(brlerrno %d, libcerrno %d, gaierrno %d)" % (self.brlerrno, self.libcerrno, self.gaierrno)
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6brlapi_15ConnectionError_3__str__, 0, __pyx_n_s_ConnectionError___str, NULL, __pyx_n_s_brlapi, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_str, __pyx_t_4) < 0) __PYX_ERR(0, 264, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "brlapi.pyx":275
 * 		return msg
 * 
 * 	def host(self):             # <<<<<<<<<<<<<<
 * 		"""Host of BRLTTY server"""
 * 		return self.settings.host
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6brlapi_15ConnectionError_5host, 0, __pyx_n_s_ConnectionError_host, NULL, __pyx_n_s_brlapi, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_host, __pyx_t_4) < 0) __PYX_ERR(0, 275, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "brlapi.pyx":279
 * 		return self.settings.host
 * 
 * 	def auth(self):             # <<<<<<<<<<<<<<
 * 		"""Authentication method used"""
 * 		return self.settings.auth
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6brlapi_15ConnectionError_7auth, 0, __pyx_n_s_ConnectionError_auth, NULL, __pyx_n_s_brlapi, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_auth, __pyx_t_4) < 0) __PYX_ERR(0, 279, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "brlapi.pyx":256
 * 		return ret
 * 
 * class ConnectionError(OperationError):             # <<<<<<<<<<<<<<
 * 	"""Error while connecting to BrlTTY"""
 * 
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_ConnectionError, __pyx_t_1, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ConnectionError, __pyx_t_4) < 0) __PYX_ERR(0, 256, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "brlapi.pyx":525
 * 				return identifier
 * 
 * 	def enterTtyMode(self, tty = TTY_DEFAULT, driver = None):             # <<<<<<<<<<<<<<
 * 		"""Ask for some tty, with some key mechanism
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_TTY_DEFAULT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k__8 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "brlapi.pyx":550
 * 			return retval
 * 
 * 	def enterTtyModeWithPath(self, path = [], driver = None):             # <<<<<<<<<<<<<<
 * 		"""Ask for some tty, with some key mechanism
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k__9 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "brlapi.pyx":676
 * 			return retval
 * 
 * 	def writeText(self, text, cursor = CURSOR_OFF):             # <<<<<<<<<<<<<<
 * 		"""Write the given \0-terminated string to the braille display.
 * 		See brlapi_writeText(3).
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CURSOR_OFF); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k__11 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "brlapi.pyx":1
 * """             # <<<<<<<<<<<<<<
 * This module implements a set of bindings for BrlAPI, a braille bridge for applications.
 * 
 */
  __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 brlapi", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_CLEAR(__pyx_m);
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init brlapi");
  }
  __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;
}

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

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
#if PY_MAJOR_VERSION >= 3
    PyObject *kwdefs;
#endif
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
        return NULL;
    }
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif
#endif

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = Py_TYPE(func)->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

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

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

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

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

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

/* decode_c_bytes */
static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
         const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    if (unlikely((start < 0) | (stop < 0))) {
        if (start < 0) {
            start += length;
            if (start < 0)
                start = 0;
        }
        if (stop < 0)
            stop += length;
    }
    if (stop > length)
        stop = length;
    if (unlikely(stop <= start))
        return __Pyx_NewRef(__pyx_empty_unicode);
    length = stop - start;
    cstring += start;
    if (decode_func) {
        return decode_func(cstring, length, errors);
    } else {
        return PyUnicode_Decode(cstring, length, encoding, errors);
    }
}

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

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

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

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

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

/* ArgTypeTest */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    else if (exact) {
        #if PY_MAJOR_VERSION == 2
        if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 0;
}

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

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

/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
           exc_info->previous_item != NULL)
    {
        exc_info = exc_info->previous_item;
    }
    return exc_info;
}
#endif

/* SaveResetException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    #endif
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = type;
    exc_info->exc_value = value;
    exc_info->exc_traceback = tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
#endif

/* PyErrExceptionMatches */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    if (unlikely(PyTuple_Check(err)))
        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* GetException */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
#endif
{
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if CYTHON_USE_EXC_INFO_STACK
    {
        _PyErr_StackItem *exc_info = tstate->exc_info;
        tmp_type = exc_info->exc_type;
        tmp_value = exc_info->exc_value;
        tmp_tb = exc_info->exc_traceback;
        exc_info->exc_type = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
    }
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

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

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

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

/* 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
    Py_INCREF(m->func_qualname);
    return m->func_qualname;
#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);
            PyErr_Format(PyExc_TypeError,
                         "unbound method %.200S() needs an argument",
                         cyfunc->func_qualname);
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
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 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
#if CYTHON_COMPILING_IN_PYPY && 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;
}

/* PyObject_GenericGetAttrNoDict */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, attr_name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(attr_name));
#endif
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
    PyObject *descr;
    PyTypeObject *tp = Py_TYPE(obj);
    if (unlikely(!PyString_Check(attr_name))) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    assert(!tp->tp_dictoffset);
    descr = _PyType_Lookup(tp, attr_name);
    if (unlikely(!descr)) {
        return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
    }
    Py_INCREF(descr);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
    #endif
    {
        descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
        if (unlikely(f)) {
            PyObject *res = f(descr, obj, (PyObject *)tp);
            Py_DECREF(descr);
            return res;
        }
    }
    return descr;
}
#endif

/* PyObject_GenericGetAttr */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
    if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
}
#endif

/* PyObjectGetAttrStrNoError */
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        __Pyx_PyErr_Clear();
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
    PyObject *result;
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
        return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
    }
#endif
    result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
    if (unlikely(!result)) {
        __Pyx_PyObject_GetAttrStr_ClearAttributeError();
    }
    return result;
}

/* SetupReduce */
static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
  if (likely(name_attr)) {
      ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
  } else {
      ret = -1;
  }
  if (unlikely(ret < 0)) {
      PyErr_Clear();
      ret = 0;
  }
  Py_XDECREF(name_attr);
  return ret;
}
static int __Pyx_setup_reduce(PyObject* type_obj) {
    int ret = 0;
    PyObject *object_reduce = NULL;
    PyObject *object_getstate = NULL;
    PyObject *object_reduce_ex = NULL;
    PyObject *reduce = NULL;
    PyObject *reduce_ex = NULL;
    PyObject *reduce_cython = NULL;
    PyObject *setstate = NULL;
    PyObject *setstate_cython = NULL;
    PyObject *getstate = NULL;
#if CYTHON_USE_PYTYPE_LOOKUP
    getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
#else
    getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
    if (!getstate && PyErr_Occurred()) {
        goto __PYX_BAD;
    }
#endif
    if (getstate) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
#else
        object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
        if (!object_getstate && PyErr_Occurred()) {
            goto __PYX_BAD;
        }
#endif
        if (object_getstate != getstate) {
            goto __PYX_GOOD;
        }
    }
#if CYTHON_USE_PYTYPE_LOOKUP
    object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#else
    object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#endif
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
    if (reduce_ex == object_reduce_ex) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
#else
        object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
#endif
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
        if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
            reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
            if (likely(reduce_cython)) {
                ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
            } else if (reduce == object_reduce || PyErr_Occurred()) {
                goto __PYX_BAD;
            }
            setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
            if (!setstate) PyErr_Clear();
            if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
                setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
                if (likely(setstate_cython)) {
                    ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                    ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                } else if (!setstate || PyErr_Occurred()) {
                    goto __PYX_BAD;
                }
            }
            PyType_Modified((PyTypeObject*)type_obj);
        }
    }
    goto __PYX_GOOD;
__PYX_BAD:
    if (!PyErr_Occurred())
        PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
    ret = -1;
__PYX_GOOD:
#if !CYTHON_USE_PYTYPE_LOOKUP
    Py_XDECREF(object_reduce);
    Py_XDECREF(object_reduce_ex);
    Py_XDECREF(object_getstate);
    Py_XDECREF(getstate);
#endif
    Py_XDECREF(reduce);
    Py_XDECREF(reduce_ex);
    Py_XDECREF(reduce_cython);
    Py_XDECREF(setstate);
    Py_XDECREF(setstate_cython);
    return ret;
}

/* TypeImport */
#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
    size_t size, enum __Pyx_ImportType_CheckSize check_size)
{
    PyObject *result = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#endif
    result = PyObject_GetAttrString(module, class_name);
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if ((size_t)basicsize < size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        goto bad;
    }
    if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        goto bad;
    }
    else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(result);
    return NULL;
}
#endif

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if ((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;
}

/* 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;
        (void) 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"
#if PY_VERSION_HEX >= 0x030b00a6
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = NULL;
    PyObject *py_funcname = NULL;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_srcfile = NULL;
    py_srcfile = PyString_FromString(filename);
    if (!py_srcfile) goto bad;
    #endif
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        funcname = PyUnicode_AsUTF8(py_funcname);
        if (!funcname) goto bad;
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        if (!py_funcname) goto bad;
        #endif
    }
    #if PY_MAJOR_VERSION < 3
    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);
    #else
    py_code = PyCode_NewEmpty(filename, funcname, py_line);
    #endif
    Py_XDECREF(py_funcname);  // XDECREF since it's only set on Py3 if cline
    return py_code;
bad:
    Py_XDECREF(py_funcname);
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_srcfile);
    #endif
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject *ptype, *pvalue, *ptraceback;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) {
            /* If the code object creation fails, then we should clear the
               fetched exception references and propagate the new exception */
            Py_XDECREF(ptype);
            Py_XDECREF(pvalue);
            Py_XDECREF(ptraceback);
            goto bad;
        }
        __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_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);
}

/* CIntFromPyVerify */
#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_brlapi_keyCode_t(brlapi_keyCode_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const brlapi_keyCode_t neg_one = (brlapi_keyCode_t) -1, const_zero = (brlapi_keyCode_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(brlapi_keyCode_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(brlapi_keyCode_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(brlapi_keyCode_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(brlapi_keyCode_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(brlapi_keyCode_t) <= 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(brlapi_keyCode_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
static CYTHON_INLINE brlapi_keyCode_t __Pyx_PyInt_As_brlapi_keyCode_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const brlapi_keyCode_t neg_one = (brlapi_keyCode_t) -1, const_zero = (brlapi_keyCode_t) 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(brlapi_keyCode_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(brlapi_keyCode_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (brlapi_keyCode_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (brlapi_keyCode_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(brlapi_keyCode_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(brlapi_keyCode_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(brlapi_keyCode_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(brlapi_keyCode_t) >= 2 * PyLong_SHIFT) {
                            return (brlapi_keyCode_t) (((((brlapi_keyCode_t)digits[1]) << PyLong_SHIFT) | (brlapi_keyCode_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(brlapi_keyCode_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(brlapi_keyCode_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(brlapi_keyCode_t) >= 3 * PyLong_SHIFT) {
                            return (brlapi_keyCode_t) (((((((brlapi_keyCode_t)digits[2]) << PyLong_SHIFT) | (brlapi_keyCode_t)digits[1]) << PyLong_SHIFT) | (brlapi_keyCode_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(brlapi_keyCode_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(brlapi_keyCode_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(brlapi_keyCode_t) >= 4 * PyLong_SHIFT) {
                            return (brlapi_keyCode_t) (((((((((brlapi_keyCode_t)digits[3]) << PyLong_SHIFT) | (brlapi_keyCode_t)digits[2]) << PyLong_SHIFT) | (brlapi_keyCode_t)digits[1]) << PyLong_SHIFT) | (brlapi_keyCode_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (brlapi_keyCode_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(brlapi_keyCode_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(brlapi_keyCode_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(brlapi_keyCode_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(brlapi_keyCode_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (brlapi_keyCode_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(brlapi_keyCode_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(brlapi_keyCode_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(brlapi_keyCode_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(brlapi_keyCode_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(brlapi_keyCode_t) - 1 > 2 * PyLong_SHIFT) {
                            return (brlapi_keyCode_t) (((brlapi_keyCode_t)-1)*(((((brlapi_keyCode_t)digits[1]) << PyLong_SHIFT) | (brlapi_keyCode_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(brlapi_keyCode_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(brlapi_keyCode_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(brlapi_keyCode_t) - 1 > 2 * PyLong_SHIFT) {
                            return (brlapi_keyCode_t) ((((((brlapi_keyCode_t)digits[1]) << PyLong_SHIFT) | (brlapi_keyCode_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(brlapi_keyCode_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(brlapi_keyCode_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(brlapi_keyCode_t) - 1 > 3 * PyLong_SHIFT) {
                            return (brlapi_keyCode_t) (((brlapi_keyCode_t)-1)*(((((((brlapi_keyCode_t)digits[2]) << PyLong_SHIFT) | (brlapi_keyCode_t)digits[1]) << PyLong_SHIFT) | (brlapi_keyCode_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(brlapi_keyCode_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(brlapi_keyCode_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(brlapi_keyCode_t) - 1 > 3 * PyLong_SHIFT) {
                            return (brlapi_keyCode_t) ((((((((brlapi_keyCode_t)digits[2]) << PyLong_SHIFT) | (brlapi_keyCode_t)digits[1]) << PyLong_SHIFT) | (brlapi_keyCode_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(brlapi_keyCode_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(brlapi_keyCode_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(brlapi_keyCode_t) - 1 > 4 * PyLong_SHIFT) {
                            return (brlapi_keyCode_t) (((brlapi_keyCode_t)-1)*(((((((((brlapi_keyCode_t)digits[3]) << PyLong_SHIFT) | (brlapi_keyCode_t)digits[2]) << PyLong_SHIFT) | (brlapi_keyCode_t)digits[1]) << PyLong_SHIFT) | (brlapi_keyCode_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(brlapi_keyCode_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(brlapi_keyCode_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(brlapi_keyCode_t) - 1 > 4 * PyLong_SHIFT) {
                            return (brlapi_keyCode_t) ((((((((((brlapi_keyCode_t)digits[3]) << PyLong_SHIFT) | (brlapi_keyCode_t)digits[2]) << PyLong_SHIFT) | (brlapi_keyCode_t)digits[1]) << PyLong_SHIFT) | (brlapi_keyCode_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(brlapi_keyCode_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(brlapi_keyCode_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(brlapi_keyCode_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(brlapi_keyCode_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            brlapi_keyCode_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (brlapi_keyCode_t) -1;
        }
    } else {
        brlapi_keyCode_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (brlapi_keyCode_t) -1;
        val = __Pyx_PyInt_As_brlapi_keyCode_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to brlapi_keyCode_t");
    return (brlapi_keyCode_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to brlapi_keyCode_t");
    return (brlapi_keyCode_t) -1;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(unsigned int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(unsigned int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(unsigned int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(unsigned int),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(unsigned int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (unsigned 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 (unsigned int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, digits[0])
                case 2:
                    if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT) {
                            return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT) {
                            return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) >= 4 * PyLong_SHIFT) {
                            return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (unsigned int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(unsigned int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (unsigned int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(unsigned int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(unsigned int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
                            return (unsigned int) (((unsigned int)-1)*(((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
                            return (unsigned int) ((((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
                            return (unsigned int) (((unsigned int)-1)*(((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
                            return (unsigned int) ((((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) {
                            return (unsigned int) (((unsigned int)-1)*(((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) {
                            return (unsigned int) ((((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(unsigned int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            unsigned 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 (unsigned int) -1;
        }
    } else {
        unsigned int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (unsigned int) -1;
        val = __Pyx_PyInt_As_unsigned_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to unsigned int");
    return (unsigned int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to unsigned int");
    return (unsigned int) -1;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_brlapi_param_type_t(brlapi_param_type_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const brlapi_param_type_t neg_one = (brlapi_param_type_t) -1, const_zero = (brlapi_param_type_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(brlapi_param_type_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(brlapi_param_type_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(brlapi_param_type_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(brlapi_param_type_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(brlapi_param_type_t) <= 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(brlapi_param_type_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint8_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint8_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(uint8_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint8_t) <= 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(uint8_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint16_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint16_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(uint16_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint16_t) <= 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(uint16_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint32_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint32_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(uint32_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint32_t) <= 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(uint32_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint64_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint64_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(uint64_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint64_t) <= 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(uint64_t),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(size_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (size_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (size_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) {
                            return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) {
                            return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) {
                            return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (size_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(size_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (size_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(size_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                            return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                            return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
                            return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(size_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            size_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (size_t) -1;
        }
    } else {
        size_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (size_t) -1;
        val = __Pyx_PyInt_As_size_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to size_t");
    return (size_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to size_t");
    return (size_t) -1;
}

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

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

/* CIntFromPy */
static CYTHON_INLINE brlapi_rangeType_t __Pyx_PyInt_As_brlapi_rangeType_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const brlapi_rangeType_t neg_one = (brlapi_rangeType_t) -1, const_zero = (brlapi_rangeType_t) 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(brlapi_rangeType_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(brlapi_rangeType_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (brlapi_rangeType_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (brlapi_rangeType_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(brlapi_rangeType_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(brlapi_rangeType_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(brlapi_rangeType_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(brlapi_rangeType_t) >= 2 * PyLong_SHIFT) {
                            return (brlapi_rangeType_t) (((((brlapi_rangeType_t)digits[1]) << PyLong_SHIFT) | (brlapi_rangeType_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(brlapi_rangeType_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(brlapi_rangeType_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(brlapi_rangeType_t) >= 3 * PyLong_SHIFT) {
                            return (brlapi_rangeType_t) (((((((brlapi_rangeType_t)digits[2]) << PyLong_SHIFT) | (brlapi_rangeType_t)digits[1]) << PyLong_SHIFT) | (brlapi_rangeType_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(brlapi_rangeType_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(brlapi_rangeType_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(brlapi_rangeType_t) >= 4 * PyLong_SHIFT) {
                            return (brlapi_rangeType_t) (((((((((brlapi_rangeType_t)digits[3]) << PyLong_SHIFT) | (brlapi_rangeType_t)digits[2]) << PyLong_SHIFT) | (brlapi_rangeType_t)digits[1]) << PyLong_SHIFT) | (brlapi_rangeType_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (brlapi_rangeType_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(brlapi_rangeType_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(brlapi_rangeType_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(brlapi_rangeType_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(brlapi_rangeType_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (brlapi_rangeType_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(brlapi_rangeType_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(brlapi_rangeType_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(brlapi_rangeType_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(brlapi_rangeType_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(brlapi_rangeType_t) - 1 > 2 * PyLong_SHIFT) {
                            return (brlapi_rangeType_t) (((brlapi_rangeType_t)-1)*(((((brlapi_rangeType_t)digits[1]) << PyLong_SHIFT) | (brlapi_rangeType_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(brlapi_rangeType_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(brlapi_rangeType_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(brlapi_rangeType_t) - 1 > 2 * PyLong_SHIFT) {
                            return (brlapi_rangeType_t) ((((((brlapi_rangeType_t)digits[1]) << PyLong_SHIFT) | (brlapi_rangeType_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(brlapi_rangeType_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(brlapi_rangeType_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(brlapi_rangeType_t) - 1 > 3 * PyLong_SHIFT) {
                            return (brlapi_rangeType_t) (((brlapi_rangeType_t)-1)*(((((((brlapi_rangeType_t)digits[2]) << PyLong_SHIFT) | (brlapi_rangeType_t)digits[1]) << PyLong_SHIFT) | (brlapi_rangeType_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(brlapi_rangeType_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(brlapi_rangeType_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(brlapi_rangeType_t) - 1 > 3 * PyLong_SHIFT) {
                            return (brlapi_rangeType_t) ((((((((brlapi_rangeType_t)digits[2]) << PyLong_SHIFT) | (brlapi_rangeType_t)digits[1]) << PyLong_SHIFT) | (brlapi_rangeType_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(brlapi_rangeType_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(brlapi_rangeType_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(brlapi_rangeType_t) - 1 > 4 * PyLong_SHIFT) {
                            return (brlapi_rangeType_t) (((brlapi_rangeType_t)-1)*(((((((((brlapi_rangeType_t)digits[3]) << PyLong_SHIFT) | (brlapi_rangeType_t)digits[2]) << PyLong_SHIFT) | (brlapi_rangeType_t)digits[1]) << PyLong_SHIFT) | (brlapi_rangeType_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(brlapi_rangeType_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(brlapi_rangeType_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(brlapi_rangeType_t) - 1 > 4 * PyLong_SHIFT) {
                            return (brlapi_rangeType_t) ((((((((((brlapi_rangeType_t)digits[3]) << PyLong_SHIFT) | (brlapi_rangeType_t)digits[2]) << PyLong_SHIFT) | (brlapi_rangeType_t)digits[1]) << PyLong_SHIFT) | (brlapi_rangeType_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(brlapi_rangeType_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(brlapi_rangeType_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(brlapi_rangeType_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(brlapi_rangeType_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            brlapi_rangeType_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (brlapi_rangeType_t) -1;
        }
    } else {
        brlapi_rangeType_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (brlapi_rangeType_t) -1;
        val = __Pyx_PyInt_As_brlapi_rangeType_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to brlapi_rangeType_t");
    return (brlapi_rangeType_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to brlapi_rangeType_t");
    return (brlapi_rangeType_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE brlapi_param_t __Pyx_PyInt_As_brlapi_param_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const brlapi_param_t neg_one = (brlapi_param_t) -1, const_zero = (brlapi_param_t) 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(brlapi_param_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(brlapi_param_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (brlapi_param_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (brlapi_param_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(brlapi_param_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(brlapi_param_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(brlapi_param_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(brlapi_param_t) >= 2 * PyLong_SHIFT) {
                            return (brlapi_param_t) (((((brlapi_param_t)digits[1]) << PyLong_SHIFT) | (brlapi_param_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(brlapi_param_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(brlapi_param_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(brlapi_param_t) >= 3 * PyLong_SHIFT) {
                            return (brlapi_param_t) (((((((brlapi_param_t)digits[2]) << PyLong_SHIFT) | (brlapi_param_t)digits[1]) << PyLong_SHIFT) | (brlapi_param_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(brlapi_param_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(brlapi_param_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(brlapi_param_t) >= 4 * PyLong_SHIFT) {
                            return (brlapi_param_t) (((((((((brlapi_param_t)digits[3]) << PyLong_SHIFT) | (brlapi_param_t)digits[2]) << PyLong_SHIFT) | (brlapi_param_t)digits[1]) << PyLong_SHIFT) | (brlapi_param_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (brlapi_param_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(brlapi_param_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(brlapi_param_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(brlapi_param_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(brlapi_param_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (brlapi_param_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(brlapi_param_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(brlapi_param_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(brlapi_param_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(brlapi_param_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(brlapi_param_t) - 1 > 2 * PyLong_SHIFT) {
                            return (brlapi_param_t) (((brlapi_param_t)-1)*(((((brlapi_param_t)digits[1]) << PyLong_SHIFT) | (brlapi_param_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(brlapi_param_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(brlapi_param_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(brlapi_param_t) - 1 > 2 * PyLong_SHIFT) {
                            return (brlapi_param_t) ((((((brlapi_param_t)digits[1]) << PyLong_SHIFT) | (brlapi_param_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(brlapi_param_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(brlapi_param_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(brlapi_param_t) - 1 > 3 * PyLong_SHIFT) {
                            return (brlapi_param_t) (((brlapi_param_t)-1)*(((((((brlapi_param_t)digits[2]) << PyLong_SHIFT) | (brlapi_param_t)digits[1]) << PyLong_SHIFT) | (brlapi_param_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(brlapi_param_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(brlapi_param_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(brlapi_param_t) - 1 > 3 * PyLong_SHIFT) {
                            return (brlapi_param_t) ((((((((brlapi_param_t)digits[2]) << PyLong_SHIFT) | (brlapi_param_t)digits[1]) << PyLong_SHIFT) | (brlapi_param_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(brlapi_param_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(brlapi_param_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(brlapi_param_t) - 1 > 4 * PyLong_SHIFT) {
                            return (brlapi_param_t) (((brlapi_param_t)-1)*(((((((((brlapi_param_t)digits[3]) << PyLong_SHIFT) | (brlapi_param_t)digits[2]) << PyLong_SHIFT) | (brlapi_param_t)digits[1]) << PyLong_SHIFT) | (brlapi_param_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(brlapi_param_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(brlapi_param_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(brlapi_param_t) - 1 > 4 * PyLong_SHIFT) {
                            return (brlapi_param_t) ((((((((((brlapi_param_t)digits[3]) << PyLong_SHIFT) | (brlapi_param_t)digits[2]) << PyLong_SHIFT) | (brlapi_param_t)digits[1]) << PyLong_SHIFT) | (brlapi_param_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(brlapi_param_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(brlapi_param_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(brlapi_param_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(brlapi_param_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            brlapi_param_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (brlapi_param_t) -1;
        }
    } else {
        brlapi_param_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (brlapi_param_t) -1;
        val = __Pyx_PyInt_As_brlapi_param_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to brlapi_param_t");
    return (brlapi_param_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to brlapi_param_t");
    return (brlapi_param_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 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(uint64_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(uint64_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (uint64_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (uint64_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(uint64_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(uint64_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint64_t) >= 2 * PyLong_SHIFT) {
                            return (uint64_t) (((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(uint64_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint64_t) >= 3 * PyLong_SHIFT) {
                            return (uint64_t) (((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(uint64_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint64_t) >= 4 * PyLong_SHIFT) {
                            return (uint64_t) (((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (uint64_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(uint64_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (uint64_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(uint64_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(uint64_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(uint64_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT) {
                            return (uint64_t) (((uint64_t)-1)*(((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(uint64_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT) {
                            return (uint64_t) ((((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT) {
                            return (uint64_t) (((uint64_t)-1)*(((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(uint64_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT) {
                            return (uint64_t) ((((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint64_t) - 1 > 4 * PyLong_SHIFT) {
                            return (uint64_t) (((uint64_t)-1)*(((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(uint64_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint64_t) - 1 > 4 * PyLong_SHIFT) {
                            return (uint64_t) ((((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(uint64_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint64_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint64_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            uint64_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (uint64_t) -1;
        }
    } else {
        uint64_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (uint64_t) -1;
        val = __Pyx_PyInt_As_uint64_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to uint64_t");
    return (uint64_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to uint64_t");
    return (uint64_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 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(uint32_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (uint32_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (uint32_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT) {
                            return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT) {
                            return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT) {
                            return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (uint32_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(uint32_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (uint32_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(uint32_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(uint32_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) {
                            return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) {
                            return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) {
                            return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) {
                            return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) {
                            return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) {
                            return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(uint32_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            uint32_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (uint32_t) -1;
        }
    } else {
        uint32_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (uint32_t) -1;
        val = __Pyx_PyInt_As_uint32_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to uint32_t");
    return (uint32_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to uint32_t");
    return (uint32_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 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(uint8_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(uint8_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (uint8_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (uint8_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(uint8_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint8_t) >= 2 * PyLong_SHIFT) {
                            return (uint8_t) (((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint8_t) >= 3 * PyLong_SHIFT) {
                            return (uint8_t) (((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint8_t) >= 4 * PyLong_SHIFT) {
                            return (uint8_t) (((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (uint8_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(uint8_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (uint8_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(uint8_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(uint8_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(uint8_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) {
                            return (uint8_t) (((uint8_t)-1)*(((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) {
                            return (uint8_t) ((((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) {
                            return (uint8_t) (((uint8_t)-1)*(((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) {
                            return (uint8_t) ((((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT) {
                            return (uint8_t) (((uint8_t)-1)*(((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT) {
                            return (uint8_t) ((((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(uint8_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint8_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint8_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            uint8_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (uint8_t) -1;
        }
    } else {
        uint8_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (uint8_t) -1;
        val = __Pyx_PyInt_As_uint8_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to uint8_t");
    return (uint8_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to uint8_t");
    return (uint8_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 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(uint16_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(uint16_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (uint16_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (uint16_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(uint16_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(uint16_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint16_t) >= 2 * PyLong_SHIFT) {
                            return (uint16_t) (((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(uint16_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint16_t) >= 3 * PyLong_SHIFT) {
                            return (uint16_t) (((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(uint16_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint16_t) >= 4 * PyLong_SHIFT) {
                            return (uint16_t) (((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (uint16_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(uint16_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint16_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint16_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (uint16_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(uint16_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(uint16_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(uint16_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT) {
                            return (uint16_t) (((uint16_t)-1)*(((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(uint16_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT) {
                            return (uint16_t) ((((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT) {
                            return (uint16_t) (((uint16_t)-1)*(((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(uint16_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT) {
                            return (uint16_t) ((((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint16_t) - 1 > 4 * PyLong_SHIFT) {
                            return (uint16_t) (((uint16_t)-1)*(((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(uint16_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint16_t) - 1 > 4 * PyLong_SHIFT) {
                            return (uint16_t) ((((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(uint16_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint16_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(uint16_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint16_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            uint16_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (uint16_t) -1;
        }
    } else {
        uint16_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (uint16_t) -1;
        val = __Pyx_PyInt_As_uint16_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to uint16_t");
    return (uint16_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to uint16_t");
    return (uint16_t) -1;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_brlapi_param_t(brlapi_param_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const brlapi_param_t neg_one = (brlapi_param_t) -1, const_zero = (brlapi_param_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(brlapi_param_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(brlapi_param_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(brlapi_param_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(brlapi_param_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(brlapi_param_t) <= 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(brlapi_param_t),
                                     little, !is_unsigned);
    }
}

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

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

/* CheckBinaryVersion */
static int __Pyx_check_binary_version(void) {
    char ctversion[5];
    int same=1, i, found_dot;
    const char* rt_from_call = Py_GetVersion();
    PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    found_dot = 0;
    for (i = 0; i < 4; i++) {
        if (!ctversion[i]) {
            same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
            break;
        }
        if (rt_from_call[i] != ctversion[i]) {
            same = 0;
            break;
        }
    }
    if (!same) {
        char rtversion[5] = {'\0'};
        char message[200];
        for (i=0; i<4; ++i) {
            if (rt_from_call[i] == '.') {
                if (found_dot) break;
                found_dot = 1;
            } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
                break;
            }
            rtversion[i] = rt_from_call[i];
        }
        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 Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
    return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
#if PY_MAJOR_VERSION < 3
  } else if (likely(PyInt_CheckExact(o))) {
    return PyInt_AS_LONG(o);
#endif
  } else {
    Py_ssize_t ival;
    PyObject *x;
    x = PyNumber_Index(o);
    if (!x) return -1;
    ival = PyInt_AsLong(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 */
