/* Generated by Cython 0.20 on Fri Apr 25 13:50:52 2014 */

#define PY_SSIZE_T_CLEAN
#ifndef CYTHON_USE_PYLONG_INTERNALS
#ifdef PYLONG_BITS_IN_DIGIT
#define CYTHON_USE_PYLONG_INTERNALS 0
#else
#include "pyconfig.h"
#ifdef PYLONG_BITS_IN_DIGIT
#define CYTHON_USE_PYLONG_INTERNALS 1
#else
#define CYTHON_USE_PYLONG_INTERNALS 0
#endif
#endif
#endif
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02040000
    #error Cython requires Python 2.4+.
#else
#define CYTHON_ABI "0_20"
#include <stddef.h> /* For offsetof */
#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
#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_CPYTHON 0
#else
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 1
#endif
#if CYTHON_COMPILING_IN_PYPY
#define Py_OptimizeFlag 0
#endif
#if PY_VERSION_HEX < 0x02050000
  typedef int Py_ssize_t;
  #define PY_SSIZE_T_MAX INT_MAX
  #define PY_SSIZE_T_MIN INT_MIN
  #define PY_FORMAT_SIZE_T ""
  #define CYTHON_FORMAT_SSIZE_T ""
  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_As_int(o)
  #define PyNumber_Index(o)    ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
                                (PyErr_Format(PyExc_TypeError, \
                                              "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
                                 (PyObject*)0))
  #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
                                  !PyComplex_Check(o))
  #define PyIndex_Check __Pyx_PyIndex_Check
  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
  #define __PYX_BUILD_PY_SSIZE_T "i"
#else
  #define __PYX_BUILD_PY_SSIZE_T "n"
  #define CYTHON_FORMAT_SSIZE_T "z"
  #define __Pyx_PyIndex_Check PyIndex_Check
#endif
#if PY_VERSION_HEX < 0x02060000
  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
  #define PyVarObject_HEAD_INIT(type, size) \
          PyObject_HEAD_INIT(type) size,
  #define PyType_Modified(t)
  typedef struct {
     void *buf;
     PyObject *obj;
     Py_ssize_t len;
     Py_ssize_t itemsize;
     int readonly;
     int ndim;
     char *format;
     Py_ssize_t *shape;
     Py_ssize_t *strides;
     Py_ssize_t *suboffsets;
     void *internal;
  } Py_buffer;
  #define PyBUF_SIMPLE 0
  #define PyBUF_WRITABLE 0x0001
  #define PyBUF_FORMAT 0x0004
  #define PyBUF_ND 0x0008
  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
  #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
  #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
  typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
  typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
#endif
#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, 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_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 PyType_Type
#endif
#if PY_VERSION_HEX < 0x02060000
  #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
#endif
#if PY_MAJOR_VERSION >= 3
  #define Py_TPFLAGS_CHECKTYPES 0
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#if PY_VERSION_HEX < 0x02060000
  #define Py_TPFLAGS_HAVE_VERSION_TAG 0
#endif
#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT)
  #define Py_TPFLAGS_IS_ABSTRACT 0
#endif
#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_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)
#else
  #define CYTHON_PEP393_ENABLED 0
  #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_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]))
#endif
#define __Pyx_PyString_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#define __Pyx_PyUnicode_Concat(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
    PyNumber_Add(a, b) : PyUnicode_Concat(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
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif
#if PY_VERSION_HEX < 0x02060000
  #define PyBytesObject                PyStringObject
  #define PyBytes_Type                 PyString_Type
  #define PyBytes_Check                PyString_Check
  #define PyBytes_CheckExact           PyString_CheckExact
  #define PyBytes_FromString           PyString_FromString
  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
  #define PyBytes_FromFormat           PyString_FromFormat
  #define PyBytes_DecodeEscape         PyString_DecodeEscape
  #define PyBytes_AsString             PyString_AsString
  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
  #define PyBytes_Size                 PyString_Size
  #define PyBytes_AS_STRING            PyString_AS_STRING
  #define PyBytes_GET_SIZE             PyString_GET_SIZE
  #define PyBytes_Repr                 PyString_Repr
  #define PyBytes_Concat               PyString_Concat
  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
#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_CheckExact(obj) || PyUnicode_CheckExact(obj) || \
                                         PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#if PY_VERSION_HEX < 0x02060000
  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#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_VERSION_HEX < 0x03020000
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
#else
  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#endif
#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
#else
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
#endif
#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_NAMESTR(n) ((char *)(n))
  #define __Pyx_DOCSTR(n)  ((char *)(n))
#else
  #define __Pyx_NAMESTR(n) (n)
  #define __Pyx_DOCSTR(n)  (n)
#endif
#ifndef CYTHON_INLINE
  #if 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
#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
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
   a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
   a quiet NaN. */
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif


#if PY_MAJOR_VERSION >= 3
  #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

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

#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#define __PYX_HAVE__ctff
#define __PYX_HAVE_API__ctff
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#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
typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#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 char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE 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(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_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromUString(s)  __Pyx_PyObject_FromString((char*)s)
#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((char*)s)
#define __Pyx_PyByteArray_FromUString(s)   __Pyx_PyByteArray_FromString((char*)s)
#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((char*)s)
#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return u_end - u - 1;
}
#else
#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
#endif
#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_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
#if CYTHON_COMPILING_IN_CPYTHON
#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 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys = NULL;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    sys = PyImport_ImportModule("sys");
    if (sys == NULL) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    if (default_encoding == NULL) goto bad;
    if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        const char* default_encoding_c = PyBytes_AS_STRING(default_encoding);
        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 == NULL) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (ascii_chars_b == NULL || strncmp(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_XDECREF(sys);
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return 0;
bad:
    Py_XDECREF(sys);
    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 = NULL;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (sys == NULL) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    if (default_encoding == NULL) goto bad;
    default_encoding_c = PyBytes_AS_STRING(default_encoding);
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(sys);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(sys);
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


#ifdef __GNUC__
  /* Test for GCC > 2.95 */
  #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
    #define likely(x)   __builtin_expect(!!(x), 1)
    #define unlikely(x) __builtin_expect(!!(x), 0)
  #else /* __GNUC__ > 2 ... */
    #define likely(x)   (x)
    #define unlikely(x) (x)
  #endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */

static PyObject *__pyx_m;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
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[] = {
  "ctff.pyx",
};

/*--- Type declarations ---*/
struct __pyx_obj_4ctff___pyx_scope_struct_2_process_input;
struct __pyx_obj_4ctff___pyx_scope_struct_4_start;
struct __pyx_obj_4ctff___pyx_scope_struct____iter__;
struct __pyx_obj_4ctff___pyx_scope_struct_1___iter__;
struct __pyx_obj_4ctff___pyx_scope_struct_3_drive;
struct __pyx_defaults;
typedef struct __pyx_defaults __pyx_defaults;
struct __pyx_defaults1;
typedef struct __pyx_defaults1 __pyx_defaults1;
struct __pyx_defaults2;
typedef struct __pyx_defaults2 __pyx_defaults2;
struct __pyx_defaults3;
typedef struct __pyx_defaults3 __pyx_defaults3;
struct __pyx_defaults4;
typedef struct __pyx_defaults4 __pyx_defaults4;
struct __pyx_defaults {
  PyObject *__pyx_arg_scanner;
  PyObject *__pyx_arg_handler;
};
struct __pyx_defaults1 {
  PyObject *__pyx_arg_stdout;
};
struct __pyx_defaults2 {
  PyObject *__pyx_arg_inputhandler;
  PyObject *__pyx_arg_outputhandler;
};
struct __pyx_defaults3 {
  PyObject *__pyx_arg_inputhandler;
  PyObject *__pyx_arg_outputhandler;
  PyObject *__pyx_arg_inputparser;
  PyObject *__pyx_arg_outputparser;
  PyObject *__pyx_arg_inputscanner;
  PyObject *__pyx_arg_outputscanner;
};
struct __pyx_defaults4 {
  PyObject *__pyx_arg_stdin;
  PyObject *__pyx_arg_stdout;
  PyObject *__pyx_arg_inputscanner;
  PyObject *__pyx_arg_inputparser;
  PyObject *__pyx_arg_inputhandler;
  PyObject *__pyx_arg_outputscanner;
  PyObject *__pyx_arg_outputparser;
  PyObject *__pyx_arg_outputhandler;
};

/* "ctff.pyx":1156
 *             self._resized = False
 * 
 *     def process_input(self, data):             # <<<<<<<<<<<<<<
 *         if not self._esc_timer is None:
 *             self._esc_timer.cancel()
 */
struct __pyx_obj_4ctff___pyx_scope_struct_2_process_input {
  PyObject_HEAD
  PyObject *__pyx_v_self;
};


/* "ctff.pyx":1358
 *                     process.close()
 * 
 *     def start(self,             # <<<<<<<<<<<<<<
 *               termenc,
 *               stdin=sys.stdin,
 */
struct __pyx_obj_4ctff___pyx_scope_struct_4_start {
  PyObject_HEAD
  PyObject *__pyx_v_mainprocess;
  PyObject *__pyx_v_self;
};


/* "ctff.pyx":232
 *             self.output = []
 * 
 *         def __iter__(self):             # <<<<<<<<<<<<<<
 *             for i in [1, 2, 3, 4, 5]:
 *                 yield i
 */
struct __pyx_obj_4ctff___pyx_scope_struct____iter__ {
  PyObject_HEAD
  long __pyx_v_i;
  PyObject *__pyx_v_self;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
};


/* "ctff.pyx":638
 *         self._data = self._decoder.decode(value)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         >>> scanner = DefaultScanner()
 */
struct __pyx_obj_4ctff___pyx_scope_struct_1___iter__ {
  PyObject_HEAD
  PyObject *__pyx_v_c;
  PyObject *__pyx_v_c1;
  PyObject *__pyx_v_self;
  PyObject *__pyx_v_x;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "ctff.pyx":1277
 *         self._mainprocess.process_output("")
 * 
 *     def drive(self):             # <<<<<<<<<<<<<<
 * 
 *         def onresize(no, frame):
 */
struct __pyx_obj_4ctff___pyx_scope_struct_3_drive {
  PyObject_HEAD
  PyObject *__pyx_v_self;
};

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

#if CYTHON_COMPILING_IN_CPYTHON
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);
}
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*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); /*proto*/

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

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

#if CYTHON_COMPILING_IN_CPYTHON
#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) {
    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);
}
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

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

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

static PyObject* __Pyx_PyObject_CallMethodTuple(PyObject* obj, PyObject* method_name, PyObject* args) {
    PyObject *method, *result = NULL;
    if (unlikely(!args)) return NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto bad;
    result = PyObject_Call(method, args, NULL);
    Py_DECREF(method);
bad:
    Py_DECREF(args);
    return result;
}
#define __Pyx_PyObject_CallMethod3(obj, name, arg1, arg2, arg3) \
    __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(3, arg1, arg2, arg3))
#define __Pyx_PyObject_CallMethod2(obj, name, arg1, arg2) \
    __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(2, arg1, arg2))
#define __Pyx_PyObject_CallMethod1(obj, name, arg1) \
    __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(1, arg1))
#define __Pyx_PyObject_CallMethod0(obj, name) \
    __Pyx_PyObject_CallMethodTuple(obj, name, (Py_INCREF(__pyx_empty_tuple), __pyx_empty_tuple))

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

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*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 CYTHON_INLINE 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);

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

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

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

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

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

static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);

static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);

#define __Pyx_CyFunction_USED 1
#include <structmember.h>
#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;
    int flags;
    PyObject *func_dict;
    PyObject *func_weakreflist;
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
    PyObject *func_classobj; /* No-args super() class cell */
    void *defaults;
    int defaults_pyobjects;
    PyObject *defaults_tuple;   /* Const defaults tuple */
    PyObject *defaults_kwdict;  /* Const kwonly defaults dict */
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations; /* function annotations dict */
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \
    __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *self,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
                                                         size_t size,
                                                         int pyobjects);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
                                                            PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
                                                             PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
                                                              PyObject *dict);
static int __Pyx_CyFunction_init(void);

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

#include <string.h>

static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);

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

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

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

#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
#else
#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
#endif

#if PY_MAJOR_VERSION < 3
#define __Pyx_PyString_Join __Pyx_PyBytes_Join
#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
#else
#define __Pyx_PyString_Join PyUnicode_Join
#define __Pyx_PyBaseString_Join PyUnicode_Join
#endif
#if CYTHON_COMPILING_IN_CPYTHON
    #if PY_MAJOR_VERSION < 3
    #define __Pyx_PyBytes_Join _PyString_Join
    #else
    #define __Pyx_PyBytes_Join _PyBytes_Join
    #endif
#else
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); /*proto*/
#endif

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

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

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

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

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

#define __Pyx_Generator_USED
#include <structmember.h>
#include <frameobject.h>
typedef PyObject *(*__pyx_generator_body_t)(PyObject *, PyObject *);
typedef struct {
    PyObject_HEAD
    __pyx_generator_body_t body;
    PyObject *closure;
    PyObject *exc_type;
    PyObject *exc_value;
    PyObject *exc_traceback;
    PyObject *gi_weakreflist;
    PyObject *classobj;
    PyObject *yieldfrom;
    int resume_label;
    char is_running;
} __pyx_GeneratorObject;
static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body,
                                                  PyObject *closure);
static int __pyx_Generator_init(void);
static int __Pyx_Generator_clear(PyObject* self);
#if 1 || PY_VERSION_HEX < 0x030300B0
static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue);
#else
#define __Pyx_PyGen_FetchStopIterationValue(pvalue) PyGen_FetchStopIterationValue(pvalue)
#endif

static int __Pyx_check_binary_version(void);

typedef struct {
    int code_line;
    PyCodeObject* code_object;
} __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);

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

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


/* Module declarations from 'ctff' */
static PyTypeObject *__pyx_ptype_4ctff___pyx_scope_struct_2_process_input = 0;
static PyTypeObject *__pyx_ptype_4ctff___pyx_scope_struct_4_start = 0;
static PyTypeObject *__pyx_ptype_4ctff___pyx_scope_struct____iter__ = 0;
static PyTypeObject *__pyx_ptype_4ctff___pyx_scope_struct_1___iter__ = 0;
static PyTypeObject *__pyx_ptype_4ctff___pyx_scope_struct_3_drive = 0;
#define __Pyx_MODULE_NAME "ctff"
int __pyx_module_is_main_ctff = 0;

/* Implementation of 'ctff' */
static PyObject *__pyx_builtin_Exception;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_ord;
static PyObject *__pyx_builtin_ImportError;
static PyObject *__pyx_builtin_chr;
static PyObject *__pyx_builtin_unichr;
static PyObject *__pyx_builtin_IOError;
static PyObject *__pyx_builtin_OSError;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_pf_4ctff_19NotHandledException___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4ctff_19NotHandledException_2__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_14ParseException___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4ctff_14ParseException_2__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_13EventObserver_handle_start(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_4ctff_13EventObserver_2handle_end(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_4ctff_13EventObserver_4handle_csi(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_params, CYTHON_UNUSED PyObject *__pyx_v_intermediate, CYTHON_UNUSED PyObject *__pyx_v_final); /* proto */
static PyObject *__pyx_pf_4ctff_13EventObserver_6handle_esc(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_prefix, CYTHON_UNUSED PyObject *__pyx_v_final); /* proto */
static PyObject *__pyx_pf_4ctff_13EventObserver_8handle_ss2(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_final); /* proto */
static PyObject *__pyx_pf_4ctff_13EventObserver_10handle_ss3(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_final); /* proto */
static PyObject *__pyx_pf_4ctff_13EventObserver_12handle_control_string(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_prefix, CYTHON_UNUSED PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4ctff_13EventObserver_14handle_char(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_c); /* proto */
static PyObject *__pyx_pf_4ctff_13EventObserver_16handle_invalid(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_seq); /* proto */
static PyObject *__pyx_pf_4ctff_13EventObserver_18handle_draw(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_4ctff_13EventObserver_20handle_resize(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_row, CYTHON_UNUSED PyObject *__pyx_v_col); /* proto */
static PyObject *__pyx_pf_4ctff_7Scanner___iter__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_7Scanner_2assign(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_termenc); /* proto */
static PyObject *__pyx_pf_4ctff_7Scanner_4continuous_assign(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_termenc); /* proto */
static PyObject *__pyx_pf_4ctff_12OutputStream_write(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_c); /* proto */
static PyObject *__pyx_pf_4ctff_12OutputStream_2flush(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_15EventDispatcher_dispatch_esc(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_prefix, CYTHON_UNUSED PyObject *__pyx_v_final); /* proto */
static PyObject *__pyx_pf_4ctff_15EventDispatcher_2dispatch_csi(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_prefix, CYTHON_UNUSED PyObject *__pyx_v_params, CYTHON_UNUSED PyObject *__pyx_v_final); /* proto */
static PyObject *__pyx_pf_4ctff_15EventDispatcher_4dispatch_control_string(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_prefix, CYTHON_UNUSED PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4ctff_15EventDispatcher_6dispatch_char(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_c); /* proto */
static PyObject *__pyx_pf_4ctff_6Parser_parse(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_4ctff_3PTY_fitsize(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_3PTY_2resize(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_height, CYTHON_UNUSED PyObject *__pyx_v_width); /* proto */
static PyObject *__pyx_pf_4ctff_3PTY_4read(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_3PTY_6write(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_4ctff_3PTY_8xon(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_3PTY_10xoff(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_3PTY_12drive(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_12_MockContext___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_12_MockContext_2__iter__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_12_MockContext_5dispatch_char(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_c); /* proto */
static PyObject *__pyx_pf_4ctff_12SimpleParser_parse(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_4ctff_12_MockHandler_handle_csi(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, PyObject *__pyx_v_parameter, PyObject *__pyx_v_intermediate, PyObject *__pyx_v_final); /* proto */
static PyObject *__pyx_pf_4ctff_12_MockHandler_2handle_esc(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, PyObject *__pyx_v_intermediate, PyObject *__pyx_v_final); /* proto */
static PyObject *__pyx_pf_4ctff_12_MockHandler_4handle_control_string(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, PyObject *__pyx_v_prefix, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4ctff_12_MockHandler_6handle_char(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, PyObject *__pyx_v_c); /* proto */
static PyObject *__pyx_pf_4ctff_13DefaultParser___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_13DefaultParser_2init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_4ctff_13DefaultParser_4state_is_esc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_13DefaultParser_6flush(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_13DefaultParser_8reset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_13DefaultParser_10parse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_4ctff_14DefaultScanner___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ucs4, PyObject *__pyx_v_termenc); /* proto */
static PyObject *__pyx_pf_4ctff_14DefaultScanner_2assign(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value, PyObject *__pyx_v_termenc); /* proto */
static PyObject *__pyx_pf_4ctff_14DefaultScanner_4continuous_assign(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4ctff_14DefaultScanner_6__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_14DefaultHandler___init__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_14DefaultHandler_2handle_start(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_4ctff_14DefaultHandler_4handle_end(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_4ctff_14DefaultHandler_6handle_esc(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_intermediate, CYTHON_UNUSED PyObject *__pyx_v_final); /* proto */
static PyObject *__pyx_pf_4ctff_14DefaultHandler_8handle_csi(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_parameter, CYTHON_UNUSED PyObject *__pyx_v_intermediate, CYTHON_UNUSED PyObject *__pyx_v_final); /* proto */
static PyObject *__pyx_pf_4ctff_14DefaultHandler_10handle_ss2(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_final); /* proto */
static PyObject *__pyx_pf_4ctff_14DefaultHandler_12handle_ss3(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_final); /* proto */
static PyObject *__pyx_pf_4ctff_14DefaultHandler_14handle_control_string(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_prefix, CYTHON_UNUSED PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4ctff_14DefaultHandler_16handle_char(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_c); /* proto */
static PyObject *__pyx_pf_4ctff_14DefaultHandler_18handle_invalid(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_seq); /* proto */
static PyObject *__pyx_pf_4ctff_14DefaultHandler_20handle_draw(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_4ctff_14DefaultHandler_22handle_resize(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_row, CYTHON_UNUSED PyObject *__pyx_v_col); /* proto */
static PyObject *__pyx_pf_4ctff_17FilterMultiplexer___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_4ctff_17FilterMultiplexer_2get_lhs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_17FilterMultiplexer_4get_rhs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_17FilterMultiplexer_6handle_start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_4ctff_17FilterMultiplexer_8handle_end(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_4ctff_17FilterMultiplexer_10handle_flush(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_4ctff_17FilterMultiplexer_12handle_csi(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_params, PyObject *__pyx_v_intermediate, PyObject *__pyx_v_final); /* proto */
static PyObject *__pyx_pf_4ctff_17FilterMultiplexer_14handle_esc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_intermediate, PyObject *__pyx_v_final); /* proto */
static PyObject *__pyx_pf_4ctff_17FilterMultiplexer_16handle_ss2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_final); /* proto */
static PyObject *__pyx_pf_4ctff_17FilterMultiplexer_18handle_ss3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_final); /* proto */
static PyObject *__pyx_pf_4ctff_17FilterMultiplexer_20handle_control_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_prefix, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4ctff_17FilterMultiplexer_22handle_char(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_c); /* proto */
static PyObject *__pyx_pf_4ctff_17FilterMultiplexer_24handle_invalid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_seq); /* proto */
static PyObject *__pyx_pf_4ctff_17FilterMultiplexer_26handle_draw(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_4ctff_17FilterMultiplexer_28handle_resize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_row, PyObject *__pyx_v_col); /* proto */
static PyObject *__pyx_pf_4ctff_12ParseContext_34__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_4ctff_12ParseContext___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_output, PyObject *__pyx_v_termenc, PyObject *__pyx_v_scanner, PyObject *__pyx_v_handler, PyObject *__pyx_v_buffering); /* proto */
static PyObject *__pyx_pf_4ctff_12ParseContext_2__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_12ParseContext_4assign(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_4ctff_12ParseContext_6sethandler(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_handler); /* proto */
static PyObject *__pyx_pf_4ctff_12ParseContext_8putu(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_4ctff_12ParseContext_10puts(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_4ctff_12ParseContext_12put(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_c); /* proto */
static PyObject *__pyx_pf_4ctff_12ParseContext_14writestring(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_4ctff_12ParseContext_16write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_c); /* proto */
static PyObject *__pyx_pf_4ctff_12ParseContext_18flush(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_12ParseContext_20dispatch_esc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_intermediate, PyObject *__pyx_v_final); /* proto */
static PyObject *__pyx_pf_4ctff_12ParseContext_22dispatch_csi(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_parameter, PyObject *__pyx_v_intermediate, PyObject *__pyx_v_final); /* proto */
static PyObject *__pyx_pf_4ctff_12ParseContext_24dispatch_ss2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_final); /* proto */
static PyObject *__pyx_pf_4ctff_12ParseContext_26dispatch_ss3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_final); /* proto */
static PyObject *__pyx_pf_4ctff_12ParseContext_28dispatch_control_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_prefix, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4ctff_12ParseContext_30dispatch_char(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_c); /* proto */
static PyObject *__pyx_pf_4ctff_12ParseContext_32dispatch_invalid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_seq); /* proto */
static PyObject *__pyx_pf_4ctff_10DefaultPTY___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_term, PyObject *__pyx_v_lang, PyObject *__pyx_v_command, PyObject *__pyx_v_stdin, PyObject *__pyx_v_row, PyObject *__pyx_v_col); /* proto */
static PyObject *__pyx_pf_4ctff_10DefaultPTY_2close(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_10DefaultPTY_4restore_term(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_10DefaultPTY_6__setupterm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_fd); /* proto */
static PyObject *__pyx_pf_4ctff_10DefaultPTY_8__resize_impl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_winsize); /* proto */
static PyObject *__pyx_pf_4ctff_10DefaultPTY_10fitsize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_10DefaultPTY_12resize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_height, PyObject *__pyx_v_width); /* proto */
static PyObject *__pyx_pf_4ctff_10DefaultPTY_14fileno(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_10DefaultPTY_16stdin_fileno(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_10DefaultPTY_18read(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_10DefaultPTY_20write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_4ctff_10DefaultPTY_22flush(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_10DefaultPTY_24xoff(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_10DefaultPTY_26xon(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_16MockParseContext___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_7Process___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_tty); /* proto */
static PyObject *__pyx_pf_4ctff_7Process_40__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_4ctff_7Process_2start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_termenc, PyObject *__pyx_v_inputhandler, PyObject *__pyx_v_outputhandler, PyObject *__pyx_v_inputparser, PyObject *__pyx_v_outputparser, PyObject *__pyx_v_inputscanner, PyObject *__pyx_v_outputscanner, PyObject *__pyx_v_buffering, PyObject *__pyx_v_stdout); /* proto */
static PyObject *__pyx_pf_4ctff_7Process_4getpid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_7Process_6is_alive(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_7Process_8fileno(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_7Process_10stdin_fileno(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_7Process_12read(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_7Process_14write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_4ctff_7Process_16close(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_7Process_18end(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_7Process_20resize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_row, PyObject *__pyx_v_col); /* proto */
static PyObject *__pyx_pf_4ctff_7Process_22fitsize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_7Process_24on_write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_4ctff_7Process_26process_start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_7Process_28process_end(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_7Process_30process_resize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_row, PyObject *__pyx_v_col); /* proto */
static PyObject *__pyx_pf_4ctff_7Process_13process_input_dispatch_esc(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_4ctff_7Process_32process_input(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_4ctff_7Process_34process_output(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_4ctff_7Process_36on_read(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_4ctff_7Process_38drain(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_7Session___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_tty); /* proto */
static PyObject *__pyx_pf_4ctff_7Session_22__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_4ctff_7Session_2add_subtty(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_term, PyObject *__pyx_v_lang, PyObject *__pyx_v_command, PyObject *__pyx_v_row, PyObject *__pyx_v_col, PyObject *__pyx_v_termenc, PyObject *__pyx_v_inputhandler, PyObject *__pyx_v_outputhandler); /* proto */
static PyObject *__pyx_pf_4ctff_7Session_24__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_4ctff_7Session_4create_process(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_term, PyObject *__pyx_v_lang, PyObject *__pyx_v_command, PyObject *__pyx_v_row, PyObject *__pyx_v_col, PyObject *__pyx_v_termenc, PyObject *__pyx_v_inputhandler, PyObject *__pyx_v_outputhandler, PyObject *__pyx_v_inputparser, PyObject *__pyx_v_outputparser, PyObject *__pyx_v_inputscanner, PyObject *__pyx_v_outputscanner, PyObject *__pyx_v_buffering); /* proto */
static PyObject *__pyx_pf_4ctff_7Session_6getactiveprocess(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_7Session_8process_is_active(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_process); /* proto */
static PyObject *__pyx_pf_4ctff_7Session_10focus_process(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_process); /* proto */
static PyObject *__pyx_pf_4ctff_7Session_12blur_process(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_7Session_14destruct_process(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_process); /* proto */
static PyObject *__pyx_pf_4ctff_7Session_5drive_onresize(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_no, CYTHON_UNUSED PyObject *__pyx_v_frame); /* proto */
static PyObject *__pyx_pf_4ctff_7Session_16drive(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4ctff_7Session_26__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_4ctff_7Session_5start_onclose(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_no, CYTHON_UNUSED PyObject *__pyx_v_frame); /* proto */
static PyObject *__pyx_pf_4ctff_7Session_18start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_termenc, CYTHON_UNUSED PyObject *__pyx_v_stdin, CYTHON_UNUSED PyObject *__pyx_v_stdout, PyObject *__pyx_v_inputscanner, PyObject *__pyx_v_inputparser, PyObject *__pyx_v_inputhandler, PyObject *__pyx_v_outputscanner, PyObject *__pyx_v_outputparser, PyObject *__pyx_v_outputhandler, PyObject *__pyx_v_buffering); /* proto */
static PyObject *__pyx_pf_4ctff_7Session_20_init_process(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_process, PyObject *__pyx_v_termenc, PyObject *__pyx_v_inputhandler, PyObject *__pyx_v_outputhandler, PyObject *__pyx_v_inputparser, PyObject *__pyx_v_outputparser, PyObject *__pyx_v_inputscanner, PyObject *__pyx_v_outputscanner, PyObject *__pyx_v_buffering); /* proto */
static PyObject *__pyx_pf_4ctff__test(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_tp_new_4ctff___pyx_scope_struct_2_process_input(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ctff___pyx_scope_struct_4_start(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ctff___pyx_scope_struct____iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ctff___pyx_scope_struct_1___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4ctff___pyx_scope_struct_3_drive(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static char __pyx_k_c[] = "c";
static char __pyx_k_e[] = "e";
static char __pyx_k_i[] = "i";
static char __pyx_k_x[] = "x";
static char __pyx_k_c1[] = "_c1";
static char __pyx_k_c2[] = "c2";
static char __pyx_k_fd[] = "fd";
static char __pyx_k_hh[] = "hh";
static char __pyx_k_io[] = "io";
static char __pyx_k_no[] = "no";
static char __pyx_k_os[] = "os";
static char __pyx_k_CS8[] = "CS8";
static char __pyx_k_EIO[] = "EIO";
static char __pyx_k_MIT[] = "MIT";
static char __pyx_k_PTY[] = "PTY";
static char __pyx_k__43[] = "";
static char __pyx_k_c_2[] = "-c";
static char __pyx_k_chr[] = "chr";
static char __pyx_k_col[] = "col";
static char __pyx_k_doc[] = "__doc__";
static char __pyx_k_end[] = "end";
static char __pyx_k_lhs[] = "lhs";
static char __pyx_k_md5[] = "md5";
static char __pyx_k_msg[] = "msg";
static char __pyx_k_ord[] = "ord";
static char __pyx_k_pid[] = "pid";
static char __pyx_k_pty[] = "pty";
static char __pyx_k_put[] = "put";
static char __pyx_k_rfd[] = "rfd";
static char __pyx_k_rhs[] = "rhs";
static char __pyx_k_row[] = "row";
static char __pyx_k_seq[] = "seq";
static char __pyx_k_str[] = "__str__";
static char __pyx_k_sys[] = "sys";
static char __pyx_k_tty[] = "tty";
static char __pyx_k_wfd[] = "wfd";
static char __pyx_k_xfd[] = "xfd";
static char __pyx_k_xon[] = "xon";
static char __pyx_k_ECHO[] = "ECHO";
static char __pyx_k_HHHH[] = "HHHH";
static char __pyx_k_ISIG[] = "ISIG";
static char __pyx_k_IXON[] = "IXON";
static char __pyx_k_LANG[] = "LANG";
static char __pyx_k_TERM[] = "TERM";
static char __pyx_k_VEOF[] = "VEOF";
static char __pyx_k__336[] = "_";
static char __pyx_k__337[] = "__";
static char __pyx_k_args[] = "args";
static char __pyx_k_c1_2[] = "c1";
static char __pyx_k_c_cc[] = "c_cc";
static char __pyx_k_ctff[] = "ctff";
static char __pyx_k_data[] = "data";
static char __pyx_k_file[] = "file";
static char __pyx_k_fork[] = "fork";
static char __pyx_k_hhhh[] = "hhhh";
static char __pyx_k_info[] = "info";
static char __pyx_k_init[] = "__init__";
static char __pyx_k_iter[] = "__iter__";
static char __pyx_k_join[] = "join";
static char __pyx_k_kill[] = "kill";
static char __pyx_k_lang[] = "lang";
static char __pyx_k_main[] = "__main__";
static char __pyx_k_name[] = "__name__";
static char __pyx_k_pack[] = "pack";
static char __pyx_k_puts[] = "puts";
static char __pyx_k_putu[] = "putu";
static char __pyx_k_read[] = "read";
static char __pyx_k_rfds[] = "_rfds";
static char __pyx_k_self[] = "self";
static char __pyx_k_send[] = "send";
static char __pyx_k_sort[] = "sort";
static char __pyx_k_term[] = "term";
static char __pyx_k_test[] = "_test";
static char __pyx_k_ucs4[] = "ucs4";
static char __pyx_k_wait[] = "wait";
static char __pyx_k_xfds[] = "_xfds";
static char __pyx_k_xoff[] = "xoff";
static char __pyx_k_CSIZE[] = "CSIZE";
static char __pyx_k_EBADF[] = "EBADF";
static char __pyx_k_EINTR[] = "EINTR";
static char __pyx_k_ICRNL[] = "ICRNL";
static char __pyx_k_IGNCR[] = "IGNCR";
static char __pyx_k_INLCR[] = "INLCR";
static char __pyx_k_ONLCR[] = "ONLCR";
static char __pyx_k_OPOST[] = "OPOST";
static char __pyx_k_TCOON[] = "TCOON";
static char __pyx_k_Timer[] = "Timer";
static char __pyx_k_UTF_8[] = "UTF-8";
static char __pyx_k_VINTR[] = "VINTR";
static char __pyx_k_VKILL[] = "VKILL";
static char __pyx_k_VQUIT[] = "VQUIT";
static char __pyx_k_VSTOP[] = "VSTOP";
static char __pyx_k_VSUSP[] = "VSUSP";
static char __pyx_k_alive[] = "_alive";
static char __pyx_k_close[] = "close";
static char __pyx_k_drain[] = "drain";
static char __pyx_k_drive[] = "drive";
static char __pyx_k_errno[] = "errno";
static char __pyx_k_error[] = "error";
static char __pyx_k_fcntl[] = "fcntl";
static char __pyx_k_final[] = "final";
static char __pyx_k_flush[] = "flush";
static char __pyx_k_frame[] = "frame";
static char __pyx_k_ioctl[] = "ioctl";
static char __pyx_k_parse[] = "parse";
static char __pyx_k_print[] = "print";
static char __pyx_k_reset[] = "reset";
static char __pyx_k_s_s_s[] = "%s.%s.%s";
static char __pyx_k_specs[] = "specs";
static char __pyx_k_start[] = "start";
static char __pyx_k_state[] = "state";
static char __pyx_k_stdin[] = "stdin";
static char __pyx_k_throw[] = "throw";
static char __pyx_k_tty_2[] = "_tty";
static char __pyx_k_value[] = "value";
static char __pyx_k_width[] = "width";
static char __pyx_k_write[] = "write";
static char __pyx_k_0_2_10[] = "0.2.10";
static char __pyx_k_BRKINT[] = "BRKINT";
static char __pyx_k_ECHONL[] = "ECHONL";
static char __pyx_k_ICANON[] = "ICANON";
static char __pyx_k_IEXTEN[] = "IEXTEN";
static char __pyx_k_IGNBRK[] = "IGNBRK";
static char __pyx_k_ISTRIP[] = "ISTRIP";
static char __pyx_k_PARENB[] = "PARENB";
static char __pyx_k_PARMRK[] = "PARMRK";
static char __pyx_k_Parser[] = "Parser";
static char __pyx_k_TCOOFF[] = "TCOOFF";
static char __pyx_k_VDSUSP[] = "VDSUSP";
static char __pyx_k_VLNEXT[] = "VLNEXT";
static char __pyx_k_VSTART[] = "VSTART";
static char __pyx_k_append[] = "append";
static char __pyx_k_assign[] = "assign";
static char __pyx_k_author[] = "__author__";
static char __pyx_k_backup[] = "backup";
static char __pyx_k_bin_sh[] = "/bin/sh";
static char __pyx_k_cancel[] = "cancel";
static char __pyx_k_codecs[] = "codecs";
static char __pyx_k_data_2[] = "_data";
static char __pyx_k_decode[] = "decode";
static char __pyx_k_errors[] = "errors";
static char __pyx_k_exec_s[] = "exec %s";
static char __pyx_k_execlp[] = "execlp";
static char __pyx_k_fileno[] = "fileno";
static char __pyx_k_getpid[] = "getpid";
static char __pyx_k_height[] = "height";
static char __pyx_k_ibytes[] = "ibytes";
static char __pyx_k_import[] = "__import__";
static char __pyx_k_init_2[] = "init";
static char __pyx_k_master[] = "_master";
static char __pyx_k_member[] = "member";
static char __pyx_k_module[] = "__module__";
static char __pyx_k_name_2[] = "name";
static char __pyx_k_output[] = "output";
static char __pyx_k_params[] = "params";
static char __pyx_k_pbytes[] = "pbytes";
static char __pyx_k_prefix[] = "prefix";
static char __pyx_k_remove[] = "remove";
static char __pyx_k_resize[] = "resize";
static char __pyx_k_select[] = "select";
static char __pyx_k_signal[] = "signal";
static char __pyx_k_status[] = "status";
static char __pyx_k_stdout[] = "stdout";
static char __pyx_k_struct[] = "struct";
static char __pyx_k_tcflow[] = "tcflow";
static char __pyx_k_test_2[] = "__test__";
static char __pyx_k_ucs4_2[] = "_ucs4";
static char __pyx_k_unichr[] = "unichr";
static char __pyx_k_unpack[] = "unpack";
static char __pyx_k_update[] = "update";
static char __pyx_k_IOError[] = "IOError";
static char __pyx_k_OSError[] = "OSError";
static char __pyx_k_PTY_xon[] = "PTY::xon";
static char __pyx_k_Process[] = "Process";
static char __pyx_k_SIGCHLD[] = "SIGCHLD";
static char __pyx_k_Scanner[] = "Scanner";
static char __pyx_k_Session[] = "Session";
static char __pyx_k_TCSANOW[] = "TCSANOW";
static char __pyx_k_VWERASE[] = "VWERASE";
static char __pyx_k_argspec[] = "argspec";
static char __pyx_k_c_cflag[] = "c_cflag";
static char __pyx_k_c_lflag[] = "c_lflag";
static char __pyx_k_command[] = "command";
static char __pyx_k_context[] = "context";
static char __pyx_k_decoder[] = "_decoder";
static char __pyx_k_doctest[] = "doctest";
static char __pyx_k_environ[] = "environ";
static char __pyx_k_fitsize[] = "fitsize";
static char __pyx_k_get_lhs[] = "get_lhs";
static char __pyx_k_get_rhs[] = "get_rhs";
static char __pyx_k_handler[] = "handler";
static char __pyx_k_hashlib[] = "hashlib";
static char __pyx_k_inspect[] = "inspect";
static char __pyx_k_isclass[] = "isclass";
static char __pyx_k_license[] = "__license__";
static char __pyx_k_logging[] = "logging";
static char __pyx_k_modules[] = "modules";
static char __pyx_k_on_read[] = "on_read";
static char __pyx_k_onclose[] = "onclose";
static char __pyx_k_prepare[] = "__prepare__";
static char __pyx_k_process[] = "process";
static char __pyx_k_replace[] = "replace";
static char __pyx_k_resized[] = "_resized";
static char __pyx_k_scanner[] = "scanner";
static char __pyx_k_specstr[] = "specstr";
static char __pyx_k_termenc[] = "termenc";
static char __pyx_k_termios[] = "termios";
static char __pyx_k_testmod[] = "testmod";
static char __pyx_k_varargs[] = "varargs";
static char __pyx_k_version[] = "__version__";
static char __pyx_k_winsize[] = "winsize";
static char __pyx_k_PTY_read[] = "PTY::read";
static char __pyx_k_PTY_xoff[] = "PTY::xoff";
static char __pyx_k_SIGWINCH[] = "SIGWINCH";
static char __pyx_k_StringIO[] = "StringIO";
static char __pyx_k_VREPRINT[] = "VREPRINT";
static char __pyx_k_is_alive[] = "is_alive";
static char __pyx_k_ismethod[] = "ismethod";
static char __pyx_k_keywords[] = "keywords";
static char __pyx_k_master_2[] = "master";
static char __pyx_k_on_write[] = "on_write";
static char __pyx_k_onresize[] = "onresize";
static char __pyx_k_output_2[] = "_output";
static char __pyx_k_qualname[] = "__qualname__";
static char __pyx_k_template[] = "template";
static char __pyx_k_truncate[] = "truncate";
static char __pyx_k_vdisable[] = "vdisable";
static char __pyx_k_Exception[] = "Exception";
static char __pyx_k_PTY_drive[] = "PTY::drive";
static char __pyx_k_PTY_write[] = "PTY::write";
static char __pyx_k_PTY_xon_2[] = "PTY.xon";
static char __pyx_k_STATE_ESC[] = "_STATE_ESC";
static char __pyx_k_STATE_OSC[] = "_STATE_OSC";
static char __pyx_k_STATE_SS2[] = "_STATE_SS2";
static char __pyx_k_STATE_SS3[] = "_STATE_SS3";
static char __pyx_k_STATE_STR[] = "_STATE_STR";
static char __pyx_k_buffering[] = "buffering";
static char __pyx_k_cStringIO[] = "cStringIO";
static char __pyx_k_classname[] = "classname";
static char __pyx_k_esc_timer[] = "_esc_timer";
static char __pyx_k_exception[] = "exception";
static char __pyx_k_fpathconf[] = "fpathconf";
static char __pyx_k_getwriter[] = "getwriter";
static char __pyx_k_hexdigest[] = "hexdigest";
static char __pyx_k_metaclass[] = "__metaclass__";
static char __pyx_k_parameter[] = "parameter";
static char __pyx_k_setupterm[] = "__setupterm";
static char __pyx_k_signature[] = "signature";
static char __pyx_k_target_fd[] = "target_fd";
static char __pyx_k_tcgetattr[] = "tcgetattr";
static char __pyx_k_tcsetattr[] = "tcsetattr";
static char __pyx_k_termenc_2[] = "_termenc";
static char __pyx_k_threading[] = "threading";
static char __pyx_k_DefaultPTY[] = "DefaultPTY";
static char __pyx_k_PTY_read_2[] = "PTY.read";
static char __pyx_k_PTY_resize[] = "PTY::resize";
static char __pyx_k_PTY_xoff_2[] = "PTY.xoff";
static char __pyx_k_TIOCGWINSZ[] = "TIOCGWINSZ";
static char __pyx_k_TIOCSWINSZ[] = "TIOCSWINSZ";
static char __pyx_k_ValueError[] = "ValueError";
static char __pyx_k_add_subtty[] = "add_subtty";
static char __pyx_k_getargspec[] = "getargspec";
static char __pyx_k_getmembers[] = "getmembers";
static char __pyx_k_handle_csi[] = "handle_csi";
static char __pyx_k_handle_end[] = "handle_end";
static char __pyx_k_handle_esc[] = "handle_esc";
static char __pyx_k_handle_ss2[] = "handle_ss2";
static char __pyx_k_handle_ss3[] = "handle_ss3";
static char __pyx_k_sethandler[] = "sethandler";
static char __pyx_k_startswith[] = "startswith";
static char __pyx_k_thismodule[] = "thismodule";
static char __pyx_k_BUFFER_SIZE[] = "_BUFFER_SIZE";
static char __pyx_k_ESC_TIMEOUT[] = "_ESC_TIMEOUT";
static char __pyx_k_ImportError[] = "ImportError";
static char __pyx_k_MockContext[] = "_MockContext";
static char __pyx_k_MockHandler[] = "_MockHandler";
static char __pyx_k_PC_VDISABLE[] = "PC_VDISABLE";
static char __pyx_k_PTY_drive_2[] = "PTY.drive";
static char __pyx_k_PTY_fitsize[] = "PTY::fitsize";
static char __pyx_k_PTY_write_2[] = "PTY.write";
static char __pyx_k_Process_end[] = "Process.end";
static char __pyx_k_buffering_2[] = "_buffering";
static char __pyx_k_handle_char[] = "handle_char";
static char __pyx_k_handle_draw[] = "handle_draw";
static char __pyx_k_handled_lhs[] = "handled_lhs";
static char __pyx_k_handled_rhs[] = "handled_rhs";
static char __pyx_k_inputparser[] = "inputparser";
static char __pyx_k_mainprocess[] = "_mainprocess";
static char __pyx_k_process_end[] = "process_end";
static char __pyx_k_process_map[] = "_process_map";
static char __pyx_k_resize_impl[] = "__resize_impl";
static char __pyx_k_writestring[] = "writestring";
static char __pyx_k_OutputStream[] = "OutputStream";
static char __pyx_k_PTY_resize_2[] = "PTY.resize";
static char __pyx_k_ParseContext[] = "ParseContext";
static char __pyx_k_Parser_parse[] = "Parser::parse";
static char __pyx_k_Process_read[] = "Process.read";
static char __pyx_k_STATE_GROUND[] = "_STATE_GROUND";
static char __pyx_k_SimpleParser[] = "SimpleParser";
static char __pyx_k_blur_process[] = "blur_process";
static char __pyx_k_defaultvalue[] = "defaultvalue";
static char __pyx_k_dispatch_csi[] = "dispatch_csi";
static char __pyx_k_dispatch_esc[] = "dispatch_esc";
static char __pyx_k_dispatch_ss2[] = "dispatch_ss2";
static char __pyx_k_dispatch_ss3[] = "dispatch_ss3";
static char __pyx_k_handle_flush[] = "handle_flush";
static char __pyx_k_handle_start[] = "handle_start";
static char __pyx_k_init_process[] = "_init_process";
static char __pyx_k_input_target[] = "_input_target";
static char __pyx_k_inputcontext[] = "_inputcontext";
static char __pyx_k_inputhandler[] = "inputhandler";
static char __pyx_k_inputscanner[] = "inputscanner";
static char __pyx_k_intermediate[] = "intermediate";
static char __pyx_k_outputparser[] = "outputparser";
static char __pyx_k_restore_term[] = "restore_term";
static char __pyx_k_state_is_esc[] = "state_is_esc";
static char __pyx_k_stdin_fileno[] = "_stdin_fileno";
static char __pyx_k_tmp_ctff_pyx[] = "/tmp/ctff.pyx";
static char __pyx_k_DefaultParser[] = "DefaultParser";
static char __pyx_k_EventObserver[] = "EventObserver";
static char __pyx_k_PTY_fitsize_2[] = "PTY.fitsize";
static char __pyx_k_Process_close[] = "Process.close";
static char __pyx_k_Process_drain[] = "Process.drain";
static char __pyx_k_Process_start[] = "Process.start";
static char __pyx_k_Process_write[] = "Process.write";
static char __pyx_k_STATE_OSC_ESC[] = "_STATE_OSC_ESC";
static char __pyx_k_STATE_STR_ESC[] = "_STATE_STR_ESC";
static char __pyx_k_Session_drive[] = "Session.drive";
static char __pyx_k_Session_start[] = "Session.start";
static char __pyx_k_dispatch_char[] = "dispatch_char";
static char __pyx_k_focus_process[] = "focus_process";
static char __pyx_k_handle_resize[] = "handle_resize";
static char __pyx_k_inputparser_2[] = "_inputparser";
static char __pyx_k_mainprocess_2[] = "mainprocess";
static char __pyx_k_outputcontext[] = "_outputcontext";
static char __pyx_k_outputhandler[] = "outputhandler";
static char __pyx_k_outputscanner[] = "outputscanner";
static char __pyx_k_process_input[] = "process_input";
static char __pyx_k_process_map_2[] = "process_map";
static char __pyx_k_process_start[] = "process_start";
static char __pyx_k_target_output[] = "_target_output";
static char __pyx_k_DefaultHandler[] = "DefaultHandler";
static char __pyx_k_DefaultPTY_xon[] = "DefaultPTY.xon";
static char __pyx_k_DefaultScanner[] = "DefaultScanner";
static char __pyx_k_ParseException[] = "ParseException";
static char __pyx_k_Parser_parse_2[] = "Parser.parse";
static char __pyx_k_Process___init[] = "Process.__init__";
static char __pyx_k_Process_fileno[] = "Process.fileno";
static char __pyx_k_Process_getpid[] = "Process.getpid";
static char __pyx_k_Process_resize[] = "Process.resize";
static char __pyx_k_Scanner___iter[] = "Scanner::__iter__";
static char __pyx_k_Scanner_assign[] = "Scanner::assign";
static char __pyx_k_Session___init[] = "Session.__init__";
static char __pyx_k_backup_termios[] = "_backup_termios";
static char __pyx_k_create_process[] = "create_process";
static char __pyx_k_handle_invalid[] = "handle_invalid";
static char __pyx_k_inputcontext_2[] = "inputcontext";
static char __pyx_k_inputhandler_2[] = "_inputhandler";
static char __pyx_k_outputparser_2[] = "_outputparser";
static char __pyx_k_process_output[] = "process_output";
static char __pyx_k_process_resize[] = "process_resize";
static char __pyx_k_stdin_fileno_2[] = "stdin_fileno";
static char __pyx_k_DefaultPTY_read[] = "DefaultPTY.read";
static char __pyx_k_DefaultPTY_xoff[] = "DefaultPTY.xoff";
static char __pyx_k_EventDispatcher[] = "EventDispatcher";
static char __pyx_k_Process_fitsize[] = "Process.fitsize";
static char __pyx_k_Process_on_read[] = "Process.on_read";
static char __pyx_k_abstruct_Parser[] = " abstruct Parser ";
static char __pyx_k_outputcontext_2[] = "outputcontext";
static char __pyx_k_outputhandler_2[] = "_outputhandler";
static char __pyx_k_DefaultPTY_close[] = "DefaultPTY.close";
static char __pyx_k_DefaultPTY_flush[] = "DefaultPTY.flush";
static char __pyx_k_DefaultPTY_write[] = "DefaultPTY.write";
static char __pyx_k_MockParseContext[] = "MockParseContext";
static char __pyx_k_ParseContext_put[] = "ParseContext.put";
static char __pyx_k_Process_is_alive[] = "Process.is_alive";
static char __pyx_k_Process_on_write[] = "Process.on_write";
static char __pyx_k_Scanner___iter_2[] = "Scanner.__iter__";
static char __pyx_k_Scanner_assign_2[] = "Scanner.assign";
static char __pyx_k_destruct_process[] = "destruct_process";
static char __pyx_k_dispatch_invalid[] = "dispatch_invalid";
static char __pyx_k_getactiveprocess[] = "getactiveprocess";
static char __pyx_k_DefaultPTY___init[] = "DefaultPTY.__init__";
static char __pyx_k_DefaultPTY_fileno[] = "DefaultPTY.fileno";
static char __pyx_k_DefaultPTY_resize[] = "DefaultPTY.resize";
static char __pyx_k_FilterMultiplexer[] = "FilterMultiplexer";
static char __pyx_k_ParseContext_puts[] = "ParseContext.puts";
static char __pyx_k_ParseContext_putu[] = "ParseContext.putu";
static char __pyx_k_continuous_assign[] = "continuous_assign";
static char __pyx_k_process_is_active[] = "process_is_active";
static char __pyx_k_DefaultPTY_fitsize[] = "DefaultPTY.fitsize";
static char __pyx_k_DefaultParser_init[] = "DefaultParser.init";
static char __pyx_k_OutputStream_flush[] = "OutputStream::flush";
static char __pyx_k_OutputStream_write[] = "OutputStream::write";
static char __pyx_k_ParseContext_flush[] = "ParseContext.flush";
static char __pyx_k_ParseContext_write[] = "ParseContext.write";
static char __pyx_k_Session_add_subtty[] = "Session.add_subtty";
static char __pyx_k_SimpleParser_parse[] = "SimpleParser.parse";
static char __pyx_k_DefaultParser_flush[] = "DefaultParser.flush";
static char __pyx_k_DefaultParser_parse[] = "DefaultParser.parse";
static char __pyx_k_DefaultParser_reset[] = "DefaultParser.reset";
static char __pyx_k_NotHandledException[] = "NotHandledException";
static char __pyx_k_NotImplementedError[] = "NotImplementedError";
static char __pyx_k_ParseContext___init[] = "ParseContext.__init__";
static char __pyx_k_ParseContext___iter[] = "ParseContext.__iter__";
static char __pyx_k_ParseContext_assign[] = "ParseContext.assign";
static char __pyx_k_Process_process_end[] = "Process.process_end";
static char __pyx_k_STATE_CSI_PARAMETER[] = "_STATE_CSI_PARAMETER";
static char __pyx_k_abstruct_PTY_device[] = " abstruct PTY device ";
static char __pyx_k_DefaultParser___init[] = "DefaultParser.__init__";
static char __pyx_k_DefaultParser__state[] = "_DefaultParser__state";
static char __pyx_k_OutputStream_flush_2[] = "OutputStream.flush";
static char __pyx_k_OutputStream_write_2[] = "OutputStream.write";
static char __pyx_k_ParseException___str[] = "ParseException.__str__";
static char __pyx_k_Process_stdin_fileno[] = "Process.stdin_fileno";
static char __pyx_k_Session_blur_process[] = "Session.blur_process";
static char __pyx_k_DefaultHandler___init[] = "DefaultHandler.__init__";
static char __pyx_k_DefaultPTY__setupterm[] = "_DefaultPTY__setupterm";
static char __pyx_k_DefaultParser__ibytes[] = "_DefaultParser__ibytes";
static char __pyx_k_DefaultParser__pbytes[] = "_DefaultParser__pbytes";
static char __pyx_k_DefaultScanner___init[] = "DefaultScanner.__init__";
static char __pyx_k_DefaultScanner___iter[] = "DefaultScanner.__iter__";
static char __pyx_k_DefaultScanner_assign[] = "DefaultScanner.assign";
static char __pyx_k_ParseContext__handler[] = "_ParseContext__handler";
static char __pyx_k_ParseContext__scanner[] = "_ParseContext__scanner";
static char __pyx_k_ParseContext__termenc[] = "_ParseContext__termenc";
static char __pyx_k_ParseException___init[] = "ParseException.__init__";
static char __pyx_k_Process_process_input[] = "Process.process_input";
static char __pyx_k_Process_process_start[] = "Process.process_start";
static char __pyx_k_Session__init_process[] = "Session._init_process";
static char __pyx_k_Session_focus_process[] = "Session.focus_process";
static char __pyx_k_getincrementaldecoder[] = "getincrementaldecoder";
static char __pyx_k_handle_control_string[] = "handle_control_string";
static char __pyx_k_DefaultPTY___setupterm[] = "DefaultPTY.__setupterm";
static char __pyx_k_DefaultParser__context[] = "_DefaultParser__context";
static char __pyx_k_FilterMultiplexer__lhs[] = "_FilterMultiplexer__lhs";
static char __pyx_k_FilterMultiplexer__rhs[] = "_FilterMultiplexer__rhs";
static char __pyx_k_MockHandler_handle_csi[] = "_MockHandler.handle_csi";
static char __pyx_k_MockHandler_handle_esc[] = "_MockHandler.handle_esc";
static char __pyx_k_Process_process_output[] = "Process.process_output";
static char __pyx_k_Process_process_resize[] = "Process.process_resize";
static char __pyx_k_STATE_CSI_INTERMEDIATE[] = "_STATE_CSI_INTERMEDIATE";
static char __pyx_k_STATE_ESC_INTERMEDIATE[] = "_STATE_ESC_INTERMEDIATE";
static char __pyx_k_Session_create_process[] = "Session.create_process";
static char __pyx_k_forward_input_iterator[] = " forward input iterator ";
static char __pyx_k_DefaultPTY__resize_impl[] = "_DefaultPTY__resize_impl";
static char __pyx_k_DefaultPTY_restore_term[] = "DefaultPTY.restore_term";
static char __pyx_k_DefaultPTY_stdin_fileno[] = "DefaultPTY.stdin_fileno";
static char __pyx_k_MockHandler_handle_char[] = "_MockHandler.handle_char";
static char __pyx_k_MockParseContext___init[] = "MockParseContext.__init__";
static char __pyx_k_ParseContext_sethandler[] = "ParseContext.sethandler";
static char __pyx_k_dispatch_control_string[] = "dispatch_control_string";
static char __pyx_k_DefaultPTY___resize_impl[] = "DefaultPTY.__resize_impl";
static char __pyx_k_EventObserver_handle_csi[] = "EventObserver::handle_csi";
static char __pyx_k_EventObserver_handle_end[] = "EventObserver::handle_end";
static char __pyx_k_EventObserver_handle_esc[] = "EventObserver::handle_esc";
static char __pyx_k_EventObserver_handle_ss2[] = "EventObserver::handle_ss2";
static char __pyx_k_EventObserver_handle_ss3[] = "EventObserver::handle_ss3";
static char __pyx_k_FilterMultiplexer___init[] = "FilterMultiplexer.__init__";
static char __pyx_k_ParseContext_writestring[] = "ParseContext.writestring";
static char __pyx_k_Session_destruct_process[] = "Session.destruct_process";
static char __pyx_k_Session_getactiveprocess[] = "Session.getactiveprocess";
static char __pyx_k_Switching_focus_fileno_d[] = "Switching focus: fileno=%d";
static char __pyx_k_DefaultHandler_handle_csi[] = "DefaultHandler.handle_csi";
static char __pyx_k_DefaultHandler_handle_end[] = "DefaultHandler.handle_end";
static char __pyx_k_DefaultHandler_handle_esc[] = "DefaultHandler.handle_esc";
static char __pyx_k_DefaultHandler_handle_ss2[] = "DefaultHandler.handle_ss2";
static char __pyx_k_DefaultHandler_handle_ss3[] = "DefaultHandler.handle_ss3";
static char __pyx_k_DefaultPTY_close_master_d[] = "DefaultPTY.close: master=%d";
static char __pyx_k_EventObserver_handle_char[] = "EventObserver::handle_char";
static char __pyx_k_EventObserver_handle_draw[] = "EventObserver::handle_draw";
static char __pyx_k_FilterMultiplexer_get_lhs[] = "FilterMultiplexer.get_lhs";
static char __pyx_k_FilterMultiplexer_get_rhs[] = "FilterMultiplexer.get_rhs";
static char __pyx_k_Hayaki_Saito_user_zuse_jp[] = "Hayaki Saito (user@zuse.jp)";
static char __pyx_k_NotHandledException___str[] = "NotHandledException.__str__";
static char __pyx_k_ParseContext_dispatch_csi[] = "ParseContext.dispatch_csi";
static char __pyx_k_ParseContext_dispatch_esc[] = "ParseContext.dispatch_esc";
static char __pyx_k_ParseContext_dispatch_ss2[] = "ParseContext.dispatch_ss2";
static char __pyx_k_ParseContext_dispatch_ss3[] = "ParseContext.dispatch_ss3";
static char __pyx_k_Scanner_continuous_assign[] = "Scanner::continuous_assign";
static char __pyx_k_Session_process_is_active[] = "Session.process_is_active";
static char __pyx_k_SimpleParser__MockContext[] = "SimpleParser._MockContext";
static char __pyx_k_DefaultHandler_handle_char[] = "DefaultHandler.handle_char";
static char __pyx_k_DefaultHandler_handle_draw[] = "DefaultHandler.handle_draw";
static char __pyx_k_DefaultParser_state_is_esc[] = "DefaultParser.state_is_esc";
static char __pyx_k_EventObserver_handle_csi_2[] = "EventObserver.handle_csi";
static char __pyx_k_EventObserver_handle_end_2[] = "EventObserver.handle_end";
static char __pyx_k_EventObserver_handle_esc_2[] = "EventObserver.handle_esc";
static char __pyx_k_EventObserver_handle_ss2_2[] = "EventObserver.handle_ss2";
static char __pyx_k_EventObserver_handle_ss3_2[] = "EventObserver.handle_ss3";
static char __pyx_k_EventObserver_handle_start[] = "EventObserver::handle_start";
static char __pyx_k_NotHandledException___init[] = "NotHandledException.__init__";
static char __pyx_k_ParseContext_dispatch_char[] = "ParseContext.dispatch_char";
static char __pyx_k_abstruct_TTY_output_stream[] = " abstruct TTY output stream ";
static char __pyx_k_DefaultHandler_handle_start[] = "DefaultHandler.handle_start";
static char __pyx_k_EventObserver_handle_char_2[] = "EventObserver.handle_char";
static char __pyx_k_EventObserver_handle_draw_2[] = "EventObserver.handle_draw";
static char __pyx_k_EventObserver_handle_resize[] = "EventObserver::handle_resize";
static char __pyx_k_Scanner_continuous_assign_2[] = "Scanner.continuous_assign";
static char __pyx_k_SimpleParser_parse_line_239[] = "SimpleParser.parse (line 239)";
static char __pyx_k_DefaultHandler_handle_resize[] = "DefaultHandler.handle_resize";
static char __pyx_k_EventDispatcher_dispatch_csi[] = "EventDispatcher::dispatch_csi";
static char __pyx_k_EventDispatcher_dispatch_esc[] = "EventDispatcher::dispatch_esc";
static char __pyx_k_EventObserver_handle_invalid[] = "EventObserver::handle_invalid";
static char __pyx_k_EventObserver_handle_start_2[] = "EventObserver.handle_start";
static char __pyx_k_FilterMultiplexer_handle_csi[] = "FilterMultiplexer.handle_csi";
static char __pyx_k_FilterMultiplexer_handle_end[] = "FilterMultiplexer.handle_end";
static char __pyx_k_FilterMultiplexer_handle_esc[] = "FilterMultiplexer.handle_esc";
static char __pyx_k_FilterMultiplexer_handle_ss2[] = "FilterMultiplexer.handle_ss2";
static char __pyx_k_FilterMultiplexer_handle_ss3[] = "FilterMultiplexer.handle_ss3";
static char __pyx_k_Session_start_locals_onclose[] = "Session.start.<locals>.onclose";
static char __pyx_k_DefaultHandler_handle_invalid[] = "DefaultHandler.handle_invalid";
static char __pyx_k_EventDispatcher_dispatch_char[] = "EventDispatcher::dispatch_char";
static char __pyx_k_EventObserver_handle_resize_2[] = "EventObserver.handle_resize";
static char __pyx_k_FilterMultiplexer_handle_char[] = "FilterMultiplexer.handle_char";
static char __pyx_k_FilterMultiplexer_handle_draw[] = "FilterMultiplexer.handle_draw";
static char __pyx_k_ParseContext_dispatch_invalid[] = "ParseContext.dispatch_invalid";
static char __pyx_k_Session_drive_locals_onresize[] = "Session.drive.<locals>.onresize";
static char __pyx_k_parse_ESC_CSI_string_seqneces[] = " parse ESC/CSI/string seqneces ";
static char __pyx_k_DefaultScanner_assign_line_617[] = "DefaultScanner.assign (line 617)";
static char __pyx_k_Dispatch_interface_of_terminal[] = " Dispatch interface of terminal sequence event oriented parser ";
static char __pyx_k_EventDispatcher_dispatch_csi_2[] = "EventDispatcher.dispatch_csi";
static char __pyx_k_EventDispatcher_dispatch_esc_2[] = "EventDispatcher.dispatch_esc";
static char __pyx_k_EventObserver_handle_invalid_2[] = "EventObserver.handle_invalid";
static char __pyx_k_FilterMultiplexer_handle_flush[] = "FilterMultiplexer.handle_flush";
static char __pyx_k_FilterMultiplexer_handle_start[] = "FilterMultiplexer.handle_start";
static char __pyx_k_ParseException___str___line_85[] = "ParseException.__str__ (line 85)";
static char __pyx_k_e_ParseException_test2_e_value[] = "\n        >>> e = ParseException(\"test2\")\n        >>> e.value\n        'test2'\n        ";
static char __pyx_k_scanner_DefaultScanner_scanner[] = "\n        >>> scanner = DefaultScanner()\n        >>> scanner._ucs4\n        True\n        ";
static char __pyx_k_scanner_DefaultScanner_termenc[] = "\n        >>> scanner = DefaultScanner(termenc=\"utf-8\")\n        >>> scanner.continuous_assign(\"01234\")\n        >>> scanner._data\n        u'01234'\n        ";
static char __pyx_k_EventDispatcher_dispatch_char_2[] = "EventDispatcher.dispatch_char";
static char __pyx_k_FilterMultiplexer_handle_resize[] = "FilterMultiplexer.handle_resize";
static char __pyx_k_MockHandler_handle_control_stri[] = "_MockHandler.handle_control_string";
static char __pyx_k_ParseException___init___line_77[] = "ParseException.__init__ (line 77)";
static char __pyx_k_adapt_to_event_driven_ECMA_35_4[] = " adapt to event driven ECMA-35/48 parser model ";
static char __pyx_k_default_handler_pass_through_al[] = " default handler, pass through all ESC/CSI/string seqnceses ";
static char __pyx_k_e_NotHandledException_test1_e_v[] = "\n        >>> e = NotHandledException(\"test1\")\n        >>> e.value\n        'test1'\n        ";
static char __pyx_k_e_NotHandledException_test2_e_v[] = "\n        >>> e = NotHandledException(\"test2\")\n        >>> e.value\n        'test2'\n        ";
static char __pyx_k_parser_SimpleParser_context_Sim[] = "\n        >>> parser = SimpleParser()\n        >>> context = SimpleParser._MockContext()\n        >>> parser.parse(context)\n        >>> context.output\n        [1, 2, 3, 4, 5]\n        ";
static char __pyx_k_scan_input_stream_and_iterate_U[] = " scan input stream and iterate UCS code points ";
static char __pyx_k_simple_parser_don_t_parse_ESC_C[] = " simple parser, don't parse ESC/CSI/string seqneces ";
static char __pyx_k_thrown_when_a_parse_error_is_de[] = " thrown when a parse error is detected ";
static char __pyx_k_thrown_when_an_unknown_seqnence[] = " thrown when an unknown seqnence is detected ";
static char __pyx_k_DefaultHandler_handle_control_st[] = "DefaultHandler.handle_control_string";
static char __pyx_k_DefaultScanner___init___line_601[] = "DefaultScanner.__init__ (line 601)";
static char __pyx_k_DefaultScanner___iter___line_638[] = "DefaultScanner.__iter__ (line 638)";
static char __pyx_k_DefaultScanner_continuous_assign[] = "DefaultScanner.continuous_assign";
static char __pyx_k_EventDispatcher_dispatch_control[] = "EventDispatcher::dispatch_control_string";
static char __pyx_k_EventObserver_handle_control_str[] = "EventObserver::handle_control_string";
static char __pyx_k_FilterMultiplexer_handle_control[] = "FilterMultiplexer.handle_control_string";
static char __pyx_k_FilterMultiplexer_handle_invalid[] = "FilterMultiplexer.handle_invalid";
static char __pyx_k_NotHandledException___init___lin[] = "NotHandledException.__init__ (line 56)";
static char __pyx_k_NotHandledException___str___line[] = "NotHandledException.__str__ (line 64)";
static char __pyx_k_ParseContext_dispatch_control_st[] = "ParseContext.dispatch_control_string";
static char __pyx_k_Process_process_input_locals_dis[] = "Process.process_input.<locals>.dispatch_esc";
static char __pyx_k_SimpleParser__MockContext___init[] = "SimpleParser._MockContext.__init__";
static char __pyx_k_SimpleParser__MockContext___iter[] = "SimpleParser._MockContext.__iter__";
static char __pyx_k_SimpleParser__MockContext_dispat[] = "SimpleParser._MockContext.dispatch_char";
static char __pyx_k_Switching_focus_fileno_d_main_pr[] = "Switching focus: fileno=%d (main process)";
static char __pyx_k_b87c36758a4c3d666c74490b383f483b[] = "b87c36758a4c3d666c74490b383f483b";
static char __pyx_k_scanner_DefaultScanner_scanner_2[] = "\n        >>> scanner = DefaultScanner()\n        >>> scanner.assign(\"01234\", \"ascii\")\n        >>> scanner._data\n        u'01234'\n        ";
static char __pyx_k_scanner_DefaultScanner_scanner_3[] = "\n        >>> scanner = DefaultScanner()\n        >>> scanner.assign(\"abcde\", \"UTF-8\")\n        >>> print [ c for c in scanner ]\n        [97, 98, 99, 100, 101]\n        ";
static char __pyx_k_DefaultScanner_continuous_assign_2[] = "DefaultScanner.continuous_assign (line 629)";
static char __pyx_k_EventDispatcher_dispatch_control_2[] = "EventDispatcher.dispatch_control_string";
static char __pyx_k_EventObserver_handle_control_str_2[] = "EventObserver.handle_control_string";
static PyObject *__pyx_kp_s_0_2_10;
static PyObject *__pyx_n_s_BRKINT;
static PyObject *__pyx_n_s_BUFFER_SIZE;
static PyObject *__pyx_n_s_CS8;
static PyObject *__pyx_n_s_CSIZE;
static PyObject *__pyx_n_s_DefaultHandler;
static PyObject *__pyx_n_s_DefaultHandler___init;
static PyObject *__pyx_n_s_DefaultHandler_handle_char;
static PyObject *__pyx_n_s_DefaultHandler_handle_control_st;
static PyObject *__pyx_n_s_DefaultHandler_handle_csi;
static PyObject *__pyx_n_s_DefaultHandler_handle_draw;
static PyObject *__pyx_n_s_DefaultHandler_handle_end;
static PyObject *__pyx_n_s_DefaultHandler_handle_esc;
static PyObject *__pyx_n_s_DefaultHandler_handle_invalid;
static PyObject *__pyx_n_s_DefaultHandler_handle_resize;
static PyObject *__pyx_n_s_DefaultHandler_handle_ss2;
static PyObject *__pyx_n_s_DefaultHandler_handle_ss3;
static PyObject *__pyx_n_s_DefaultHandler_handle_start;
static PyObject *__pyx_n_s_DefaultPTY;
static PyObject *__pyx_n_s_DefaultPTY___init;
static PyObject *__pyx_n_s_DefaultPTY___resize_impl;
static PyObject *__pyx_n_s_DefaultPTY___setupterm;
static PyObject *__pyx_n_s_DefaultPTY__resize_impl;
static PyObject *__pyx_n_s_DefaultPTY__setupterm;
static PyObject *__pyx_n_s_DefaultPTY_close;
static PyObject *__pyx_kp_s_DefaultPTY_close_master_d;
static PyObject *__pyx_n_s_DefaultPTY_fileno;
static PyObject *__pyx_n_s_DefaultPTY_fitsize;
static PyObject *__pyx_n_s_DefaultPTY_flush;
static PyObject *__pyx_n_s_DefaultPTY_read;
static PyObject *__pyx_n_s_DefaultPTY_resize;
static PyObject *__pyx_n_s_DefaultPTY_restore_term;
static PyObject *__pyx_n_s_DefaultPTY_stdin_fileno;
static PyObject *__pyx_n_s_DefaultPTY_write;
static PyObject *__pyx_n_s_DefaultPTY_xoff;
static PyObject *__pyx_n_s_DefaultPTY_xon;
static PyObject *__pyx_n_s_DefaultParser;
static PyObject *__pyx_n_s_DefaultParser___init;
static PyObject *__pyx_n_s_DefaultParser__context;
static PyObject *__pyx_n_s_DefaultParser__ibytes;
static PyObject *__pyx_n_s_DefaultParser__pbytes;
static PyObject *__pyx_n_s_DefaultParser__state;
static PyObject *__pyx_n_s_DefaultParser_flush;
static PyObject *__pyx_n_s_DefaultParser_init;
static PyObject *__pyx_n_s_DefaultParser_parse;
static PyObject *__pyx_n_s_DefaultParser_reset;
static PyObject *__pyx_n_s_DefaultParser_state_is_esc;
static PyObject *__pyx_n_s_DefaultScanner;
static PyObject *__pyx_n_s_DefaultScanner___init;
static PyObject *__pyx_kp_u_DefaultScanner___init___line_601;
static PyObject *__pyx_n_s_DefaultScanner___iter;
static PyObject *__pyx_kp_u_DefaultScanner___iter___line_638;
static PyObject *__pyx_n_s_DefaultScanner_assign;
static PyObject *__pyx_kp_u_DefaultScanner_assign_line_617;
static PyObject *__pyx_n_s_DefaultScanner_continuous_assign;
static PyObject *__pyx_kp_u_DefaultScanner_continuous_assign_2;
static PyObject *__pyx_kp_s_Dispatch_interface_of_terminal;
static PyObject *__pyx_n_s_EBADF;
static PyObject *__pyx_n_s_ECHO;
static PyObject *__pyx_n_s_ECHONL;
static PyObject *__pyx_n_s_EINTR;
static PyObject *__pyx_n_s_EIO;
static PyObject *__pyx_n_s_ESC_TIMEOUT;
static PyObject *__pyx_n_s_EventDispatcher;
static PyObject *__pyx_kp_s_EventDispatcher_dispatch_char;
static PyObject *__pyx_n_s_EventDispatcher_dispatch_char_2;
static PyObject *__pyx_kp_s_EventDispatcher_dispatch_control;
static PyObject *__pyx_n_s_EventDispatcher_dispatch_control_2;
static PyObject *__pyx_kp_s_EventDispatcher_dispatch_csi;
static PyObject *__pyx_n_s_EventDispatcher_dispatch_csi_2;
static PyObject *__pyx_kp_s_EventDispatcher_dispatch_esc;
static PyObject *__pyx_n_s_EventDispatcher_dispatch_esc_2;
static PyObject *__pyx_n_s_EventObserver;
static PyObject *__pyx_kp_s_EventObserver_handle_char;
static PyObject *__pyx_n_s_EventObserver_handle_char_2;
static PyObject *__pyx_kp_s_EventObserver_handle_control_str;
static PyObject *__pyx_n_s_EventObserver_handle_control_str_2;
static PyObject *__pyx_kp_s_EventObserver_handle_csi;
static PyObject *__pyx_n_s_EventObserver_handle_csi_2;
static PyObject *__pyx_kp_s_EventObserver_handle_draw;
static PyObject *__pyx_n_s_EventObserver_handle_draw_2;
static PyObject *__pyx_kp_s_EventObserver_handle_end;
static PyObject *__pyx_n_s_EventObserver_handle_end_2;
static PyObject *__pyx_kp_s_EventObserver_handle_esc;
static PyObject *__pyx_n_s_EventObserver_handle_esc_2;
static PyObject *__pyx_kp_s_EventObserver_handle_invalid;
static PyObject *__pyx_n_s_EventObserver_handle_invalid_2;
static PyObject *__pyx_kp_s_EventObserver_handle_resize;
static PyObject *__pyx_n_s_EventObserver_handle_resize_2;
static PyObject *__pyx_kp_s_EventObserver_handle_ss2;
static PyObject *__pyx_n_s_EventObserver_handle_ss2_2;
static PyObject *__pyx_kp_s_EventObserver_handle_ss3;
static PyObject *__pyx_n_s_EventObserver_handle_ss3_2;
static PyObject *__pyx_kp_s_EventObserver_handle_start;
static PyObject *__pyx_n_s_EventObserver_handle_start_2;
static PyObject *__pyx_n_s_Exception;
static PyObject *__pyx_n_s_FilterMultiplexer;
static PyObject *__pyx_n_s_FilterMultiplexer___init;
static PyObject *__pyx_n_s_FilterMultiplexer__lhs;
static PyObject *__pyx_n_s_FilterMultiplexer__rhs;
static PyObject *__pyx_n_s_FilterMultiplexer_get_lhs;
static PyObject *__pyx_n_s_FilterMultiplexer_get_rhs;
static PyObject *__pyx_n_s_FilterMultiplexer_handle_char;
static PyObject *__pyx_n_s_FilterMultiplexer_handle_control;
static PyObject *__pyx_n_s_FilterMultiplexer_handle_csi;
static PyObject *__pyx_n_s_FilterMultiplexer_handle_draw;
static PyObject *__pyx_n_s_FilterMultiplexer_handle_end;
static PyObject *__pyx_n_s_FilterMultiplexer_handle_esc;
static PyObject *__pyx_n_s_FilterMultiplexer_handle_flush;
static PyObject *__pyx_n_s_FilterMultiplexer_handle_invalid;
static PyObject *__pyx_n_s_FilterMultiplexer_handle_resize;
static PyObject *__pyx_n_s_FilterMultiplexer_handle_ss2;
static PyObject *__pyx_n_s_FilterMultiplexer_handle_ss3;
static PyObject *__pyx_n_s_FilterMultiplexer_handle_start;
static PyObject *__pyx_n_s_HHHH;
static PyObject *__pyx_kp_s_Hayaki_Saito_user_zuse_jp;
static PyObject *__pyx_n_s_ICANON;
static PyObject *__pyx_n_s_ICRNL;
static PyObject *__pyx_n_s_IEXTEN;
static PyObject *__pyx_n_s_IGNBRK;
static PyObject *__pyx_n_s_IGNCR;
static PyObject *__pyx_n_s_INLCR;
static PyObject *__pyx_n_s_IOError;
static PyObject *__pyx_n_s_ISIG;
static PyObject *__pyx_n_s_ISTRIP;
static PyObject *__pyx_n_s_IXON;
static PyObject *__pyx_n_s_ImportError;
static PyObject *__pyx_n_s_LANG;
static PyObject *__pyx_n_s_MIT;
static PyObject *__pyx_n_s_MockContext;
static PyObject *__pyx_n_s_MockHandler;
static PyObject *__pyx_n_s_MockHandler_handle_char;
static PyObject *__pyx_n_s_MockHandler_handle_control_stri;
static PyObject *__pyx_n_s_MockHandler_handle_csi;
static PyObject *__pyx_n_s_MockHandler_handle_esc;
static PyObject *__pyx_n_s_MockParseContext;
static PyObject *__pyx_n_s_MockParseContext___init;
static PyObject *__pyx_n_s_NotHandledException;
static PyObject *__pyx_n_s_NotHandledException___init;
static PyObject *__pyx_kp_u_NotHandledException___init___lin;
static PyObject *__pyx_n_s_NotHandledException___str;
static PyObject *__pyx_kp_u_NotHandledException___str___line;
static PyObject *__pyx_n_s_NotImplementedError;
static PyObject *__pyx_n_s_ONLCR;
static PyObject *__pyx_n_s_OPOST;
static PyObject *__pyx_n_s_OSError;
static PyObject *__pyx_n_s_OutputStream;
static PyObject *__pyx_kp_s_OutputStream_flush;
static PyObject *__pyx_n_s_OutputStream_flush_2;
static PyObject *__pyx_kp_s_OutputStream_write;
static PyObject *__pyx_n_s_OutputStream_write_2;
static PyObject *__pyx_n_s_PARENB;
static PyObject *__pyx_n_s_PARMRK;
static PyObject *__pyx_n_s_PC_VDISABLE;
static PyObject *__pyx_n_s_PTY;
static PyObject *__pyx_kp_s_PTY_drive;
static PyObject *__pyx_n_s_PTY_drive_2;
static PyObject *__pyx_kp_s_PTY_fitsize;
static PyObject *__pyx_n_s_PTY_fitsize_2;
static PyObject *__pyx_kp_s_PTY_read;
static PyObject *__pyx_n_s_PTY_read_2;
static PyObject *__pyx_kp_s_PTY_resize;
static PyObject *__pyx_n_s_PTY_resize_2;
static PyObject *__pyx_kp_s_PTY_write;
static PyObject *__pyx_n_s_PTY_write_2;
static PyObject *__pyx_kp_s_PTY_xoff;
static PyObject *__pyx_n_s_PTY_xoff_2;
static PyObject *__pyx_kp_s_PTY_xon;
static PyObject *__pyx_n_s_PTY_xon_2;
static PyObject *__pyx_n_s_ParseContext;
static PyObject *__pyx_n_s_ParseContext___init;
static PyObject *__pyx_n_s_ParseContext___iter;
static PyObject *__pyx_n_s_ParseContext__handler;
static PyObject *__pyx_n_s_ParseContext__scanner;
static PyObject *__pyx_n_s_ParseContext__termenc;
static PyObject *__pyx_n_s_ParseContext_assign;
static PyObject *__pyx_n_s_ParseContext_dispatch_char;
static PyObject *__pyx_n_s_ParseContext_dispatch_control_st;
static PyObject *__pyx_n_s_ParseContext_dispatch_csi;
static PyObject *__pyx_n_s_ParseContext_dispatch_esc;
static PyObject *__pyx_n_s_ParseContext_dispatch_invalid;
static PyObject *__pyx_n_s_ParseContext_dispatch_ss2;
static PyObject *__pyx_n_s_ParseContext_dispatch_ss3;
static PyObject *__pyx_n_s_ParseContext_flush;
static PyObject *__pyx_n_s_ParseContext_put;
static PyObject *__pyx_n_s_ParseContext_puts;
static PyObject *__pyx_n_s_ParseContext_putu;
static PyObject *__pyx_n_s_ParseContext_sethandler;
static PyObject *__pyx_n_s_ParseContext_write;
static PyObject *__pyx_n_s_ParseContext_writestring;
static PyObject *__pyx_n_s_ParseException;
static PyObject *__pyx_n_s_ParseException___init;
static PyObject *__pyx_kp_u_ParseException___init___line_77;
static PyObject *__pyx_n_s_ParseException___str;
static PyObject *__pyx_kp_u_ParseException___str___line_85;
static PyObject *__pyx_n_s_Parser;
static PyObject *__pyx_kp_s_Parser_parse;
static PyObject *__pyx_n_s_Parser_parse_2;
static PyObject *__pyx_n_s_Process;
static PyObject *__pyx_n_s_Process___init;
static PyObject *__pyx_n_s_Process_close;
static PyObject *__pyx_n_s_Process_drain;
static PyObject *__pyx_n_s_Process_end;
static PyObject *__pyx_n_s_Process_fileno;
static PyObject *__pyx_n_s_Process_fitsize;
static PyObject *__pyx_n_s_Process_getpid;
static PyObject *__pyx_n_s_Process_is_alive;
static PyObject *__pyx_n_s_Process_on_read;
static PyObject *__pyx_n_s_Process_on_write;
static PyObject *__pyx_n_s_Process_process_end;
static PyObject *__pyx_n_s_Process_process_input;
static PyObject *__pyx_n_s_Process_process_input_locals_dis;
static PyObject *__pyx_n_s_Process_process_output;
static PyObject *__pyx_n_s_Process_process_resize;
static PyObject *__pyx_n_s_Process_process_start;
static PyObject *__pyx_n_s_Process_read;
static PyObject *__pyx_n_s_Process_resize;
static PyObject *__pyx_n_s_Process_start;
static PyObject *__pyx_n_s_Process_stdin_fileno;
static PyObject *__pyx_n_s_Process_write;
static PyObject *__pyx_n_s_SIGCHLD;
static PyObject *__pyx_n_s_SIGWINCH;
static PyObject *__pyx_n_s_STATE_CSI_INTERMEDIATE;
static PyObject *__pyx_n_s_STATE_CSI_PARAMETER;
static PyObject *__pyx_n_s_STATE_ESC;
static PyObject *__pyx_n_s_STATE_ESC_INTERMEDIATE;
static PyObject *__pyx_n_s_STATE_GROUND;
static PyObject *__pyx_n_s_STATE_OSC;
static PyObject *__pyx_n_s_STATE_OSC_ESC;
static PyObject *__pyx_n_s_STATE_SS2;
static PyObject *__pyx_n_s_STATE_SS3;
static PyObject *__pyx_n_s_STATE_STR;
static PyObject *__pyx_n_s_STATE_STR_ESC;
static PyObject *__pyx_n_s_Scanner;
static PyObject *__pyx_kp_s_Scanner___iter;
static PyObject *__pyx_n_s_Scanner___iter_2;
static PyObject *__pyx_kp_s_Scanner_assign;
static PyObject *__pyx_n_s_Scanner_assign_2;
static PyObject *__pyx_kp_s_Scanner_continuous_assign;
static PyObject *__pyx_n_s_Scanner_continuous_assign_2;
static PyObject *__pyx_n_s_Session;
static PyObject *__pyx_n_s_Session___init;
static PyObject *__pyx_n_s_Session__init_process;
static PyObject *__pyx_n_s_Session_add_subtty;
static PyObject *__pyx_n_s_Session_blur_process;
static PyObject *__pyx_n_s_Session_create_process;
static PyObject *__pyx_n_s_Session_destruct_process;
static PyObject *__pyx_n_s_Session_drive;
static PyObject *__pyx_n_s_Session_drive_locals_onresize;
static PyObject *__pyx_n_s_Session_focus_process;
static PyObject *__pyx_n_s_Session_getactiveprocess;
static PyObject *__pyx_n_s_Session_process_is_active;
static PyObject *__pyx_n_s_Session_start;
static PyObject *__pyx_n_s_Session_start_locals_onclose;
static PyObject *__pyx_n_s_SimpleParser;
static PyObject *__pyx_n_s_SimpleParser__MockContext;
static PyObject *__pyx_n_s_SimpleParser__MockContext___init;
static PyObject *__pyx_n_s_SimpleParser__MockContext___iter;
static PyObject *__pyx_n_s_SimpleParser__MockContext_dispat;
static PyObject *__pyx_n_s_SimpleParser_parse;
static PyObject *__pyx_kp_u_SimpleParser_parse_line_239;
static PyObject *__pyx_n_s_StringIO;
static PyObject *__pyx_kp_s_Switching_focus_fileno_d;
static PyObject *__pyx_kp_s_Switching_focus_fileno_d_main_pr;
static PyObject *__pyx_n_s_TCOOFF;
static PyObject *__pyx_n_s_TCOON;
static PyObject *__pyx_n_s_TCSANOW;
static PyObject *__pyx_n_s_TERM;
static PyObject *__pyx_n_s_TIOCGWINSZ;
static PyObject *__pyx_n_s_TIOCSWINSZ;
static PyObject *__pyx_n_s_Timer;
static PyObject *__pyx_kp_s_UTF_8;
static PyObject *__pyx_n_s_VDSUSP;
static PyObject *__pyx_n_s_VEOF;
static PyObject *__pyx_n_s_VINTR;
static PyObject *__pyx_n_s_VKILL;
static PyObject *__pyx_n_s_VLNEXT;
static PyObject *__pyx_n_s_VQUIT;
static PyObject *__pyx_n_s_VREPRINT;
static PyObject *__pyx_n_s_VSTART;
static PyObject *__pyx_n_s_VSTOP;
static PyObject *__pyx_n_s_VSUSP;
static PyObject *__pyx_n_s_VWERASE;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_n_s__336;
static PyObject *__pyx_n_s__337;
static PyObject *__pyx_kp_s__43;
static PyObject *__pyx_kp_s_abstruct_PTY_device;
static PyObject *__pyx_kp_s_abstruct_Parser;
static PyObject *__pyx_kp_s_abstruct_TTY_output_stream;
static PyObject *__pyx_kp_s_adapt_to_event_driven_ECMA_35_4;
static PyObject *__pyx_n_s_add_subtty;
static PyObject *__pyx_n_s_alive;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_n_s_argspec;
static PyObject *__pyx_n_s_assign;
static PyObject *__pyx_n_s_author;
static PyObject *__pyx_n_s_b87c36758a4c3d666c74490b383f483b;
static PyObject *__pyx_n_s_backup;
static PyObject *__pyx_n_s_backup_termios;
static PyObject *__pyx_kp_s_bin_sh;
static PyObject *__pyx_n_s_blur_process;
static PyObject *__pyx_n_s_buffering;
static PyObject *__pyx_n_s_buffering_2;
static PyObject *__pyx_n_s_c;
static PyObject *__pyx_n_s_c1;
static PyObject *__pyx_n_s_c1_2;
static PyObject *__pyx_n_s_c2;
static PyObject *__pyx_n_s_cStringIO;
static PyObject *__pyx_kp_s_c_2;
static PyObject *__pyx_n_s_c_cc;
static PyObject *__pyx_n_s_c_cflag;
static PyObject *__pyx_n_s_c_lflag;
static PyObject *__pyx_n_s_cancel;
static PyObject *__pyx_n_s_chr;
static PyObject *__pyx_n_s_classname;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_codecs;
static PyObject *__pyx_n_s_col;
static PyObject *__pyx_n_s_command;
static PyObject *__pyx_n_s_context;
static PyObject *__pyx_n_s_continuous_assign;
static PyObject *__pyx_n_s_create_process;
static PyObject *__pyx_n_s_ctff;
static PyObject *__pyx_n_s_data;
static PyObject *__pyx_n_s_data_2;
static PyObject *__pyx_n_s_decode;
static PyObject *__pyx_n_s_decoder;
static PyObject *__pyx_kp_s_default_handler_pass_through_al;
static PyObject *__pyx_n_s_defaultvalue;
static PyObject *__pyx_n_s_destruct_process;
static PyObject *__pyx_n_s_dispatch_char;
static PyObject *__pyx_n_s_dispatch_control_string;
static PyObject *__pyx_n_s_dispatch_csi;
static PyObject *__pyx_n_s_dispatch_esc;
static PyObject *__pyx_n_s_dispatch_invalid;
static PyObject *__pyx_n_s_dispatch_ss2;
static PyObject *__pyx_n_s_dispatch_ss3;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_doctest;
static PyObject *__pyx_n_s_drain;
static PyObject *__pyx_n_s_drive;
static PyObject *__pyx_n_s_e;
static PyObject *__pyx_kp_u_e_NotHandledException_test1_e_v;
static PyObject *__pyx_kp_u_e_NotHandledException_test2_e_v;
static PyObject *__pyx_kp_u_e_ParseException_test2_e_value;
static PyObject *__pyx_n_s_end;
static PyObject *__pyx_n_s_environ;
static PyObject *__pyx_n_s_errno;
static PyObject *__pyx_n_s_error;
static PyObject *__pyx_n_s_errors;
static PyObject *__pyx_n_s_esc_timer;
static PyObject *__pyx_n_s_exception;
static PyObject *__pyx_kp_s_exec_s;
static PyObject *__pyx_n_s_execlp;
static PyObject *__pyx_n_s_fcntl;
static PyObject *__pyx_n_s_fd;
static PyObject *__pyx_n_s_file;
static PyObject *__pyx_n_s_fileno;
static PyObject *__pyx_n_s_final;
static PyObject *__pyx_n_s_fitsize;
static PyObject *__pyx_n_s_flush;
static PyObject *__pyx_n_s_focus_process;
static PyObject *__pyx_n_s_fork;
static PyObject *__pyx_kp_s_forward_input_iterator;
static PyObject *__pyx_n_s_fpathconf;
static PyObject *__pyx_n_s_frame;
static PyObject *__pyx_n_s_get_lhs;
static PyObject *__pyx_n_s_get_rhs;
static PyObject *__pyx_n_s_getactiveprocess;
static PyObject *__pyx_n_s_getargspec;
static PyObject *__pyx_n_s_getincrementaldecoder;
static PyObject *__pyx_n_s_getmembers;
static PyObject *__pyx_n_s_getpid;
static PyObject *__pyx_n_s_getwriter;
static PyObject *__pyx_n_s_handle_char;
static PyObject *__pyx_n_s_handle_control_string;
static PyObject *__pyx_n_s_handle_csi;
static PyObject *__pyx_n_s_handle_draw;
static PyObject *__pyx_n_s_handle_end;
static PyObject *__pyx_n_s_handle_esc;
static PyObject *__pyx_n_s_handle_flush;
static PyObject *__pyx_n_s_handle_invalid;
static PyObject *__pyx_n_s_handle_resize;
static PyObject *__pyx_n_s_handle_ss2;
static PyObject *__pyx_n_s_handle_ss3;
static PyObject *__pyx_n_s_handle_start;
static PyObject *__pyx_n_s_handled_lhs;
static PyObject *__pyx_n_s_handled_rhs;
static PyObject *__pyx_n_s_handler;
static PyObject *__pyx_n_s_hashlib;
static PyObject *__pyx_n_s_height;
static PyObject *__pyx_n_s_hexdigest;
static PyObject *__pyx_n_s_hh;
static PyObject *__pyx_n_s_hhhh;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_s_ibytes;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_info;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_init_2;
static PyObject *__pyx_n_s_init_process;
static PyObject *__pyx_n_s_input_target;
static PyObject *__pyx_n_s_inputcontext;
static PyObject *__pyx_n_s_inputcontext_2;
static PyObject *__pyx_n_s_inputhandler;
static PyObject *__pyx_n_s_inputhandler_2;
static PyObject *__pyx_n_s_inputparser;
static PyObject *__pyx_n_s_inputparser_2;
static PyObject *__pyx_n_s_inputscanner;
static PyObject *__pyx_n_s_inspect;
static PyObject *__pyx_n_s_intermediate;
static PyObject *__pyx_n_s_io;
static PyObject *__pyx_n_s_ioctl;
static PyObject *__pyx_n_s_is_alive;
static PyObject *__pyx_n_s_isclass;
static PyObject *__pyx_n_s_ismethod;
static PyObject *__pyx_n_s_iter;
static PyObject *__pyx_n_s_join;
static PyObject *__pyx_n_s_keywords;
static PyObject *__pyx_n_s_kill;
static PyObject *__pyx_n_s_lang;
static PyObject *__pyx_n_s_lhs;
static PyObject *__pyx_n_s_license;
static PyObject *__pyx_n_s_logging;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_mainprocess;
static PyObject *__pyx_n_s_mainprocess_2;
static PyObject *__pyx_n_s_master;
static PyObject *__pyx_n_s_master_2;
static PyObject *__pyx_n_s_md5;
static PyObject *__pyx_n_s_member;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_modules;
static PyObject *__pyx_n_s_msg;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_s_no;
static PyObject *__pyx_n_s_on_read;
static PyObject *__pyx_n_s_on_write;
static PyObject *__pyx_n_s_onclose;
static PyObject *__pyx_n_s_onresize;
static PyObject *__pyx_n_s_ord;
static PyObject *__pyx_n_s_os;
static PyObject *__pyx_n_s_output;
static PyObject *__pyx_n_s_output_2;
static PyObject *__pyx_n_s_outputcontext;
static PyObject *__pyx_n_s_outputcontext_2;
static PyObject *__pyx_n_s_outputhandler;
static PyObject *__pyx_n_s_outputhandler_2;
static PyObject *__pyx_n_s_outputparser;
static PyObject *__pyx_n_s_outputparser_2;
static PyObject *__pyx_n_s_outputscanner;
static PyObject *__pyx_n_s_pack;
static PyObject *__pyx_n_s_parameter;
static PyObject *__pyx_n_s_params;
static PyObject *__pyx_n_s_parse;
static PyObject *__pyx_kp_s_parse_ESC_CSI_string_seqneces;
static PyObject *__pyx_kp_u_parser_SimpleParser_context_Sim;
static PyObject *__pyx_n_s_pbytes;
static PyObject *__pyx_n_s_pid;
static PyObject *__pyx_n_s_prefix;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_print;
static PyObject *__pyx_n_s_process;
static PyObject *__pyx_n_s_process_end;
static PyObject *__pyx_n_s_process_input;
static PyObject *__pyx_n_s_process_is_active;
static PyObject *__pyx_n_s_process_map;
static PyObject *__pyx_n_s_process_map_2;
static PyObject *__pyx_n_s_process_output;
static PyObject *__pyx_n_s_process_resize;
static PyObject *__pyx_n_s_process_start;
static PyObject *__pyx_n_s_pty;
static PyObject *__pyx_n_s_put;
static PyObject *__pyx_n_s_puts;
static PyObject *__pyx_n_s_putu;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_read;
static PyObject *__pyx_n_s_remove;
static PyObject *__pyx_n_s_replace;
static PyObject *__pyx_n_s_reset;
static PyObject *__pyx_n_s_resize;
static PyObject *__pyx_n_s_resize_impl;
static PyObject *__pyx_n_s_resized;
static PyObject *__pyx_n_s_restore_term;
static PyObject *__pyx_n_s_rfd;
static PyObject *__pyx_n_s_rfds;
static PyObject *__pyx_n_s_rhs;
static PyObject *__pyx_n_s_row;
static PyObject *__pyx_kp_s_s_s_s;
static PyObject *__pyx_kp_s_scan_input_stream_and_iterate_U;
static PyObject *__pyx_n_s_scanner;
static PyObject *__pyx_kp_u_scanner_DefaultScanner_scanner;
static PyObject *__pyx_kp_u_scanner_DefaultScanner_scanner_2;
static PyObject *__pyx_kp_u_scanner_DefaultScanner_scanner_3;
static PyObject *__pyx_kp_u_scanner_DefaultScanner_termenc;
static PyObject *__pyx_n_s_select;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_send;
static PyObject *__pyx_n_s_seq;
static PyObject *__pyx_n_s_sethandler;
static PyObject *__pyx_n_s_setupterm;
static PyObject *__pyx_n_s_signal;
static PyObject *__pyx_n_s_signature;
static PyObject *__pyx_kp_s_simple_parser_don_t_parse_ESC_C;
static PyObject *__pyx_n_s_sort;
static PyObject *__pyx_n_s_specs;
static PyObject *__pyx_n_s_specstr;
static PyObject *__pyx_n_s_start;
static PyObject *__pyx_n_s_startswith;
static PyObject *__pyx_n_s_state;
static PyObject *__pyx_n_s_state_is_esc;
static PyObject *__pyx_n_s_status;
static PyObject *__pyx_n_s_stdin;
static PyObject *__pyx_n_s_stdin_fileno;
static PyObject *__pyx_n_s_stdin_fileno_2;
static PyObject *__pyx_n_s_stdout;
static PyObject *__pyx_n_s_str;
static PyObject *__pyx_n_s_struct;
static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_s_target_fd;
static PyObject *__pyx_n_s_target_output;
static PyObject *__pyx_n_s_tcflow;
static PyObject *__pyx_n_s_tcgetattr;
static PyObject *__pyx_n_s_tcsetattr;
static PyObject *__pyx_n_s_template;
static PyObject *__pyx_n_s_term;
static PyObject *__pyx_n_s_termenc;
static PyObject *__pyx_n_s_termenc_2;
static PyObject *__pyx_n_s_termios;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_test_2;
static PyObject *__pyx_n_s_testmod;
static PyObject *__pyx_n_s_thismodule;
static PyObject *__pyx_n_s_threading;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_kp_s_thrown_when_a_parse_error_is_de;
static PyObject *__pyx_kp_s_thrown_when_an_unknown_seqnence;
static PyObject *__pyx_kp_s_tmp_ctff_pyx;
static PyObject *__pyx_n_s_truncate;
static PyObject *__pyx_n_s_tty;
static PyObject *__pyx_n_s_tty_2;
static PyObject *__pyx_n_s_ucs4;
static PyObject *__pyx_n_s_ucs4_2;
static PyObject *__pyx_n_s_unichr;
static PyObject *__pyx_n_s_unpack;
static PyObject *__pyx_n_s_update;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_varargs;
static PyObject *__pyx_n_s_vdisable;
static PyObject *__pyx_n_s_version;
static PyObject *__pyx_n_s_wait;
static PyObject *__pyx_n_s_wfd;
static PyObject *__pyx_n_s_width;
static PyObject *__pyx_n_s_winsize;
static PyObject *__pyx_n_s_write;
static PyObject *__pyx_n_s_writestring;
static PyObject *__pyx_n_s_x;
static PyObject *__pyx_n_s_xfd;
static PyObject *__pyx_n_s_xfds;
static PyObject *__pyx_n_s_xoff;
static PyObject *__pyx_n_s_xon;
static PyObject *__pyx_float_0_5;
static PyObject *__pyx_float_0_6;
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_14;
static PyObject *__pyx_int_24;
static PyObject *__pyx_int_26;
static PyObject *__pyx_int_27;
static PyObject *__pyx_int_31;
static PyObject *__pyx_int_32;
static PyObject *__pyx_int_47;
static PyObject *__pyx_int_63;
static PyObject *__pyx_int_78;
static PyObject *__pyx_int_79;
static PyObject *__pyx_int_80;
static PyObject *__pyx_int_88;
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_126;
static PyObject *__pyx_int_127;
static PyObject *__pyx_int_128;
static PyObject *__pyx_int_1023;
static PyObject *__pyx_int_8192;
static PyObject *__pyx_int_55296;
static PyObject *__pyx_int_56319;
static PyObject *__pyx_int_56320;
static PyObject *__pyx_int_57343;
static PyObject *__pyx_int_57344;
static PyObject *__pyx_int_65536;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
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__18;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__20;
static PyObject *__pyx_tuple__21;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__28;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__30;
static PyObject *__pyx_tuple__31;
static PyObject *__pyx_tuple__32;
static PyObject *__pyx_tuple__33;
static PyObject *__pyx_tuple__34;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__36;
static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__38;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__41;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__46;
static PyObject *__pyx_tuple__48;
static PyObject *__pyx_tuple__49;
static PyObject *__pyx_tuple__50;
static PyObject *__pyx_tuple__52;
static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__56;
static PyObject *__pyx_tuple__58;
static PyObject *__pyx_tuple__60;
static PyObject *__pyx_tuple__62;
static PyObject *__pyx_tuple__64;
static PyObject *__pyx_tuple__66;
static PyObject *__pyx_tuple__68;
static PyObject *__pyx_tuple__70;
static PyObject *__pyx_tuple__72;
static PyObject *__pyx_tuple__74;
static PyObject *__pyx_tuple__76;
static PyObject *__pyx_tuple__78;
static PyObject *__pyx_tuple__80;
static PyObject *__pyx_tuple__82;
static PyObject *__pyx_tuple__84;
static PyObject *__pyx_tuple__86;
static PyObject *__pyx_tuple__88;
static PyObject *__pyx_tuple__90;
static PyObject *__pyx_tuple__92;
static PyObject *__pyx_tuple__94;
static PyObject *__pyx_tuple__96;
static PyObject *__pyx_tuple__98;
static PyObject *__pyx_tuple__100;
static PyObject *__pyx_tuple__102;
static PyObject *__pyx_tuple__104;
static PyObject *__pyx_tuple__106;
static PyObject *__pyx_tuple__108;
static PyObject *__pyx_tuple__110;
static PyObject *__pyx_tuple__112;
static PyObject *__pyx_tuple__114;
static PyObject *__pyx_tuple__116;
static PyObject *__pyx_tuple__118;
static PyObject *__pyx_tuple__120;
static PyObject *__pyx_tuple__122;
static PyObject *__pyx_tuple__124;
static PyObject *__pyx_tuple__126;
static PyObject *__pyx_tuple__128;
static PyObject *__pyx_tuple__130;
static PyObject *__pyx_tuple__132;
static PyObject *__pyx_tuple__134;
static PyObject *__pyx_tuple__136;
static PyObject *__pyx_tuple__138;
static PyObject *__pyx_tuple__140;
static PyObject *__pyx_tuple__142;
static PyObject *__pyx_tuple__144;
static PyObject *__pyx_tuple__146;
static PyObject *__pyx_tuple__147;
static PyObject *__pyx_tuple__149;
static PyObject *__pyx_tuple__151;
static PyObject *__pyx_tuple__153;
static PyObject *__pyx_tuple__155;
static PyObject *__pyx_tuple__157;
static PyObject *__pyx_tuple__159;
static PyObject *__pyx_tuple__161;
static PyObject *__pyx_tuple__163;
static PyObject *__pyx_tuple__165;
static PyObject *__pyx_tuple__167;
static PyObject *__pyx_tuple__169;
static PyObject *__pyx_tuple__171;
static PyObject *__pyx_tuple__173;
static PyObject *__pyx_tuple__175;
static PyObject *__pyx_tuple__177;
static PyObject *__pyx_tuple__179;
static PyObject *__pyx_tuple__181;
static PyObject *__pyx_tuple__183;
static PyObject *__pyx_tuple__185;
static PyObject *__pyx_tuple__187;
static PyObject *__pyx_tuple__189;
static PyObject *__pyx_tuple__191;
static PyObject *__pyx_tuple__193;
static PyObject *__pyx_tuple__195;
static PyObject *__pyx_tuple__197;
static PyObject *__pyx_tuple__199;
static PyObject *__pyx_tuple__201;
static PyObject *__pyx_tuple__203;
static PyObject *__pyx_tuple__205;
static PyObject *__pyx_tuple__207;
static PyObject *__pyx_tuple__209;
static PyObject *__pyx_tuple__211;
static PyObject *__pyx_tuple__213;
static PyObject *__pyx_tuple__215;
static PyObject *__pyx_tuple__217;
static PyObject *__pyx_tuple__219;
static PyObject *__pyx_tuple__221;
static PyObject *__pyx_tuple__223;
static PyObject *__pyx_tuple__225;
static PyObject *__pyx_tuple__227;
static PyObject *__pyx_tuple__229;
static PyObject *__pyx_tuple__231;
static PyObject *__pyx_tuple__233;
static PyObject *__pyx_tuple__235;
static PyObject *__pyx_tuple__237;
static PyObject *__pyx_tuple__239;
static PyObject *__pyx_tuple__241;
static PyObject *__pyx_tuple__243;
static PyObject *__pyx_tuple__244;
static PyObject *__pyx_tuple__246;
static PyObject *__pyx_tuple__248;
static PyObject *__pyx_tuple__250;
static PyObject *__pyx_tuple__252;
static PyObject *__pyx_tuple__254;
static PyObject *__pyx_tuple__256;
static PyObject *__pyx_tuple__258;
static PyObject *__pyx_tuple__260;
static PyObject *__pyx_tuple__262;
static PyObject *__pyx_tuple__264;
static PyObject *__pyx_tuple__266;
static PyObject *__pyx_tuple__268;
static PyObject *__pyx_tuple__270;
static PyObject *__pyx_tuple__272;
static PyObject *__pyx_tuple__274;
static PyObject *__pyx_tuple__276;
static PyObject *__pyx_tuple__278;
static PyObject *__pyx_tuple__280;
static PyObject *__pyx_tuple__282;
static PyObject *__pyx_tuple__284;
static PyObject *__pyx_tuple__286;
static PyObject *__pyx_tuple__288;
static PyObject *__pyx_tuple__290;
static PyObject *__pyx_tuple__292;
static PyObject *__pyx_tuple__294;
static PyObject *__pyx_tuple__296;
static PyObject *__pyx_tuple__298;
static PyObject *__pyx_tuple__300;
static PyObject *__pyx_tuple__302;
static PyObject *__pyx_tuple__304;
static PyObject *__pyx_tuple__306;
static PyObject *__pyx_tuple__308;
static PyObject *__pyx_tuple__310;
static PyObject *__pyx_tuple__312;
static PyObject *__pyx_tuple__314;
static PyObject *__pyx_tuple__316;
static PyObject *__pyx_tuple__318;
static PyObject *__pyx_tuple__320;
static PyObject *__pyx_tuple__322;
static PyObject *__pyx_tuple__324;
static PyObject *__pyx_tuple__326;
static PyObject *__pyx_tuple__328;
static PyObject *__pyx_tuple__330;
static PyObject *__pyx_tuple__332;
static PyObject *__pyx_tuple__334;
static PyObject *__pyx_tuple__338;
static PyObject *__pyx_codeobj__42;
static PyObject *__pyx_codeobj__47;
static PyObject *__pyx_codeobj__51;
static PyObject *__pyx_codeobj__53;
static PyObject *__pyx_codeobj__55;
static PyObject *__pyx_codeobj__57;
static PyObject *__pyx_codeobj__59;
static PyObject *__pyx_codeobj__61;
static PyObject *__pyx_codeobj__63;
static PyObject *__pyx_codeobj__65;
static PyObject *__pyx_codeobj__67;
static PyObject *__pyx_codeobj__69;
static PyObject *__pyx_codeobj__71;
static PyObject *__pyx_codeobj__73;
static PyObject *__pyx_codeobj__75;
static PyObject *__pyx_codeobj__77;
static PyObject *__pyx_codeobj__79;
static PyObject *__pyx_codeobj__81;
static PyObject *__pyx_codeobj__83;
static PyObject *__pyx_codeobj__85;
static PyObject *__pyx_codeobj__87;
static PyObject *__pyx_codeobj__89;
static PyObject *__pyx_codeobj__91;
static PyObject *__pyx_codeobj__93;
static PyObject *__pyx_codeobj__95;
static PyObject *__pyx_codeobj__97;
static PyObject *__pyx_codeobj__99;
static PyObject *__pyx_codeobj__101;
static PyObject *__pyx_codeobj__103;
static PyObject *__pyx_codeobj__105;
static PyObject *__pyx_codeobj__107;
static PyObject *__pyx_codeobj__109;
static PyObject *__pyx_codeobj__111;
static PyObject *__pyx_codeobj__113;
static PyObject *__pyx_codeobj__115;
static PyObject *__pyx_codeobj__117;
static PyObject *__pyx_codeobj__119;
static PyObject *__pyx_codeobj__121;
static PyObject *__pyx_codeobj__123;
static PyObject *__pyx_codeobj__125;
static PyObject *__pyx_codeobj__127;
static PyObject *__pyx_codeobj__129;
static PyObject *__pyx_codeobj__131;
static PyObject *__pyx_codeobj__133;
static PyObject *__pyx_codeobj__135;
static PyObject *__pyx_codeobj__137;
static PyObject *__pyx_codeobj__139;
static PyObject *__pyx_codeobj__141;
static PyObject *__pyx_codeobj__143;
static PyObject *__pyx_codeobj__145;
static PyObject *__pyx_codeobj__148;
static PyObject *__pyx_codeobj__150;
static PyObject *__pyx_codeobj__152;
static PyObject *__pyx_codeobj__154;
static PyObject *__pyx_codeobj__156;
static PyObject *__pyx_codeobj__158;
static PyObject *__pyx_codeobj__160;
static PyObject *__pyx_codeobj__162;
static PyObject *__pyx_codeobj__164;
static PyObject *__pyx_codeobj__166;
static PyObject *__pyx_codeobj__168;
static PyObject *__pyx_codeobj__170;
static PyObject *__pyx_codeobj__172;
static PyObject *__pyx_codeobj__174;
static PyObject *__pyx_codeobj__176;
static PyObject *__pyx_codeobj__178;
static PyObject *__pyx_codeobj__180;
static PyObject *__pyx_codeobj__182;
static PyObject *__pyx_codeobj__184;
static PyObject *__pyx_codeobj__186;
static PyObject *__pyx_codeobj__188;
static PyObject *__pyx_codeobj__190;
static PyObject *__pyx_codeobj__192;
static PyObject *__pyx_codeobj__194;
static PyObject *__pyx_codeobj__196;
static PyObject *__pyx_codeobj__198;
static PyObject *__pyx_codeobj__200;
static PyObject *__pyx_codeobj__202;
static PyObject *__pyx_codeobj__204;
static PyObject *__pyx_codeobj__206;
static PyObject *__pyx_codeobj__208;
static PyObject *__pyx_codeobj__210;
static PyObject *__pyx_codeobj__212;
static PyObject *__pyx_codeobj__214;
static PyObject *__pyx_codeobj__216;
static PyObject *__pyx_codeobj__218;
static PyObject *__pyx_codeobj__220;
static PyObject *__pyx_codeobj__222;
static PyObject *__pyx_codeobj__224;
static PyObject *__pyx_codeobj__226;
static PyObject *__pyx_codeobj__228;
static PyObject *__pyx_codeobj__230;
static PyObject *__pyx_codeobj__232;
static PyObject *__pyx_codeobj__234;
static PyObject *__pyx_codeobj__236;
static PyObject *__pyx_codeobj__238;
static PyObject *__pyx_codeobj__240;
static PyObject *__pyx_codeobj__242;
static PyObject *__pyx_codeobj__245;
static PyObject *__pyx_codeobj__247;
static PyObject *__pyx_codeobj__249;
static PyObject *__pyx_codeobj__251;
static PyObject *__pyx_codeobj__253;
static PyObject *__pyx_codeobj__255;
static PyObject *__pyx_codeobj__257;
static PyObject *__pyx_codeobj__259;
static PyObject *__pyx_codeobj__261;
static PyObject *__pyx_codeobj__263;
static PyObject *__pyx_codeobj__265;
static PyObject *__pyx_codeobj__267;
static PyObject *__pyx_codeobj__269;
static PyObject *__pyx_codeobj__271;
static PyObject *__pyx_codeobj__273;
static PyObject *__pyx_codeobj__275;
static PyObject *__pyx_codeobj__277;
static PyObject *__pyx_codeobj__279;
static PyObject *__pyx_codeobj__281;
static PyObject *__pyx_codeobj__283;
static PyObject *__pyx_codeobj__285;
static PyObject *__pyx_codeobj__287;
static PyObject *__pyx_codeobj__289;
static PyObject *__pyx_codeobj__291;
static PyObject *__pyx_codeobj__293;
static PyObject *__pyx_codeobj__295;
static PyObject *__pyx_codeobj__297;
static PyObject *__pyx_codeobj__299;
static PyObject *__pyx_codeobj__301;
static PyObject *__pyx_codeobj__303;
static PyObject *__pyx_codeobj__305;
static PyObject *__pyx_codeobj__307;
static PyObject *__pyx_codeobj__309;
static PyObject *__pyx_codeobj__311;
static PyObject *__pyx_codeobj__313;
static PyObject *__pyx_codeobj__315;
static PyObject *__pyx_codeobj__317;
static PyObject *__pyx_codeobj__319;
static PyObject *__pyx_codeobj__321;
static PyObject *__pyx_codeobj__323;
static PyObject *__pyx_codeobj__325;
static PyObject *__pyx_codeobj__327;
static PyObject *__pyx_codeobj__329;
static PyObject *__pyx_codeobj__331;
static PyObject *__pyx_codeobj__333;
static PyObject *__pyx_codeobj__335;

/* "ctff.pyx":56
 *     ''' thrown when an unknown seqnence is detected '''
 * 
 *     def __init__(self, value):             # <<<<<<<<<<<<<<
 *         """
 *         >>> e = NotHandledException("test1")
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_19NotHandledException_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4ctff_19NotHandledException___init__[] = "\n        >>> e = NotHandledException(\"test1\")\n        >>> e.value\n        'test1'\n        ";
static PyMethodDef __pyx_mdef_4ctff_19NotHandledException_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_4ctff_19NotHandledException_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4ctff_19NotHandledException___init__)};
static PyObject *__pyx_pw_4ctff_19NotHandledException_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_value = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.NotHandledException.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_19NotHandledException___init__(__pyx_self, __pyx_v_self, __pyx_v_value);

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

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

  /* "ctff.pyx":62
 *         'test1'
 *         """
 *         self.value = value             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_value, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":56
 *     ''' thrown when an unknown seqnence is detected '''
 * 
 *     def __init__(self, value):             # <<<<<<<<<<<<<<
 *         """
 *         >>> e = NotHandledException("test1")
 */

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

/* "ctff.pyx":64
 *         self.value = value
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         """
 *         >>> e = NotHandledException("test2")
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_19NotHandledException_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_4ctff_19NotHandledException_2__str__[] = "\n        >>> e = NotHandledException(\"test2\")\n        >>> e.value\n        'test2'\n        ";
static PyMethodDef __pyx_mdef_4ctff_19NotHandledException_3__str__ = {__Pyx_NAMESTR("__str__"), (PyCFunction)__pyx_pw_4ctff_19NotHandledException_3__str__, METH_O, __Pyx_DOCSTR(__pyx_doc_4ctff_19NotHandledException_2__str__)};
static PyObject *__pyx_pw_4ctff_19NotHandledException_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_19NotHandledException_2__str__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ctff_19NotHandledException_2__str__(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("__str__", 0);

  /* "ctff.pyx":70
 *         'test2'
 *         """
 *         return repr(self.value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __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;

  /* "ctff.pyx":64
 *         self.value = value
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         """
 *         >>> e = NotHandledException("test2")
 */

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

/* "ctff.pyx":77
 *     ''' thrown when a parse error is detected '''
 * 
 *     def __init__(self, value):             # <<<<<<<<<<<<<<
 *         """
 *         >>> e = ParseException("test2")
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_14ParseException_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4ctff_14ParseException___init__[] = "\n        >>> e = ParseException(\"test2\")\n        >>> e.value\n        'test2'\n        ";
static PyMethodDef __pyx_mdef_4ctff_14ParseException_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_4ctff_14ParseException_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4ctff_14ParseException___init__)};
static PyObject *__pyx_pw_4ctff_14ParseException_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_value = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.ParseException.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_14ParseException___init__(__pyx_self, __pyx_v_self, __pyx_v_value);

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

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

  /* "ctff.pyx":83
 *         'test2'
 *         """
 *         self.value = value             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_value, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":77
 *     ''' thrown when a parse error is detected '''
 * 
 *     def __init__(self, value):             # <<<<<<<<<<<<<<
 *         """
 *         >>> e = ParseException("test2")
 */

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

/* "ctff.pyx":85
 *         self.value = value
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         """
 *         >>> e = ParseException("test2")
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_14ParseException_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_4ctff_14ParseException_2__str__[] = "\n        >>> e = ParseException(\"test2\")\n        >>> e.value\n        'test2'\n        ";
static PyMethodDef __pyx_mdef_4ctff_14ParseException_3__str__ = {__Pyx_NAMESTR("__str__"), (PyCFunction)__pyx_pw_4ctff_14ParseException_3__str__, METH_O, __Pyx_DOCSTR(__pyx_doc_4ctff_14ParseException_2__str__)};
static PyObject *__pyx_pw_4ctff_14ParseException_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_14ParseException_2__str__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ctff_14ParseException_2__str__(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("__str__", 0);

  /* "ctff.pyx":91
 *         'test2'
 *         """
 *         return repr(self.value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __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;

  /* "ctff.pyx":85
 *         self.value = value
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         """
 *         >>> e = ParseException("test2")
 */

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

/* "ctff.pyx":108
 *     ''' adapt to event driven ECMA-35/48 parser model '''
 * 
 *     def handle_start(self, context):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_start")
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_13EventObserver_1handle_start(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_13EventObserver_1handle_start = {__Pyx_NAMESTR("handle_start"), (PyCFunction)__pyx_pw_4ctff_13EventObserver_1handle_start, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_13EventObserver_1handle_start(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_context = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_start (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_start", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_start") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_context = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_start", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.EventObserver.handle_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_13EventObserver_handle_start(__pyx_self, __pyx_v_self, __pyx_v_context);

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

static PyObject *__pyx_pf_4ctff_13EventObserver_handle_start(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context) {
  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("handle_start", 0);

  /* "ctff.pyx":109
 * 
 *     def handle_start(self, context):
 *         raise NotImplementedError("EventObserver::handle_start")             # <<<<<<<<<<<<<<
 * 
 *     def handle_end(self, context):
 */
  __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":108
 *     ''' adapt to event driven ECMA-35/48 parser model '''
 * 
 *     def handle_start(self, context):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_start")
 * 
 */

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

/* "ctff.pyx":111
 *         raise NotImplementedError("EventObserver::handle_start")
 * 
 *     def handle_end(self, context):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_end")
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_13EventObserver_3handle_end(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_13EventObserver_3handle_end = {__Pyx_NAMESTR("handle_end"), (PyCFunction)__pyx_pw_4ctff_13EventObserver_3handle_end, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_13EventObserver_3handle_end(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_context = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_end (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_end", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_end") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_context = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_end", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.EventObserver.handle_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_13EventObserver_2handle_end(__pyx_self, __pyx_v_self, __pyx_v_context);

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

static PyObject *__pyx_pf_4ctff_13EventObserver_2handle_end(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context) {
  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("handle_end", 0);

  /* "ctff.pyx":112
 * 
 *     def handle_end(self, context):
 *         raise NotImplementedError("EventObserver::handle_end")             # <<<<<<<<<<<<<<
 * 
 *     def handle_csi(self, context, params, intermediate, final):
 */
  __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":111
 *         raise NotImplementedError("EventObserver::handle_start")
 * 
 *     def handle_end(self, context):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_end")
 * 
 */

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

/* "ctff.pyx":114
 *         raise NotImplementedError("EventObserver::handle_end")
 * 
 *     def handle_csi(self, context, params, intermediate, final):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_csi")
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_13EventObserver_5handle_csi(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_13EventObserver_5handle_csi = {__Pyx_NAMESTR("handle_csi"), (PyCFunction)__pyx_pw_4ctff_13EventObserver_5handle_csi, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_13EventObserver_5handle_csi(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_context = 0;
  CYTHON_UNUSED PyObject *__pyx_v_params = 0;
  CYTHON_UNUSED PyObject *__pyx_v_intermediate = 0;
  CYTHON_UNUSED PyObject *__pyx_v_final = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_csi (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,&__pyx_n_s_params,&__pyx_n_s_intermediate,&__pyx_n_s_final,0};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_csi", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_params)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_csi", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_intermediate)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_csi", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_final)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_csi", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_csi") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_self = values[0];
    __pyx_v_context = values[1];
    __pyx_v_params = values[2];
    __pyx_v_intermediate = values[3];
    __pyx_v_final = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_csi", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.EventObserver.handle_csi", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_13EventObserver_4handle_csi(__pyx_self, __pyx_v_self, __pyx_v_context, __pyx_v_params, __pyx_v_intermediate, __pyx_v_final);

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

static PyObject *__pyx_pf_4ctff_13EventObserver_4handle_csi(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_params, CYTHON_UNUSED PyObject *__pyx_v_intermediate, CYTHON_UNUSED PyObject *__pyx_v_final) {
  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("handle_csi", 0);

  /* "ctff.pyx":115
 * 
 *     def handle_csi(self, context, params, intermediate, final):
 *         raise NotImplementedError("EventObserver::handle_csi")             # <<<<<<<<<<<<<<
 * 
 *     def handle_esc(self, context, prefix, final):
 */
  __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":114
 *         raise NotImplementedError("EventObserver::handle_end")
 * 
 *     def handle_csi(self, context, params, intermediate, final):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_csi")
 * 
 */

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

/* "ctff.pyx":117
 *         raise NotImplementedError("EventObserver::handle_csi")
 * 
 *     def handle_esc(self, context, prefix, final):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_esc")
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_13EventObserver_7handle_esc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_13EventObserver_7handle_esc = {__Pyx_NAMESTR("handle_esc"), (PyCFunction)__pyx_pw_4ctff_13EventObserver_7handle_esc, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_13EventObserver_7handle_esc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_context = 0;
  CYTHON_UNUSED PyObject *__pyx_v_prefix = 0;
  CYTHON_UNUSED PyObject *__pyx_v_final = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_esc (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,&__pyx_n_s_prefix,&__pyx_n_s_final,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);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_esc", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_esc", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_final)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_esc", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_esc") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_context = values[1];
    __pyx_v_prefix = values[2];
    __pyx_v_final = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_esc", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.EventObserver.handle_esc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_13EventObserver_6handle_esc(__pyx_self, __pyx_v_self, __pyx_v_context, __pyx_v_prefix, __pyx_v_final);

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

static PyObject *__pyx_pf_4ctff_13EventObserver_6handle_esc(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_prefix, CYTHON_UNUSED PyObject *__pyx_v_final) {
  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("handle_esc", 0);

  /* "ctff.pyx":118
 * 
 *     def handle_esc(self, context, prefix, final):
 *         raise NotImplementedError("EventObserver::handle_esc")             # <<<<<<<<<<<<<<
 * 
 *     def handle_ss2(self, context, final):
 */
  __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":117
 *         raise NotImplementedError("EventObserver::handle_csi")
 * 
 *     def handle_esc(self, context, prefix, final):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_esc")
 * 
 */

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

/* "ctff.pyx":120
 *         raise NotImplementedError("EventObserver::handle_esc")
 * 
 *     def handle_ss2(self, context, final):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_ss2")
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_13EventObserver_9handle_ss2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_13EventObserver_9handle_ss2 = {__Pyx_NAMESTR("handle_ss2"), (PyCFunction)__pyx_pw_4ctff_13EventObserver_9handle_ss2, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_13EventObserver_9handle_ss2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_context = 0;
  CYTHON_UNUSED PyObject *__pyx_v_final = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_ss2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,&__pyx_n_s_final,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);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_ss2", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_final)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_ss2", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_ss2") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __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_context = values[1];
    __pyx_v_final = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_ss2", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.EventObserver.handle_ss2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_13EventObserver_8handle_ss2(__pyx_self, __pyx_v_self, __pyx_v_context, __pyx_v_final);

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

static PyObject *__pyx_pf_4ctff_13EventObserver_8handle_ss2(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_final) {
  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("handle_ss2", 0);

  /* "ctff.pyx":121
 * 
 *     def handle_ss2(self, context, final):
 *         raise NotImplementedError("EventObserver::handle_ss2")             # <<<<<<<<<<<<<<
 * 
 *     def handle_ss3(self, context, final):
 */
  __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":120
 *         raise NotImplementedError("EventObserver::handle_esc")
 * 
 *     def handle_ss2(self, context, final):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_ss2")
 * 
 */

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

/* "ctff.pyx":123
 *         raise NotImplementedError("EventObserver::handle_ss2")
 * 
 *     def handle_ss3(self, context, final):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_ss3")
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_13EventObserver_11handle_ss3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_13EventObserver_11handle_ss3 = {__Pyx_NAMESTR("handle_ss3"), (PyCFunction)__pyx_pw_4ctff_13EventObserver_11handle_ss3, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_13EventObserver_11handle_ss3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_context = 0;
  CYTHON_UNUSED PyObject *__pyx_v_final = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_ss3 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,&__pyx_n_s_final,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);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_ss3", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_final)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_ss3", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_ss3") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __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_context = values[1];
    __pyx_v_final = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_ss3", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.EventObserver.handle_ss3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_13EventObserver_10handle_ss3(__pyx_self, __pyx_v_self, __pyx_v_context, __pyx_v_final);

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

static PyObject *__pyx_pf_4ctff_13EventObserver_10handle_ss3(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_final) {
  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("handle_ss3", 0);

  /* "ctff.pyx":124
 * 
 *     def handle_ss3(self, context, final):
 *         raise NotImplementedError("EventObserver::handle_ss3")             # <<<<<<<<<<<<<<
 * 
 *     def handle_control_string(self, context, prefix, value):
 */
  __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":123
 *         raise NotImplementedError("EventObserver::handle_ss2")
 * 
 *     def handle_ss3(self, context, final):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_ss3")
 * 
 */

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

/* "ctff.pyx":126
 *         raise NotImplementedError("EventObserver::handle_ss3")
 * 
 *     def handle_control_string(self, context, prefix, value):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_control_string")
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_13EventObserver_13handle_control_string(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_13EventObserver_13handle_control_string = {__Pyx_NAMESTR("handle_control_string"), (PyCFunction)__pyx_pw_4ctff_13EventObserver_13handle_control_string, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_13EventObserver_13handle_control_string(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_context = 0;
  CYTHON_UNUSED PyObject *__pyx_v_prefix = 0;
  CYTHON_UNUSED 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("handle_control_string (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,&__pyx_n_s_prefix,&__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);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_control_string", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_control_string", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_control_string", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_control_string") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_context = values[1];
    __pyx_v_prefix = values[2];
    __pyx_v_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_control_string", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.EventObserver.handle_control_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_13EventObserver_12handle_control_string(__pyx_self, __pyx_v_self, __pyx_v_context, __pyx_v_prefix, __pyx_v_value);

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

static PyObject *__pyx_pf_4ctff_13EventObserver_12handle_control_string(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_prefix, CYTHON_UNUSED PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("handle_control_string", 0);

  /* "ctff.pyx":127
 * 
 *     def handle_control_string(self, context, prefix, value):
 *         raise NotImplementedError("EventObserver::handle_control_string")             # <<<<<<<<<<<<<<
 * 
 *     def handle_char(self, context, c):
 */
  __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":126
 *         raise NotImplementedError("EventObserver::handle_ss3")
 * 
 *     def handle_control_string(self, context, prefix, value):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_control_string")
 * 
 */

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

/* "ctff.pyx":129
 *         raise NotImplementedError("EventObserver::handle_control_string")
 * 
 *     def handle_char(self, context, c):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_char")
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_13EventObserver_15handle_char(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_13EventObserver_15handle_char = {__Pyx_NAMESTR("handle_char"), (PyCFunction)__pyx_pw_4ctff_13EventObserver_15handle_char, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_13EventObserver_15handle_char(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_context = 0;
  CYTHON_UNUSED PyObject *__pyx_v_c = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_char (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,&__pyx_n_s_c,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);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_char", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_c)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_char", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_char") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __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_context = values[1];
    __pyx_v_c = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_char", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.EventObserver.handle_char", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_13EventObserver_14handle_char(__pyx_self, __pyx_v_self, __pyx_v_context, __pyx_v_c);

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

static PyObject *__pyx_pf_4ctff_13EventObserver_14handle_char(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_c) {
  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("handle_char", 0);

  /* "ctff.pyx":130
 * 
 *     def handle_char(self, context, c):
 *         raise NotImplementedError("EventObserver::handle_char")             # <<<<<<<<<<<<<<
 * 
 *     def handle_invalid(self, context, seq):
 */
  __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":129
 *         raise NotImplementedError("EventObserver::handle_control_string")
 * 
 *     def handle_char(self, context, c):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_char")
 * 
 */

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

/* "ctff.pyx":132
 *         raise NotImplementedError("EventObserver::handle_char")
 * 
 *     def handle_invalid(self, context, seq):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_invalid")
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_13EventObserver_17handle_invalid(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_13EventObserver_17handle_invalid = {__Pyx_NAMESTR("handle_invalid"), (PyCFunction)__pyx_pw_4ctff_13EventObserver_17handle_invalid, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_13EventObserver_17handle_invalid(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_context = 0;
  CYTHON_UNUSED PyObject *__pyx_v_seq = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_invalid (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,&__pyx_n_s_seq,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);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_invalid", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_invalid", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_invalid") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __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_context = values[1];
    __pyx_v_seq = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_invalid", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.EventObserver.handle_invalid", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_13EventObserver_16handle_invalid(__pyx_self, __pyx_v_self, __pyx_v_context, __pyx_v_seq);

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

static PyObject *__pyx_pf_4ctff_13EventObserver_16handle_invalid(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_seq) {
  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("handle_invalid", 0);

  /* "ctff.pyx":133
 * 
 *     def handle_invalid(self, context, seq):
 *         raise NotImplementedError("EventObserver::handle_invalid")             # <<<<<<<<<<<<<<
 * 
 *     def handle_draw(self, context):
 */
  __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":132
 *         raise NotImplementedError("EventObserver::handle_char")
 * 
 *     def handle_invalid(self, context, seq):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_invalid")
 * 
 */

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

/* "ctff.pyx":135
 *         raise NotImplementedError("EventObserver::handle_invalid")
 * 
 *     def handle_draw(self, context):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_draw")
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_13EventObserver_19handle_draw(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_13EventObserver_19handle_draw = {__Pyx_NAMESTR("handle_draw"), (PyCFunction)__pyx_pw_4ctff_13EventObserver_19handle_draw, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_13EventObserver_19handle_draw(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_context = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_draw (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_draw", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_draw") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_context = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_draw", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.EventObserver.handle_draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_13EventObserver_18handle_draw(__pyx_self, __pyx_v_self, __pyx_v_context);

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

static PyObject *__pyx_pf_4ctff_13EventObserver_18handle_draw(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context) {
  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("handle_draw", 0);

  /* "ctff.pyx":136
 * 
 *     def handle_draw(self, context):
 *         raise NotImplementedError("EventObserver::handle_draw")             # <<<<<<<<<<<<<<
 * 
 *     def handle_resize(self, context, row, col):
 */
  __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":135
 *         raise NotImplementedError("EventObserver::handle_invalid")
 * 
 *     def handle_draw(self, context):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_draw")
 * 
 */

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

/* "ctff.pyx":138
 *         raise NotImplementedError("EventObserver::handle_draw")
 * 
 *     def handle_resize(self, context, row, col):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_resize")
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_13EventObserver_21handle_resize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_13EventObserver_21handle_resize = {__Pyx_NAMESTR("handle_resize"), (PyCFunction)__pyx_pw_4ctff_13EventObserver_21handle_resize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_13EventObserver_21handle_resize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_context = 0;
  CYTHON_UNUSED PyObject *__pyx_v_row = 0;
  CYTHON_UNUSED PyObject *__pyx_v_col = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_resize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,&__pyx_n_s_row,&__pyx_n_s_col,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);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_resize", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_resize", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_col)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_resize", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_resize") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_context = values[1];
    __pyx_v_row = values[2];
    __pyx_v_col = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_resize", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.EventObserver.handle_resize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_13EventObserver_20handle_resize(__pyx_self, __pyx_v_self, __pyx_v_context, __pyx_v_row, __pyx_v_col);

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

static PyObject *__pyx_pf_4ctff_13EventObserver_20handle_resize(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_row, CYTHON_UNUSED PyObject *__pyx_v_col) {
  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("handle_resize", 0);

  /* "ctff.pyx":139
 * 
 *     def handle_resize(self, context, row, col):
 *         raise NotImplementedError("EventObserver::handle_resize")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":138
 *         raise NotImplementedError("EventObserver::handle_draw")
 * 
 *     def handle_resize(self, context, row, col):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_resize")
 * 
 */

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

/* "ctff.pyx":146
 *     ''' forward input iterator '''
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("Scanner::__iter__")
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Scanner_1__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Scanner_1__iter__ = {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pw_4ctff_7Scanner_1__iter__, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Scanner_1__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_7Scanner___iter__(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "ctff.pyx":147
 * 
 *     def __iter__(self):
 *         raise NotImplementedError("Scanner::__iter__")             # <<<<<<<<<<<<<<
 * 
 *     # deprecated
 */
  __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":146
 *     ''' forward input iterator '''
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("Scanner::__iter__")
 * 
 */

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

/* "ctff.pyx":150
 * 
 *     # deprecated
 *     def assign(self, value, termenc):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("Scanner::assign")
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Scanner_3assign(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Scanner_3assign = {__Pyx_NAMESTR("assign"), (PyCFunction)__pyx_pw_4ctff_7Scanner_3assign, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Scanner_3assign(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_value = 0;
  CYTHON_UNUSED PyObject *__pyx_v_termenc = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assign (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,&__pyx_n_s_termenc,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);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("assign", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_termenc)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("assign", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "assign") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __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_value = values[1];
    __pyx_v_termenc = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("assign", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.Scanner.assign", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_7Scanner_2assign(__pyx_self, __pyx_v_self, __pyx_v_value, __pyx_v_termenc);

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

static PyObject *__pyx_pf_4ctff_7Scanner_2assign(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_termenc) {
  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("assign", 0);

  /* "ctff.pyx":151
 *     # deprecated
 *     def assign(self, value, termenc):
 *         raise NotImplementedError("Scanner::assign")             # <<<<<<<<<<<<<<
 * 
 *     def continuous_assign(self, value, termenc):
 */
  __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":150
 * 
 *     # deprecated
 *     def assign(self, value, termenc):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("Scanner::assign")
 * 
 */

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

/* "ctff.pyx":153
 *         raise NotImplementedError("Scanner::assign")
 * 
 *     def continuous_assign(self, value, termenc):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("Scanner::continuous_assign")
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Scanner_5continuous_assign(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Scanner_5continuous_assign = {__Pyx_NAMESTR("continuous_assign"), (PyCFunction)__pyx_pw_4ctff_7Scanner_5continuous_assign, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Scanner_5continuous_assign(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_value = 0;
  CYTHON_UNUSED PyObject *__pyx_v_termenc = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("continuous_assign (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,&__pyx_n_s_termenc,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);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("continuous_assign", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_termenc)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("continuous_assign", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "continuous_assign") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __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_value = values[1];
    __pyx_v_termenc = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("continuous_assign", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.Scanner.continuous_assign", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_7Scanner_4continuous_assign(__pyx_self, __pyx_v_self, __pyx_v_value, __pyx_v_termenc);

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

static PyObject *__pyx_pf_4ctff_7Scanner_4continuous_assign(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_termenc) {
  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("continuous_assign", 0);

  /* "ctff.pyx":154
 * 
 *     def continuous_assign(self, value, termenc):
 *         raise NotImplementedError("Scanner::continuous_assign")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":153
 *         raise NotImplementedError("Scanner::assign")
 * 
 *     def continuous_assign(self, value, termenc):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("Scanner::continuous_assign")
 * 
 */

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

/* "ctff.pyx":161
 *     ''' abstruct TTY output stream '''
 * 
 *     def write(self, c):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("OutputStream::write")
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_12OutputStream_1write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_12OutputStream_1write = {__Pyx_NAMESTR("write"), (PyCFunction)__pyx_pw_4ctff_12OutputStream_1write, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_12OutputStream_1write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_c = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_c,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_c)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("write", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_c = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.OutputStream.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_12OutputStream_write(__pyx_self, __pyx_v_self, __pyx_v_c);

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

static PyObject *__pyx_pf_4ctff_12OutputStream_write(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_c) {
  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("write", 0);

  /* "ctff.pyx":162
 * 
 *     def write(self, c):
 *         raise NotImplementedError("OutputStream::write")             # <<<<<<<<<<<<<<
 * 
 *     def flush(self):
 */
  __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":161
 *     ''' abstruct TTY output stream '''
 * 
 *     def write(self, c):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("OutputStream::write")
 * 
 */

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

/* "ctff.pyx":164
 *         raise NotImplementedError("OutputStream::write")
 * 
 *     def flush(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("OutputStream::flush")
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_12OutputStream_3flush(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_12OutputStream_3flush = {__Pyx_NAMESTR("flush"), (PyCFunction)__pyx_pw_4ctff_12OutputStream_3flush, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_12OutputStream_3flush(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flush (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_12OutputStream_2flush(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "ctff.pyx":165
 * 
 *     def flush(self):
 *         raise NotImplementedError("OutputStream::flush")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":164
 *         raise NotImplementedError("OutputStream::write")
 * 
 *     def flush(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("OutputStream::flush")
 * 
 */

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

/* "ctff.pyx":172
 *     ''' Dispatch interface of terminal sequence event oriented parser '''
 * 
 *     def dispatch_esc(self, prefix, final):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventDispatcher::dispatch_esc")
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_15EventDispatcher_1dispatch_esc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_15EventDispatcher_1dispatch_esc = {__Pyx_NAMESTR("dispatch_esc"), (PyCFunction)__pyx_pw_4ctff_15EventDispatcher_1dispatch_esc, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_15EventDispatcher_1dispatch_esc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_prefix = 0;
  CYTHON_UNUSED PyObject *__pyx_v_final = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dispatch_esc (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_prefix,&__pyx_n_s_final,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);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dispatch_esc", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_final)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dispatch_esc", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dispatch_esc") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __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_prefix = values[1];
    __pyx_v_final = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dispatch_esc", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.EventDispatcher.dispatch_esc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_15EventDispatcher_dispatch_esc(__pyx_self, __pyx_v_self, __pyx_v_prefix, __pyx_v_final);

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

static PyObject *__pyx_pf_4ctff_15EventDispatcher_dispatch_esc(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_prefix, CYTHON_UNUSED PyObject *__pyx_v_final) {
  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("dispatch_esc", 0);

  /* "ctff.pyx":173
 * 
 *     def dispatch_esc(self, prefix, final):
 *         raise NotImplementedError("EventDispatcher::dispatch_esc")             # <<<<<<<<<<<<<<
 * 
 *     def dispatch_csi(self, prefix, params, final):
 */
  __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":172
 *     ''' Dispatch interface of terminal sequence event oriented parser '''
 * 
 *     def dispatch_esc(self, prefix, final):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventDispatcher::dispatch_esc")
 * 
 */

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

/* "ctff.pyx":175
 *         raise NotImplementedError("EventDispatcher::dispatch_esc")
 * 
 *     def dispatch_csi(self, prefix, params, final):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventDispatcher::dispatch_csi")
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_15EventDispatcher_3dispatch_csi(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_15EventDispatcher_3dispatch_csi = {__Pyx_NAMESTR("dispatch_csi"), (PyCFunction)__pyx_pw_4ctff_15EventDispatcher_3dispatch_csi, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_15EventDispatcher_3dispatch_csi(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_prefix = 0;
  CYTHON_UNUSED PyObject *__pyx_v_params = 0;
  CYTHON_UNUSED PyObject *__pyx_v_final = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dispatch_csi (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_prefix,&__pyx_n_s_params,&__pyx_n_s_final,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);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dispatch_csi", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_params)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dispatch_csi", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_final)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dispatch_csi", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dispatch_csi") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_prefix = values[1];
    __pyx_v_params = values[2];
    __pyx_v_final = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dispatch_csi", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.EventDispatcher.dispatch_csi", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_15EventDispatcher_2dispatch_csi(__pyx_self, __pyx_v_self, __pyx_v_prefix, __pyx_v_params, __pyx_v_final);

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

static PyObject *__pyx_pf_4ctff_15EventDispatcher_2dispatch_csi(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_prefix, CYTHON_UNUSED PyObject *__pyx_v_params, CYTHON_UNUSED PyObject *__pyx_v_final) {
  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("dispatch_csi", 0);

  /* "ctff.pyx":176
 * 
 *     def dispatch_csi(self, prefix, params, final):
 *         raise NotImplementedError("EventDispatcher::dispatch_csi")             # <<<<<<<<<<<<<<
 * 
 *     def dispatch_control_string(self, prefix, value):
 */
  __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":175
 *         raise NotImplementedError("EventDispatcher::dispatch_esc")
 * 
 *     def dispatch_csi(self, prefix, params, final):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventDispatcher::dispatch_csi")
 * 
 */

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

/* "ctff.pyx":178
 *         raise NotImplementedError("EventDispatcher::dispatch_csi")
 * 
 *     def dispatch_control_string(self, prefix, value):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventDispatcher::dispatch_control_string")
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_15EventDispatcher_5dispatch_control_string(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_15EventDispatcher_5dispatch_control_string = {__Pyx_NAMESTR("dispatch_control_string"), (PyCFunction)__pyx_pw_4ctff_15EventDispatcher_5dispatch_control_string, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_15EventDispatcher_5dispatch_control_string(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_prefix = 0;
  CYTHON_UNUSED 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("dispatch_control_string (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_prefix,&__pyx_n_s_value,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dispatch_control_string", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dispatch_control_string", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dispatch_control_string") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __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_prefix = values[1];
    __pyx_v_value = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dispatch_control_string", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.EventDispatcher.dispatch_control_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_15EventDispatcher_4dispatch_control_string(__pyx_self, __pyx_v_self, __pyx_v_prefix, __pyx_v_value);

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

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

  /* "ctff.pyx":179
 * 
 *     def dispatch_control_string(self, prefix, value):
 *         raise NotImplementedError("EventDispatcher::dispatch_control_string")             # <<<<<<<<<<<<<<
 * 
 *     def dispatch_char(self, c):
 */
  __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":178
 *         raise NotImplementedError("EventDispatcher::dispatch_csi")
 * 
 *     def dispatch_control_string(self, prefix, value):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventDispatcher::dispatch_control_string")
 * 
 */

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

/* "ctff.pyx":181
 *         raise NotImplementedError("EventDispatcher::dispatch_control_string")
 * 
 *     def dispatch_char(self, c):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventDispatcher::dispatch_char")
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_15EventDispatcher_7dispatch_char(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_15EventDispatcher_7dispatch_char = {__Pyx_NAMESTR("dispatch_char"), (PyCFunction)__pyx_pw_4ctff_15EventDispatcher_7dispatch_char, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_15EventDispatcher_7dispatch_char(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_c = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dispatch_char (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_c,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_c)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dispatch_char", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dispatch_char") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_c = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dispatch_char", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.EventDispatcher.dispatch_char", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_15EventDispatcher_6dispatch_char(__pyx_self, __pyx_v_self, __pyx_v_c);

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

static PyObject *__pyx_pf_4ctff_15EventDispatcher_6dispatch_char(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_c) {
  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("dispatch_char", 0);

  /* "ctff.pyx":182
 * 
 *     def dispatch_char(self, c):
 *         raise NotImplementedError("EventDispatcher::dispatch_char")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":181
 *         raise NotImplementedError("EventDispatcher::dispatch_control_string")
 * 
 *     def dispatch_char(self, c):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventDispatcher::dispatch_char")
 * 
 */

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

/* "ctff.pyx":189
 *     ''' abstruct Parser '''
 * 
 *     def parse(self, context):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("Parser::parse")
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_6Parser_1parse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_6Parser_1parse = {__Pyx_NAMESTR("parse"), (PyCFunction)__pyx_pw_4ctff_6Parser_1parse, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_6Parser_1parse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_context = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("parse (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("parse", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "parse") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_context = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("parse", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_6Parser_parse(__pyx_self, __pyx_v_self, __pyx_v_context);

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

static PyObject *__pyx_pf_4ctff_6Parser_parse(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context) {
  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("parse", 0);

  /* "ctff.pyx":190
 * 
 *     def parse(self, context):
 *         raise NotImplementedError("Parser::parse")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":189
 *     ''' abstruct Parser '''
 * 
 *     def parse(self, context):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("Parser::parse")
 * 
 */

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

/* "ctff.pyx":197
 *     ''' abstruct PTY device '''
 * 
 *     def fitsize(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("PTY::fitsize")
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_3PTY_1fitsize(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_3PTY_1fitsize = {__Pyx_NAMESTR("fitsize"), (PyCFunction)__pyx_pw_4ctff_3PTY_1fitsize, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_3PTY_1fitsize(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fitsize (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_3PTY_fitsize(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "ctff.pyx":198
 * 
 *     def fitsize(self):
 *         raise NotImplementedError("PTY::fitsize")             # <<<<<<<<<<<<<<
 * 
 *     def resize(self, height, width):
 */
  __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":197
 *     ''' abstruct PTY device '''
 * 
 *     def fitsize(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("PTY::fitsize")
 * 
 */

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

/* "ctff.pyx":200
 *         raise NotImplementedError("PTY::fitsize")
 * 
 *     def resize(self, height, width):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("PTY::resize")
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_3PTY_3resize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_3PTY_3resize = {__Pyx_NAMESTR("resize"), (PyCFunction)__pyx_pw_4ctff_3PTY_3resize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_3PTY_3resize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_height = 0;
  CYTHON_UNUSED PyObject *__pyx_v_width = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("resize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_height,&__pyx_n_s_width,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);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_height)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("resize", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("resize", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "resize") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __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_height = values[1];
    __pyx_v_width = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("resize", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.PTY.resize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_3PTY_2resize(__pyx_self, __pyx_v_self, __pyx_v_height, __pyx_v_width);

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

static PyObject *__pyx_pf_4ctff_3PTY_2resize(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_height, CYTHON_UNUSED PyObject *__pyx_v_width) {
  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("resize", 0);

  /* "ctff.pyx":201
 * 
 *     def resize(self, height, width):
 *         raise NotImplementedError("PTY::resize")             # <<<<<<<<<<<<<<
 * 
 *     def read(self):
 */
  __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":200
 *         raise NotImplementedError("PTY::fitsize")
 * 
 *     def resize(self, height, width):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("PTY::resize")
 * 
 */

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

/* "ctff.pyx":203
 *         raise NotImplementedError("PTY::resize")
 * 
 *     def read(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("PTY::read")
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_3PTY_5read(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_3PTY_5read = {__Pyx_NAMESTR("read"), (PyCFunction)__pyx_pw_4ctff_3PTY_5read, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_3PTY_5read(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_3PTY_4read(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "ctff.pyx":204
 * 
 *     def read(self):
 *         raise NotImplementedError("PTY::read")             # <<<<<<<<<<<<<<
 * 
 *     def write(self, data):
 */
  __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":203
 *         raise NotImplementedError("PTY::resize")
 * 
 *     def read(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("PTY::read")
 * 
 */

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

/* "ctff.pyx":206
 *         raise NotImplementedError("PTY::read")
 * 
 *     def write(self, data):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("PTY::write")
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_3PTY_7write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_3PTY_7write = {__Pyx_NAMESTR("write"), (PyCFunction)__pyx_pw_4ctff_3PTY_7write, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_3PTY_7write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_data = 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_self,&__pyx_n_s_data,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("write", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_data = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.PTY.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_3PTY_6write(__pyx_self, __pyx_v_self, __pyx_v_data);

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

static PyObject *__pyx_pf_4ctff_3PTY_6write(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_data) {
  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("write", 0);

  /* "ctff.pyx":207
 * 
 *     def write(self, data):
 *         raise NotImplementedError("PTY::write")             # <<<<<<<<<<<<<<
 * 
 *     def xon(self):
 */
  __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":206
 *         raise NotImplementedError("PTY::read")
 * 
 *     def write(self, data):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("PTY::write")
 * 
 */

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

/* "ctff.pyx":209
 *         raise NotImplementedError("PTY::write")
 * 
 *     def xon(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("PTY::xon")
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_3PTY_9xon(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_3PTY_9xon = {__Pyx_NAMESTR("xon"), (PyCFunction)__pyx_pw_4ctff_3PTY_9xon, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_3PTY_9xon(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xon (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_3PTY_8xon(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "ctff.pyx":210
 * 
 *     def xon(self):
 *         raise NotImplementedError("PTY::xon")             # <<<<<<<<<<<<<<
 * 
 *     def xoff(self):
 */
  __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":209
 *         raise NotImplementedError("PTY::write")
 * 
 *     def xon(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("PTY::xon")
 * 
 */

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

/* "ctff.pyx":212
 *         raise NotImplementedError("PTY::xon")
 * 
 *     def xoff(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("PTY::xoff")
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_3PTY_11xoff(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_3PTY_11xoff = {__Pyx_NAMESTR("xoff"), (PyCFunction)__pyx_pw_4ctff_3PTY_11xoff, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_3PTY_11xoff(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xoff (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_3PTY_10xoff(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "ctff.pyx":213
 * 
 *     def xoff(self):
 *         raise NotImplementedError("PTY::xoff")             # <<<<<<<<<<<<<<
 * 
 *     def drive(self):
 */
  __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":212
 *         raise NotImplementedError("PTY::xon")
 * 
 *     def xoff(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("PTY::xoff")
 * 
 */

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

/* "ctff.pyx":215
 *         raise NotImplementedError("PTY::xoff")
 * 
 *     def drive(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("PTY::drive")
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_3PTY_13drive(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_3PTY_13drive = {__Pyx_NAMESTR("drive"), (PyCFunction)__pyx_pw_4ctff_3PTY_13drive, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_3PTY_13drive(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("drive (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_3PTY_12drive(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "ctff.pyx":216
 * 
 *     def drive(self):
 *         raise NotImplementedError("PTY::drive")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":215
 *         raise NotImplementedError("PTY::xoff")
 * 
 *     def drive(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("PTY::drive")
 * 
 */

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

/* "ctff.pyx":229
 *     class _MockContext:
 * 
 *         def __init__(self):             # <<<<<<<<<<<<<<
 *             self.output = []
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_12_MockContext_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_12_MockContext_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_4ctff_12_MockContext_1__init__, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_12_MockContext_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_12_MockContext___init__(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "ctff.pyx":230
 * 
 *         def __init__(self):
 *             self.output = []             # <<<<<<<<<<<<<<
 * 
 *         def __iter__(self):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_output, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":229
 *     class _MockContext:
 * 
 *         def __init__(self):             # <<<<<<<<<<<<<<
 *             self.output = []
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("ctff._MockContext.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_4ctff_12_MockContext_4generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "ctff.pyx":232
 *             self.output = []
 * 
 *         def __iter__(self):             # <<<<<<<<<<<<<<
 *             for i in [1, 2, 3, 4, 5]:
 *                 yield i
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_12_MockContext_3__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_12_MockContext_3__iter__ = {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pw_4ctff_12_MockContext_3__iter__, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_12_MockContext_3__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_12_MockContext_2__iter__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ctff_12_MockContext_2__iter__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) {
  struct __pyx_obj_4ctff___pyx_scope_struct____iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ctff___pyx_scope_struct____iter__ *)__pyx_tp_new_4ctff___pyx_scope_struct____iter__(__pyx_ptype_4ctff___pyx_scope_struct____iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4ctff_12_MockContext_4generator, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("ctff._MockContext.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ctff_12_MockContext_4generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ctff___pyx_scope_struct____iter__ *__pyx_cur_scope = ((struct __pyx_obj_4ctff___pyx_scope_struct____iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  long __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":233
 * 
 *         def __iter__(self):
 *             for i in [1, 2, 3, 4, 5]:             # <<<<<<<<<<<<<<
 *                 yield i
 * 
 */
  __pyx_t_1 = __pyx_tuple__29; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= 5) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #endif
    __pyx_t_4 = __Pyx_PyInt_As_long(__pyx_t_3); if (unlikely((__pyx_t_4 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_cur_scope->__pyx_v_i = __pyx_t_4;

    /* "ctff.pyx":234
 *         def __iter__(self):
 *             for i in [1, 2, 3, 4, 5]:
 *                 yield i             # <<<<<<<<<<<<<<
 * 
 *         def dispatch_char(self, c):
 */
    __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":232
 *             self.output = []
 * 
 *         def __iter__(self):             # <<<<<<<<<<<<<<
 *             for i in [1, 2, 3, 4, 5]:
 *                 yield i
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* "ctff.pyx":236
 *                 yield i
 * 
 *         def dispatch_char(self, c):             # <<<<<<<<<<<<<<
 *             self.output.append(c)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_12_MockContext_6dispatch_char(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_12_MockContext_6dispatch_char = {__Pyx_NAMESTR("dispatch_char"), (PyCFunction)__pyx_pw_4ctff_12_MockContext_6dispatch_char, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_12_MockContext_6dispatch_char(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_c = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dispatch_char (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_c,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_c)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dispatch_char", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dispatch_char") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_c = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dispatch_char", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff._MockContext.dispatch_char", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_12_MockContext_5dispatch_char(__pyx_self, __pyx_v_self, __pyx_v_c);

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

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

  /* "ctff.pyx":237
 * 
 *         def dispatch_char(self, c):
 *             self.output.append(c)             # <<<<<<<<<<<<<<
 * 
 *     def parse(self, context):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_v_c); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":236
 *                 yield i
 * 
 *         def dispatch_char(self, c):             # <<<<<<<<<<<<<<
 *             self.output.append(c)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("ctff._MockContext.dispatch_char", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":239
 *             self.output.append(c)
 * 
 *     def parse(self, context):             # <<<<<<<<<<<<<<
 *         """
 *         >>> parser = SimpleParser()
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_12SimpleParser_1parse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4ctff_12SimpleParser_parse[] = "\n        >>> parser = SimpleParser()\n        >>> context = SimpleParser._MockContext()\n        >>> parser.parse(context)\n        >>> context.output\n        [1, 2, 3, 4, 5]\n        ";
static PyMethodDef __pyx_mdef_4ctff_12SimpleParser_1parse = {__Pyx_NAMESTR("parse"), (PyCFunction)__pyx_pw_4ctff_12SimpleParser_1parse, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4ctff_12SimpleParser_parse)};
static PyObject *__pyx_pw_4ctff_12SimpleParser_1parse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_context = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("parse (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("parse", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "parse") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_context = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("parse", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.SimpleParser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_12SimpleParser_parse(__pyx_self, __pyx_v_self, __pyx_v_context);

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

static PyObject *__pyx_pf_4ctff_12SimpleParser_parse(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_context) {
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  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("parse", 0);

  /* "ctff.pyx":247
 *         [1, 2, 3, 4, 5]
 *         """
 *         for c in context:             # <<<<<<<<<<<<<<
 *             context.dispatch_char(c)
 * 
 */
  if (PyList_CheckExact(__pyx_v_context) || PyTuple_CheckExact(__pyx_v_context)) {
    __pyx_t_1 = __pyx_v_context; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "ctff.pyx":248
 *         """
 *         for c in context:
 *             context.dispatch_char(c)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_char); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_c);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_c);
    __Pyx_GIVEREF(__pyx_v_c);
    __pyx_t_6 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":239
 *             self.output.append(c)
 * 
 *     def parse(self, context):             # <<<<<<<<<<<<<<
 *         """
 *         >>> parser = SimpleParser()
 */

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

/* "ctff.pyx":270
 * class _MockHandler:
 * 
 *     def handle_csi(self, context, parameter, intermediate, final):             # <<<<<<<<<<<<<<
 *         print (parameter, intermediate, final)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_12_MockHandler_1handle_csi(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_12_MockHandler_1handle_csi = {__Pyx_NAMESTR("handle_csi"), (PyCFunction)__pyx_pw_4ctff_12_MockHandler_1handle_csi, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_12_MockHandler_1handle_csi(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_context = 0;
  PyObject *__pyx_v_parameter = 0;
  PyObject *__pyx_v_intermediate = 0;
  PyObject *__pyx_v_final = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_csi (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,&__pyx_n_s_parameter,&__pyx_n_s_intermediate,&__pyx_n_s_final,0};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_csi", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parameter)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_csi", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_intermediate)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_csi", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_final)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_csi", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_csi") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_self = values[0];
    __pyx_v_context = values[1];
    __pyx_v_parameter = values[2];
    __pyx_v_intermediate = values[3];
    __pyx_v_final = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_csi", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff._MockHandler.handle_csi", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_12_MockHandler_handle_csi(__pyx_self, __pyx_v_self, __pyx_v_context, __pyx_v_parameter, __pyx_v_intermediate, __pyx_v_final);

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

static PyObject *__pyx_pf_4ctff_12_MockHandler_handle_csi(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, PyObject *__pyx_v_parameter, PyObject *__pyx_v_intermediate, PyObject *__pyx_v_final) {
  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("handle_csi", 0);

  /* "ctff.pyx":271
 * 
 *     def handle_csi(self, context, parameter, intermediate, final):
 *         print (parameter, intermediate, final)             # <<<<<<<<<<<<<<
 * 
 *     def handle_esc(self, context, intermediate, final):
 */
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_parameter);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_parameter);
  __Pyx_GIVEREF(__pyx_v_parameter);
  __Pyx_INCREF(__pyx_v_intermediate);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_intermediate);
  __Pyx_GIVEREF(__pyx_v_intermediate);
  __Pyx_INCREF(__pyx_v_final);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_final);
  __Pyx_GIVEREF(__pyx_v_final);
  if (__Pyx_PrintOne(0, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":270
 * class _MockHandler:
 * 
 *     def handle_csi(self, context, parameter, intermediate, final):             # <<<<<<<<<<<<<<
 *         print (parameter, intermediate, final)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("ctff._MockHandler.handle_csi", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":273
 *         print (parameter, intermediate, final)
 * 
 *     def handle_esc(self, context, intermediate, final):             # <<<<<<<<<<<<<<
 *         print (intermediate, final)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_12_MockHandler_3handle_esc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_12_MockHandler_3handle_esc = {__Pyx_NAMESTR("handle_esc"), (PyCFunction)__pyx_pw_4ctff_12_MockHandler_3handle_esc, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_12_MockHandler_3handle_esc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_context = 0;
  PyObject *__pyx_v_intermediate = 0;
  PyObject *__pyx_v_final = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_esc (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,&__pyx_n_s_intermediate,&__pyx_n_s_final,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);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_esc", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_intermediate)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_esc", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_final)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_esc", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_esc") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_context = values[1];
    __pyx_v_intermediate = values[2];
    __pyx_v_final = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_esc", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff._MockHandler.handle_esc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_12_MockHandler_2handle_esc(__pyx_self, __pyx_v_self, __pyx_v_context, __pyx_v_intermediate, __pyx_v_final);

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

static PyObject *__pyx_pf_4ctff_12_MockHandler_2handle_esc(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, PyObject *__pyx_v_intermediate, PyObject *__pyx_v_final) {
  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("handle_esc", 0);

  /* "ctff.pyx":274
 * 
 *     def handle_esc(self, context, intermediate, final):
 *         print (intermediate, final)             # <<<<<<<<<<<<<<
 * 
 *     def handle_control_string(self, context, prefix, value):
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_intermediate);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_intermediate);
  __Pyx_GIVEREF(__pyx_v_intermediate);
  __Pyx_INCREF(__pyx_v_final);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_final);
  __Pyx_GIVEREF(__pyx_v_final);
  if (__Pyx_PrintOne(0, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":273
 *         print (parameter, intermediate, final)
 * 
 *     def handle_esc(self, context, intermediate, final):             # <<<<<<<<<<<<<<
 *         print (intermediate, final)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("ctff._MockHandler.handle_esc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":276
 *         print (intermediate, final)
 * 
 *     def handle_control_string(self, context, prefix, value):             # <<<<<<<<<<<<<<
 *         print (prefix, value)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_12_MockHandler_5handle_control_string(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_12_MockHandler_5handle_control_string = {__Pyx_NAMESTR("handle_control_string"), (PyCFunction)__pyx_pw_4ctff_12_MockHandler_5handle_control_string, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_12_MockHandler_5handle_control_string(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_context = 0;
  PyObject *__pyx_v_prefix = 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("handle_control_string (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,&__pyx_n_s_prefix,&__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);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_control_string", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_control_string", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_control_string", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_control_string") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_context = values[1];
    __pyx_v_prefix = values[2];
    __pyx_v_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_control_string", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff._MockHandler.handle_control_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_12_MockHandler_4handle_control_string(__pyx_self, __pyx_v_self, __pyx_v_context, __pyx_v_prefix, __pyx_v_value);

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

static PyObject *__pyx_pf_4ctff_12_MockHandler_4handle_control_string(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, PyObject *__pyx_v_prefix, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("handle_control_string", 0);

  /* "ctff.pyx":277
 * 
 *     def handle_control_string(self, context, prefix, value):
 *         print (prefix, value)             # <<<<<<<<<<<<<<
 * 
 *     def handle_char(self, context, c):
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_prefix);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_prefix);
  __Pyx_GIVEREF(__pyx_v_prefix);
  __Pyx_INCREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  if (__Pyx_PrintOne(0, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":276
 *         print (intermediate, final)
 * 
 *     def handle_control_string(self, context, prefix, value):             # <<<<<<<<<<<<<<
 *         print (prefix, value)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("ctff._MockHandler.handle_control_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":279
 *         print (prefix, value)
 * 
 *     def handle_char(self, context, c):             # <<<<<<<<<<<<<<
 *         print (c)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_12_MockHandler_7handle_char(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_12_MockHandler_7handle_char = {__Pyx_NAMESTR("handle_char"), (PyCFunction)__pyx_pw_4ctff_12_MockHandler_7handle_char, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_12_MockHandler_7handle_char(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_context = 0;
  PyObject *__pyx_v_c = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_char (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,&__pyx_n_s_c,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);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_char", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_c)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_char", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_char") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __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_context = values[1];
    __pyx_v_c = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_char", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff._MockHandler.handle_char", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_12_MockHandler_6handle_char(__pyx_self, __pyx_v_self, __pyx_v_context, __pyx_v_c);

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

static PyObject *__pyx_pf_4ctff_12_MockHandler_6handle_char(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, PyObject *__pyx_v_c) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("handle_char", 0);

  /* "ctff.pyx":280
 * 
 *     def handle_char(self, context, c):
 *         print (c)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (__Pyx_PrintOne(0, __pyx_v_c) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":279
 *         print (prefix, value)
 * 
 *     def handle_char(self, context, c):             # <<<<<<<<<<<<<<
 *         print (c)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("ctff._MockHandler.handle_char", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":287
 *     ''' parse ESC/CSI/string seqneces '''
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.reset()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_13DefaultParser_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_13DefaultParser_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_4ctff_13DefaultParser_1__init__, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_13DefaultParser_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_13DefaultParser___init__(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "ctff.pyx":288
 * 
 *     def __init__(self):
 *         self.reset()             # <<<<<<<<<<<<<<
 * 
 *     def init(self, context):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":287
 *     ''' parse ESC/CSI/string seqneces '''
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.reset()
 * 
 */

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

/* "ctff.pyx":290
 *         self.reset()
 * 
 *     def init(self, context):             # <<<<<<<<<<<<<<
 *         self.__context = context
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_13DefaultParser_3init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_13DefaultParser_3init = {__Pyx_NAMESTR("init"), (PyCFunction)__pyx_pw_4ctff_13DefaultParser_3init, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_13DefaultParser_3init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_context = 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_context,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_context = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("init", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.DefaultParser.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_13DefaultParser_2init(__pyx_self, __pyx_v_self, __pyx_v_context);

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

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

  /* "ctff.pyx":291
 * 
 *     def init(self, context):
 *         self.__context = context             # <<<<<<<<<<<<<<
 * 
 *     def state_is_esc(self):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_DefaultParser__context, __pyx_v_context) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":290
 *         self.reset()
 * 
 *     def init(self, context):             # <<<<<<<<<<<<<<
 *         self.__context = context
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("ctff.DefaultParser.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":293
 *         self.__context = context
 * 
 *     def state_is_esc(self):             # <<<<<<<<<<<<<<
 *         return self.__state != _STATE_GROUND
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_13DefaultParser_5state_is_esc(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_13DefaultParser_5state_is_esc = {__Pyx_NAMESTR("state_is_esc"), (PyCFunction)__pyx_pw_4ctff_13DefaultParser_5state_is_esc, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_13DefaultParser_5state_is_esc(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("state_is_esc (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_13DefaultParser_4state_is_esc(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "ctff.pyx":294
 * 
 *     def state_is_esc(self):
 *         return self.__state != _STATE_GROUND             # <<<<<<<<<<<<<<
 * 
 *     def flush(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_DefaultParser__state); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_GROUND); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "ctff.pyx":293
 *         self.__context = context
 * 
 *     def state_is_esc(self):             # <<<<<<<<<<<<<<
 *         return self.__state != _STATE_GROUND
 * 
 */

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

/* "ctff.pyx":296
 *         return self.__state != _STATE_GROUND
 * 
 *     def flush(self):             # <<<<<<<<<<<<<<
 *         pbytes = self.__pbytes
 *         ibytes = self.__ibytes
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_13DefaultParser_7flush(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_13DefaultParser_7flush = {__Pyx_NAMESTR("flush"), (PyCFunction)__pyx_pw_4ctff_13DefaultParser_7flush, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_13DefaultParser_7flush(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flush (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_13DefaultParser_6flush(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ctff_13DefaultParser_6flush(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_pbytes = NULL;
  PyObject *__pyx_v_ibytes = NULL;
  PyObject *__pyx_v_state = NULL;
  PyObject *__pyx_v_context = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("flush", 0);

  /* "ctff.pyx":297
 * 
 *     def flush(self):
 *         pbytes = self.__pbytes             # <<<<<<<<<<<<<<
 *         ibytes = self.__ibytes
 *         state = self.__state
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_DefaultParser__pbytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_pbytes = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ctff.pyx":298
 *     def flush(self):
 *         pbytes = self.__pbytes
 *         ibytes = self.__ibytes             # <<<<<<<<<<<<<<
 *         state = self.__state
 *         context = self.__context
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_DefaultParser__ibytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ibytes = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ctff.pyx":299
 *         pbytes = self.__pbytes
 *         ibytes = self.__ibytes
 *         state = self.__state             # <<<<<<<<<<<<<<
 *         context = self.__context
 *         if state == _STATE_ESC:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_DefaultParser__state); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_state = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ctff.pyx":300
 *         ibytes = self.__ibytes
 *         state = self.__state
 *         context = self.__context             # <<<<<<<<<<<<<<
 *         if state == _STATE_ESC:
 *             context.dispatch_char(0x1b)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_DefaultParser__context); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ctff.pyx":301
 *         state = self.__state
 *         context = self.__context
 *         if state == _STATE_ESC:             # <<<<<<<<<<<<<<
 *             context.dispatch_char(0x1b)
 *         elif state == _STATE_ESC_INTERMEDIATE:
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_ESC); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_state, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "ctff.pyx":302
 *         context = self.__context
 *         if state == _STATE_ESC:
 *             context.dispatch_char(0x1b)             # <<<<<<<<<<<<<<
 *         elif state == _STATE_ESC_INTERMEDIATE:
 *             context.dispatch_invalid([0x1b] + ibytes)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_char); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L3;
  }

  /* "ctff.pyx":303
 *         if state == _STATE_ESC:
 *             context.dispatch_char(0x1b)
 *         elif state == _STATE_ESC_INTERMEDIATE:             # <<<<<<<<<<<<<<
 *             context.dispatch_invalid([0x1b] + ibytes)
 *         elif state == _STATE_CSI_INTERMEDIATE:
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_ESC_INTERMEDIATE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_state, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "ctff.pyx":304
 *             context.dispatch_char(0x1b)
 *         elif state == _STATE_ESC_INTERMEDIATE:
 *             context.dispatch_invalid([0x1b] + ibytes)             # <<<<<<<<<<<<<<
 *         elif state == _STATE_CSI_INTERMEDIATE:
 *             context.dispatch_invalid([0x1b, 0x5b] + ibytes)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_invalid); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_int_27);
    PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_27);
    __Pyx_GIVEREF(__pyx_int_27);
    __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_v_ibytes); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L3;
  }

  /* "ctff.pyx":305
 *         elif state == _STATE_ESC_INTERMEDIATE:
 *             context.dispatch_invalid([0x1b] + ibytes)
 *         elif state == _STATE_CSI_INTERMEDIATE:             # <<<<<<<<<<<<<<
 *             context.dispatch_invalid([0x1b, 0x5b] + ibytes)
 *         elif state == _STATE_CSI_PARAMETER:
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_CSI_INTERMEDIATE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_state, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "ctff.pyx":306
 *             context.dispatch_invalid([0x1b] + ibytes)
 *         elif state == _STATE_CSI_INTERMEDIATE:
 *             context.dispatch_invalid([0x1b, 0x5b] + ibytes)             # <<<<<<<<<<<<<<
 *         elif state == _STATE_CSI_PARAMETER:
 *             context.dispatch_invalid([0x1b, 0x5b] + ibytes + pbytes)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_invalid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_int_27);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_int_27);
    __Pyx_GIVEREF(__pyx_int_27);
    __Pyx_INCREF(__pyx_int_91);
    PyList_SET_ITEM(__pyx_t_4, 1, __pyx_int_91);
    __Pyx_GIVEREF(__pyx_int_91);
    __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_v_ibytes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3;
  }

  /* "ctff.pyx":307
 *         elif state == _STATE_CSI_INTERMEDIATE:
 *             context.dispatch_invalid([0x1b, 0x5b] + ibytes)
 *         elif state == _STATE_CSI_PARAMETER:             # <<<<<<<<<<<<<<
 *             context.dispatch_invalid([0x1b, 0x5b] + ibytes + pbytes)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_CSI_PARAMETER); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_state, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_3) {

    /* "ctff.pyx":308
 *             context.dispatch_invalid([0x1b, 0x5b] + ibytes)
 *         elif state == _STATE_CSI_PARAMETER:
 *             context.dispatch_invalid([0x1b, 0x5b] + ibytes + pbytes)             # <<<<<<<<<<<<<<
 * 
 *     def reset(self):
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_invalid); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_int_27);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_27);
    __Pyx_GIVEREF(__pyx_int_27);
    __Pyx_INCREF(__pyx_int_91);
    PyList_SET_ITEM(__pyx_t_2, 1, __pyx_int_91);
    __Pyx_GIVEREF(__pyx_int_91);
    __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_ibytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_pbytes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "ctff.pyx":296
 *         return self.__state != _STATE_GROUND
 * 
 *     def flush(self):             # <<<<<<<<<<<<<<
 *         pbytes = self.__pbytes
 *         ibytes = self.__ibytes
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("ctff.DefaultParser.flush", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pbytes);
  __Pyx_XDECREF(__pyx_v_ibytes);
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v_context);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":310
 *             context.dispatch_invalid([0x1b, 0x5b] + ibytes + pbytes)
 * 
 *     def reset(self):             # <<<<<<<<<<<<<<
 *         self.__state = _STATE_GROUND
 *         self.__pbytes = []
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_13DefaultParser_9reset(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_13DefaultParser_9reset = {__Pyx_NAMESTR("reset"), (PyCFunction)__pyx_pw_4ctff_13DefaultParser_9reset, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_13DefaultParser_9reset(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_13DefaultParser_8reset(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "ctff.pyx":311
 * 
 *     def reset(self):
 *         self.__state = _STATE_GROUND             # <<<<<<<<<<<<<<
 *         self.__pbytes = []
 *         self.__ibytes = []
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_GROUND); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_DefaultParser__state, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":312
 *     def reset(self):
 *         self.__state = _STATE_GROUND
 *         self.__pbytes = []             # <<<<<<<<<<<<<<
 *         self.__ibytes = []
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_DefaultParser__pbytes, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":313
 *         self.__state = _STATE_GROUND
 *         self.__pbytes = []
 *         self.__ibytes = []             # <<<<<<<<<<<<<<
 * 
 *     def parse(self, data):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_DefaultParser__ibytes, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":310
 *             context.dispatch_invalid([0x1b, 0x5b] + ibytes + pbytes)
 * 
 *     def reset(self):             # <<<<<<<<<<<<<<
 *         self.__state = _STATE_GROUND
 *         self.__pbytes = []
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("ctff.DefaultParser.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":315
 *         self.__ibytes = []
 * 
 *     def parse(self, data):             # <<<<<<<<<<<<<<
 * 
 *         context = self.__context
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_13DefaultParser_11parse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_13DefaultParser_11parse = {__Pyx_NAMESTR("parse"), (PyCFunction)__pyx_pw_4ctff_13DefaultParser_11parse, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_13DefaultParser_11parse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_data = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("parse (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("parse", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "parse") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_data = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("parse", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.DefaultParser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_13DefaultParser_10parse(__pyx_self, __pyx_v_self, __pyx_v_data);

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

static PyObject *__pyx_pf_4ctff_13DefaultParser_10parse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_v_context = NULL;
  PyObject *__pyx_v_pbytes = NULL;
  PyObject *__pyx_v_ibytes = NULL;
  PyObject *__pyx_v_state = NULL;
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_v_seq = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parse", 0);

  /* "ctff.pyx":317
 *     def parse(self, data):
 * 
 *         context = self.__context             # <<<<<<<<<<<<<<
 *         context.assign(data)
 *         pbytes = self.__pbytes
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_DefaultParser__context); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ctff.pyx":318
 * 
 *         context = self.__context
 *         context.assign(data)             # <<<<<<<<<<<<<<
 *         pbytes = self.__pbytes
 *         ibytes = self.__ibytes
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_assign); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_data);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data);
  __Pyx_GIVEREF(__pyx_v_data);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ctff.pyx":319
 *         context = self.__context
 *         context.assign(data)
 *         pbytes = self.__pbytes             # <<<<<<<<<<<<<<
 *         ibytes = self.__ibytes
 *         state = self.__state
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_DefaultParser__pbytes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_pbytes = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ctff.pyx":320
 *         context.assign(data)
 *         pbytes = self.__pbytes
 *         ibytes = self.__ibytes             # <<<<<<<<<<<<<<
 *         state = self.__state
 *         for c in context:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_DefaultParser__ibytes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_ibytes = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ctff.pyx":321
 *         pbytes = self.__pbytes
 *         ibytes = self.__ibytes
 *         state = self.__state             # <<<<<<<<<<<<<<
 *         for c in context:
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_DefaultParser__state); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_state = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ctff.pyx":322
 *         ibytes = self.__ibytes
 *         state = self.__state
 *         for c in context:             # <<<<<<<<<<<<<<
 * 
 *             if state == _STATE_GROUND:
 */
  if (PyList_CheckExact(__pyx_v_context) || PyTuple_CheckExact(__pyx_v_context)) {
    __pyx_t_3 = __pyx_v_context; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "ctff.pyx":324
 *         for c in context:
 * 
 *             if state == _STATE_GROUND:             # <<<<<<<<<<<<<<
 *                 if c == 0x1b:  # ESC
 *                     ibytes = []
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_GROUND); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_state, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_6) {

      /* "ctff.pyx":325
 * 
 *             if state == _STATE_GROUND:
 *                 if c == 0x1b:  # ESC             # <<<<<<<<<<<<<<
 *                     ibytes = []
 *                     state = _STATE_ESC
 */
      __pyx_t_1 = PyObject_RichCompare(__pyx_v_c, __pyx_int_27, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_6) {

        /* "ctff.pyx":326
 *             if state == _STATE_GROUND:
 *                 if c == 0x1b:  # ESC
 *                     ibytes = []             # <<<<<<<<<<<<<<
 *                     state = _STATE_ESC
 * 
 */
        __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_ibytes, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "ctff.pyx":327
 *                 if c == 0x1b:  # ESC
 *                     ibytes = []
 *                     state = _STATE_ESC             # <<<<<<<<<<<<<<
 * 
 *                 else:  # control character
 */
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_ESC); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_1);
        __pyx_t_1 = 0;
        goto __pyx_L6;
      }
      /*else*/ {

        /* "ctff.pyx":330
 * 
 *                 else:  # control character
 *                     context.dispatch_char(c)             # <<<<<<<<<<<<<<
 * 
 *             elif state == _STATE_ESC:
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_char); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_c);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_c);
        __Pyx_GIVEREF(__pyx_v_c);
        __pyx_t_7 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __pyx_L6:;
      goto __pyx_L5;
    }

    /* "ctff.pyx":332
 *                     context.dispatch_char(c)
 * 
 *             elif state == _STATE_ESC:             # <<<<<<<<<<<<<<
 *                 #
 *                 # - ISO-6429 independent escape sequense
 */
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_ESC); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_state, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_6) {

      /* "ctff.pyx":342
 *                 #     ESC I ... I F
 *                 #
 *                 if c == 0x5b:  # [             # <<<<<<<<<<<<<<
 *                     pbytes = []
 *                     state = _STATE_CSI_PARAMETER
 */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_c, __pyx_int_91, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_6) {

        /* "ctff.pyx":343
 *                 #
 *                 if c == 0x5b:  # [
 *                     pbytes = []             # <<<<<<<<<<<<<<
 *                     state = _STATE_CSI_PARAMETER
 *                 elif c == 0x5d:  # ]
 */
        __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF_SET(__pyx_v_pbytes, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "ctff.pyx":344
 *                 if c == 0x5b:  # [
 *                     pbytes = []
 *                     state = _STATE_CSI_PARAMETER             # <<<<<<<<<<<<<<
 *                 elif c == 0x5d:  # ]
 *                     pbytes = [c]
 */
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_CSI_PARAMETER); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2);
        __pyx_t_2 = 0;
        goto __pyx_L7;
      }

      /* "ctff.pyx":345
 *                     pbytes = []
 *                     state = _STATE_CSI_PARAMETER
 *                 elif c == 0x5d:  # ]             # <<<<<<<<<<<<<<
 *                     pbytes = [c]
 *                     state = _STATE_OSC
 */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_c, __pyx_int_93, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_6) {

        /* "ctff.pyx":346
 *                     state = _STATE_CSI_PARAMETER
 *                 elif c == 0x5d:  # ]
 *                     pbytes = [c]             # <<<<<<<<<<<<<<
 *                     state = _STATE_OSC
 *                 elif c == 0x4e:  # N
 */
        __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_c);
        PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_c);
        __Pyx_GIVEREF(__pyx_v_c);
        __Pyx_DECREF_SET(__pyx_v_pbytes, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "ctff.pyx":347
 *                 elif c == 0x5d:  # ]
 *                     pbytes = [c]
 *                     state = _STATE_OSC             # <<<<<<<<<<<<<<
 *                 elif c == 0x4e:  # N
 *                     state = _STATE_SS2
 */
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_OSC); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2);
        __pyx_t_2 = 0;
        goto __pyx_L7;
      }

      /* "ctff.pyx":348
 *                     pbytes = [c]
 *                     state = _STATE_OSC
 *                 elif c == 0x4e:  # N             # <<<<<<<<<<<<<<
 *                     state = _STATE_SS2
 *                 elif c == 0x4f:  # O
 */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_c, __pyx_int_78, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_6) {

        /* "ctff.pyx":349
 *                     state = _STATE_OSC
 *                 elif c == 0x4e:  # N
 *                     state = _STATE_SS2             # <<<<<<<<<<<<<<
 *                 elif c == 0x4f:  # O
 *                     state = _STATE_SS3
 */
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_SS2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2);
        __pyx_t_2 = 0;
        goto __pyx_L7;
      }

      /* "ctff.pyx":350
 *                 elif c == 0x4e:  # N
 *                     state = _STATE_SS2
 *                 elif c == 0x4f:  # O             # <<<<<<<<<<<<<<
 *                     state = _STATE_SS3
 *                 elif c == 0x50 or c == 0x58 or c == 0x5e or c == 0x5f:
 */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_c, __pyx_int_79, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_6) {

        /* "ctff.pyx":351
 *                     state = _STATE_SS2
 *                 elif c == 0x4f:  # O
 *                     state = _STATE_SS3             # <<<<<<<<<<<<<<
 *                 elif c == 0x50 or c == 0x58 or c == 0x5e or c == 0x5f:
 *                     # P(DCS) or X(SOS) or ^(PM) or _(APC)
 */
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_SS3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2);
        __pyx_t_2 = 0;
        goto __pyx_L7;
      }

      /* "ctff.pyx":352
 *                 elif c == 0x4f:  # O
 *                     state = _STATE_SS3
 *                 elif c == 0x50 or c == 0x58 or c == 0x5e or c == 0x5f:             # <<<<<<<<<<<<<<
 *                     # P(DCS) or X(SOS) or ^(PM) or _(APC)
 *                     pbytes = [c]
 */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_c, __pyx_int_80, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!__pyx_t_6) {
        __pyx_t_2 = PyObject_RichCompare(__pyx_v_c, __pyx_int_88, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (!__pyx_t_8) {
          __pyx_t_2 = PyObject_RichCompare(__pyx_v_c, __pyx_int_94, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (!__pyx_t_9) {
            __pyx_t_2 = PyObject_RichCompare(__pyx_v_c, __pyx_int_95, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_t_11 = __pyx_t_10;
          } else {
            __pyx_t_11 = __pyx_t_9;
          }
          __pyx_t_9 = __pyx_t_11;
        } else {
          __pyx_t_9 = __pyx_t_8;
        }
        __pyx_t_8 = __pyx_t_9;
      } else {
        __pyx_t_8 = __pyx_t_6;
      }
      if (__pyx_t_8) {

        /* "ctff.pyx":354
 *                 elif c == 0x50 or c == 0x58 or c == 0x5e or c == 0x5f:
 *                     # P(DCS) or X(SOS) or ^(PM) or _(APC)
 *                     pbytes = [c]             # <<<<<<<<<<<<<<
 *                     state = _STATE_STR
 *                 elif c < 0x20:  # control character
 */
        __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_c);
        PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_c);
        __Pyx_GIVEREF(__pyx_v_c);
        __Pyx_DECREF_SET(__pyx_v_pbytes, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "ctff.pyx":355
 *                     # P(DCS) or X(SOS) or ^(PM) or _(APC)
 *                     pbytes = [c]
 *                     state = _STATE_STR             # <<<<<<<<<<<<<<
 *                 elif c < 0x20:  # control character
 *                     if c == 0x1b:  # ESC
 */
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_STR); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2);
        __pyx_t_2 = 0;
        goto __pyx_L7;
      }

      /* "ctff.pyx":356
 *                     pbytes = [c]
 *                     state = _STATE_STR
 *                 elif c < 0x20:  # control character             # <<<<<<<<<<<<<<
 *                     if c == 0x1b:  # ESC
 *                         seq = [0x1b]
 */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_c, __pyx_int_32, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_8) {

        /* "ctff.pyx":357
 *                     state = _STATE_STR
 *                 elif c < 0x20:  # control character
 *                     if c == 0x1b:  # ESC             # <<<<<<<<<<<<<<
 *                         seq = [0x1b]
 *                         context.dispatch_invalid(seq)
 */
        __pyx_t_2 = PyObject_RichCompare(__pyx_v_c, __pyx_int_27, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (__pyx_t_8) {

          /* "ctff.pyx":358
 *                 elif c < 0x20:  # control character
 *                     if c == 0x1b:  # ESC
 *                         seq = [0x1b]             # <<<<<<<<<<<<<<
 *                         context.dispatch_invalid(seq)
 *                         ibytes = []
 */
          __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_int_27);
          PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_27);
          __Pyx_GIVEREF(__pyx_int_27);
          __Pyx_XDECREF_SET(__pyx_v_seq, __pyx_t_2);
          __pyx_t_2 = 0;

          /* "ctff.pyx":359
 *                     if c == 0x1b:  # ESC
 *                         seq = [0x1b]
 *                         context.dispatch_invalid(seq)             # <<<<<<<<<<<<<<
 *                         ibytes = []
 *                         state = _STATE_ESC
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_invalid); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_INCREF(__pyx_v_seq);
          PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_seq);
          __Pyx_GIVEREF(__pyx_v_seq);
          __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "ctff.pyx":360
 *                         seq = [0x1b]
 *                         context.dispatch_invalid(seq)
 *                         ibytes = []             # <<<<<<<<<<<<<<
 *                         state = _STATE_ESC
 *                     elif c == 0x18 or c == 0x1a:
 */
          __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF_SET(__pyx_v_ibytes, __pyx_t_1);
          __pyx_t_1 = 0;

          /* "ctff.pyx":361
 *                         context.dispatch_invalid(seq)
 *                         ibytes = []
 *                         state = _STATE_ESC             # <<<<<<<<<<<<<<
 *                     elif c == 0x18 or c == 0x1a:
 *                         seq = [0x1b]
 */
          __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_ESC); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_1);
          __pyx_t_1 = 0;
          goto __pyx_L8;
        }

        /* "ctff.pyx":362
 *                         ibytes = []
 *                         state = _STATE_ESC
 *                     elif c == 0x18 or c == 0x1a:             # <<<<<<<<<<<<<<
 *                         seq = [0x1b]
 *                         context.dispatch_invalid(seq)
 */
        __pyx_t_1 = PyObject_RichCompare(__pyx_v_c, __pyx_int_24, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (!__pyx_t_8) {
          __pyx_t_1 = PyObject_RichCompare(__pyx_v_c, __pyx_int_26, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_9 = __pyx_t_6;
        } else {
          __pyx_t_9 = __pyx_t_8;
        }
        if (__pyx_t_9) {

          /* "ctff.pyx":363
 *                         state = _STATE_ESC
 *                     elif c == 0x18 or c == 0x1a:
 *                         seq = [0x1b]             # <<<<<<<<<<<<<<
 *                         context.dispatch_invalid(seq)
 *                         context.dispatch_char(c)
 */
          __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_int_27);
          PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_27);
          __Pyx_GIVEREF(__pyx_int_27);
          __Pyx_XDECREF_SET(__pyx_v_seq, __pyx_t_1);
          __pyx_t_1 = 0;

          /* "ctff.pyx":364
 *                     elif c == 0x18 or c == 0x1a:
 *                         seq = [0x1b]
 *                         context.dispatch_invalid(seq)             # <<<<<<<<<<<<<<
 *                         context.dispatch_char(c)
 *                         state = _STATE_GROUND
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_invalid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_INCREF(__pyx_v_seq);
          PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_seq);
          __Pyx_GIVEREF(__pyx_v_seq);
          __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "ctff.pyx":365
 *                         seq = [0x1b]
 *                         context.dispatch_invalid(seq)
 *                         context.dispatch_char(c)             # <<<<<<<<<<<<<<
 *                         state = _STATE_GROUND
 *                     else:
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_char); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_INCREF(__pyx_v_c);
          PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_c);
          __Pyx_GIVEREF(__pyx_v_c);
          __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "ctff.pyx":366
 *                         context.dispatch_invalid(seq)
 *                         context.dispatch_char(c)
 *                         state = _STATE_GROUND             # <<<<<<<<<<<<<<
 *                     else:
 *                         context.dispatch_char(c)
 */
          __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_GROUND); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_1);
          __pyx_t_1 = 0;
          goto __pyx_L8;
        }
        /*else*/ {

          /* "ctff.pyx":368
 *                         state = _STATE_GROUND
 *                     else:
 *                         context.dispatch_char(c)             # <<<<<<<<<<<<<<
 *                 elif c <= 0x2f:  # SP to /
 *                     ibytes.append(c)
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_char); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_INCREF(__pyx_v_c);
          PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_c);
          __Pyx_GIVEREF(__pyx_v_c);
          __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __pyx_L8:;
        goto __pyx_L7;
      }

      /* "ctff.pyx":369
 *                     else:
 *                         context.dispatch_char(c)
 *                 elif c <= 0x2f:  # SP to /             # <<<<<<<<<<<<<<
 *                     ibytes.append(c)
 *                     state = _STATE_ESC_INTERMEDIATE
 */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_c, __pyx_int_47, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_9) {

        /* "ctff.pyx":370
 *                         context.dispatch_char(c)
 *                 elif c <= 0x2f:  # SP to /
 *                     ibytes.append(c)             # <<<<<<<<<<<<<<
 *                     state = _STATE_ESC_INTERMEDIATE
 *                 elif c <= 0x7e:  # ~
 */
        __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_ibytes, __pyx_v_c); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "ctff.pyx":371
 *                 elif c <= 0x2f:  # SP to /
 *                     ibytes.append(c)
 *                     state = _STATE_ESC_INTERMEDIATE             # <<<<<<<<<<<<<<
 *                 elif c <= 0x7e:  # ~
 *                     context.dispatch_esc(ibytes, c)
 */
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_ESC_INTERMEDIATE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2);
        __pyx_t_2 = 0;
        goto __pyx_L7;
      }

      /* "ctff.pyx":372
 *                     ibytes.append(c)
 *                     state = _STATE_ESC_INTERMEDIATE
 *                 elif c <= 0x7e:  # ~             # <<<<<<<<<<<<<<
 *                     context.dispatch_esc(ibytes, c)
 *                     state = _STATE_GROUND
 */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_c, __pyx_int_126, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_9) {

        /* "ctff.pyx":373
 *                     state = _STATE_ESC_INTERMEDIATE
 *                 elif c <= 0x7e:  # ~
 *                     context.dispatch_esc(ibytes, c)             # <<<<<<<<<<<<<<
 *                     state = _STATE_GROUND
 *                 elif c == 0x7f:  # control character
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_esc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_v_ibytes);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_ibytes);
        __Pyx_GIVEREF(__pyx_v_ibytes);
        __Pyx_INCREF(__pyx_v_c);
        PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_c);
        __Pyx_GIVEREF(__pyx_v_c);
        __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "ctff.pyx":374
 *                 elif c <= 0x7e:  # ~
 *                     context.dispatch_esc(ibytes, c)
 *                     state = _STATE_GROUND             # <<<<<<<<<<<<<<
 *                 elif c == 0x7f:  # control character
 *                     context.dispatch_char(c)
 */
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_GROUND); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_1);
        __pyx_t_1 = 0;
        goto __pyx_L7;
      }

      /* "ctff.pyx":375
 *                     context.dispatch_esc(ibytes, c)
 *                     state = _STATE_GROUND
 *                 elif c == 0x7f:  # control character             # <<<<<<<<<<<<<<
 *                     context.dispatch_char(c)
 *                 else:
 */
      __pyx_t_1 = PyObject_RichCompare(__pyx_v_c, __pyx_int_127, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_9) {

        /* "ctff.pyx":376
 *                     state = _STATE_GROUND
 *                 elif c == 0x7f:  # control character
 *                     context.dispatch_char(c)             # <<<<<<<<<<<<<<
 *                 else:
 *                     seq = [0x1b, c]
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_char); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_v_c);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_c);
        __Pyx_GIVEREF(__pyx_v_c);
        __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L7;
      }
      /*else*/ {

        /* "ctff.pyx":378
 *                     context.dispatch_char(c)
 *                 else:
 *                     seq = [0x1b, c]             # <<<<<<<<<<<<<<
 *                     context.dispatch_invalid(seq)
 *                     state = _STATE_GROUND
 */
        __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_int_27);
        PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_27);
        __Pyx_GIVEREF(__pyx_int_27);
        __Pyx_INCREF(__pyx_v_c);
        PyList_SET_ITEM(__pyx_t_2, 1, __pyx_v_c);
        __Pyx_GIVEREF(__pyx_v_c);
        __Pyx_XDECREF_SET(__pyx_v_seq, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "ctff.pyx":379
 *                 else:
 *                     seq = [0x1b, c]
 *                     context.dispatch_invalid(seq)             # <<<<<<<<<<<<<<
 *                     state = _STATE_GROUND
 * 
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_invalid); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_v_seq);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_seq);
        __Pyx_GIVEREF(__pyx_v_seq);
        __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "ctff.pyx":380
 *                     seq = [0x1b, c]
 *                     context.dispatch_invalid(seq)
 *                     state = _STATE_GROUND             # <<<<<<<<<<<<<<
 * 
 *             elif state == _STATE_CSI_PARAMETER:
 */
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_GROUND); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_1);
        __pyx_t_1 = 0;
      }
      __pyx_L7:;
      goto __pyx_L5;
    }

    /* "ctff.pyx":382
 *                     state = _STATE_GROUND
 * 
 *             elif state == _STATE_CSI_PARAMETER:             # <<<<<<<<<<<<<<
 *                 # parse control sequence
 *                 #
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_CSI_PARAMETER); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = PyObject_RichCompare(__pyx_v_state, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_9) {

      /* "ctff.pyx":387
 *                 # CSI P ... P I ... I F
 *                 #     ^
 *                 if c > 0x7e:             # <<<<<<<<<<<<<<
 *                     if c == 0x7f:  # control character
 *                         context.dispatch_char(c)
 */
      __pyx_t_7 = PyObject_RichCompare(__pyx_v_c, __pyx_int_126, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_9) {

        /* "ctff.pyx":388
 *                 #     ^
 *                 if c > 0x7e:
 *                     if c == 0x7f:  # control character             # <<<<<<<<<<<<<<
 *                         context.dispatch_char(c)
 *                     else:
 */
        __pyx_t_7 = PyObject_RichCompare(__pyx_v_c, __pyx_int_127, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (__pyx_t_9) {

          /* "ctff.pyx":389
 *                 if c > 0x7e:
 *                     if c == 0x7f:  # control character
 *                         context.dispatch_char(c)             # <<<<<<<<<<<<<<
 *                     else:
 *                         seq = [0x1b, 0x5b] + pbytes
 */
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_char); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_v_c);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_c);
          __Pyx_GIVEREF(__pyx_v_c);
          __pyx_t_2 = PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          goto __pyx_L10;
        }
        /*else*/ {

          /* "ctff.pyx":391
 *                         context.dispatch_char(c)
 *                     else:
 *                         seq = [0x1b, 0x5b] + pbytes             # <<<<<<<<<<<<<<
 *                         context.dispatch_invalid(seq)
 *                         state = _STATE_GROUND
 */
          __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_int_27);
          PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_27);
          __Pyx_GIVEREF(__pyx_int_27);
          __Pyx_INCREF(__pyx_int_91);
          PyList_SET_ITEM(__pyx_t_2, 1, __pyx_int_91);
          __Pyx_GIVEREF(__pyx_int_91);
          __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_pbytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF_SET(__pyx_v_seq, __pyx_t_1);
          __pyx_t_1 = 0;

          /* "ctff.pyx":392
 *                     else:
 *                         seq = [0x1b, 0x5b] + pbytes
 *                         context.dispatch_invalid(seq)             # <<<<<<<<<<<<<<
 *                         state = _STATE_GROUND
 *                 elif c > 0x3f:  # Final byte, @ to ~
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_invalid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_v_seq);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_seq);
          __Pyx_GIVEREF(__pyx_v_seq);
          __pyx_t_7 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "ctff.pyx":393
 *                         seq = [0x1b, 0x5b] + pbytes
 *                         context.dispatch_invalid(seq)
 *                         state = _STATE_GROUND             # <<<<<<<<<<<<<<
 *                 elif c > 0x3f:  # Final byte, @ to ~
 *                     context.dispatch_csi(pbytes, ibytes, c)
 */
          __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_GROUND); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_7);
          __pyx_t_7 = 0;
        }
        __pyx_L10:;
        goto __pyx_L9;
      }

      /* "ctff.pyx":394
 *                         context.dispatch_invalid(seq)
 *                         state = _STATE_GROUND
 *                 elif c > 0x3f:  # Final byte, @ to ~             # <<<<<<<<<<<<<<
 *                     context.dispatch_csi(pbytes, ibytes, c)
 *                     state = _STATE_GROUND
 */
      __pyx_t_7 = PyObject_RichCompare(__pyx_v_c, __pyx_int_63, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_9) {

        /* "ctff.pyx":395
 *                         state = _STATE_GROUND
 *                 elif c > 0x3f:  # Final byte, @ to ~
 *                     context.dispatch_csi(pbytes, ibytes, c)             # <<<<<<<<<<<<<<
 *                     state = _STATE_GROUND
 *                 elif c > 0x2f:  # parameter, 0 to ?
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_csi); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_pbytes);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_pbytes);
        __Pyx_GIVEREF(__pyx_v_pbytes);
        __Pyx_INCREF(__pyx_v_ibytes);
        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_ibytes);
        __Pyx_GIVEREF(__pyx_v_ibytes);
        __Pyx_INCREF(__pyx_v_c);
        PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_c);
        __Pyx_GIVEREF(__pyx_v_c);
        __pyx_t_1 = PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "ctff.pyx":396
 *                 elif c > 0x3f:  # Final byte, @ to ~
 *                     context.dispatch_csi(pbytes, ibytes, c)
 *                     state = _STATE_GROUND             # <<<<<<<<<<<<<<
 *                 elif c > 0x2f:  # parameter, 0 to ?
 *                     pbytes.append(c)
 */
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_GROUND); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_1);
        __pyx_t_1 = 0;
        goto __pyx_L9;
      }

      /* "ctff.pyx":397
 *                     context.dispatch_csi(pbytes, ibytes, c)
 *                     state = _STATE_GROUND
 *                 elif c > 0x2f:  # parameter, 0 to ?             # <<<<<<<<<<<<<<
 *                     pbytes.append(c)
 *                 elif c > 0x1f:  # intermediate, SP to /
 */
      __pyx_t_1 = PyObject_RichCompare(__pyx_v_c, __pyx_int_47, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_9) {

        /* "ctff.pyx":398
 *                     state = _STATE_GROUND
 *                 elif c > 0x2f:  # parameter, 0 to ?
 *                     pbytes.append(c)             # <<<<<<<<<<<<<<
 *                 elif c > 0x1f:  # intermediate, SP to /
 *                     ibytes.append(c)
 */
        __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_pbytes, __pyx_v_c); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L9;
      }

      /* "ctff.pyx":399
 *                 elif c > 0x2f:  # parameter, 0 to ?
 *                     pbytes.append(c)
 *                 elif c > 0x1f:  # intermediate, SP to /             # <<<<<<<<<<<<<<
 *                     ibytes.append(c)
 *                     state = _STATE_CSI_INTERMEDIATE
 */
      __pyx_t_1 = PyObject_RichCompare(__pyx_v_c, __pyx_int_31, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_9) {

        /* "ctff.pyx":400
 *                     pbytes.append(c)
 *                 elif c > 0x1f:  # intermediate, SP to /
 *                     ibytes.append(c)             # <<<<<<<<<<<<<<
 *                     state = _STATE_CSI_INTERMEDIATE
 * 
 */
        __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_ibytes, __pyx_v_c); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "ctff.pyx":401
 *                 elif c > 0x1f:  # intermediate, SP to /
 *                     ibytes.append(c)
 *                     state = _STATE_CSI_INTERMEDIATE             # <<<<<<<<<<<<<<
 * 
 *                 # control chars
 */
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_CSI_INTERMEDIATE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_1);
        __pyx_t_1 = 0;
        goto __pyx_L9;
      }

      /* "ctff.pyx":404
 * 
 *                 # control chars
 *                 elif c == 0x1b:  # ESC             # <<<<<<<<<<<<<<
 *                     seq = [0x1b, 0x5b] + pbytes
 *                     context.dispatch_invalid(seq)
 */
      __pyx_t_1 = PyObject_RichCompare(__pyx_v_c, __pyx_int_27, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_9) {

        /* "ctff.pyx":405
 *                 # control chars
 *                 elif c == 0x1b:  # ESC
 *                     seq = [0x1b, 0x5b] + pbytes             # <<<<<<<<<<<<<<
 *                     context.dispatch_invalid(seq)
 *                     ibytes = []
 */
        __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_int_27);
        PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_27);
        __Pyx_GIVEREF(__pyx_int_27);
        __Pyx_INCREF(__pyx_int_91);
        PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_91);
        __Pyx_GIVEREF(__pyx_int_91);
        __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_pbytes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF_SET(__pyx_v_seq, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "ctff.pyx":406
 *                 elif c == 0x1b:  # ESC
 *                     seq = [0x1b, 0x5b] + pbytes
 *                     context.dispatch_invalid(seq)             # <<<<<<<<<<<<<<
 *                     ibytes = []
 *                     state = _STATE_ESC
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_invalid); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_seq);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_seq);
        __Pyx_GIVEREF(__pyx_v_seq);
        __pyx_t_7 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "ctff.pyx":407
 *                     seq = [0x1b, 0x5b] + pbytes
 *                     context.dispatch_invalid(seq)
 *                     ibytes = []             # <<<<<<<<<<<<<<
 *                     state = _STATE_ESC
 * 
 */
        __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF_SET(__pyx_v_ibytes, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "ctff.pyx":408
 *                     context.dispatch_invalid(seq)
 *                     ibytes = []
 *                     state = _STATE_ESC             # <<<<<<<<<<<<<<
 * 
 *                 elif c == 0x18 or c == 0x1a:  # CAN, SUB
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_ESC); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_7);
        __pyx_t_7 = 0;
        goto __pyx_L9;
      }

      /* "ctff.pyx":410
 *                     state = _STATE_ESC
 * 
 *                 elif c == 0x18 or c == 0x1a:  # CAN, SUB             # <<<<<<<<<<<<<<
 *                     seq = [0x1b, 0x5b] + pbytes
 *                     context.dispatch_invalid(seq)
 */
      __pyx_t_7 = PyObject_RichCompare(__pyx_v_c, __pyx_int_24, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (!__pyx_t_9) {
        __pyx_t_7 = PyObject_RichCompare(__pyx_v_c, __pyx_int_26, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_6 = __pyx_t_8;
      } else {
        __pyx_t_6 = __pyx_t_9;
      }
      if (__pyx_t_6) {

        /* "ctff.pyx":411
 * 
 *                 elif c == 0x18 or c == 0x1a:  # CAN, SUB
 *                     seq = [0x1b, 0x5b] + pbytes             # <<<<<<<<<<<<<<
 *                     context.dispatch_invalid(seq)
 *                     context.dispatch_char(c)
 */
        __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_int_27);
        PyList_SET_ITEM(__pyx_t_7, 0, __pyx_int_27);
        __Pyx_GIVEREF(__pyx_int_27);
        __Pyx_INCREF(__pyx_int_91);
        PyList_SET_ITEM(__pyx_t_7, 1, __pyx_int_91);
        __Pyx_GIVEREF(__pyx_int_91);
        __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_v_pbytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF_SET(__pyx_v_seq, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "ctff.pyx":412
 *                 elif c == 0x18 or c == 0x1a:  # CAN, SUB
 *                     seq = [0x1b, 0x5b] + pbytes
 *                     context.dispatch_invalid(seq)             # <<<<<<<<<<<<<<
 *                     context.dispatch_char(c)
 *                     state = _STATE_GROUND
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_invalid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_v_seq);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_seq);
        __Pyx_GIVEREF(__pyx_v_seq);
        __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "ctff.pyx":413
 *                     seq = [0x1b, 0x5b] + pbytes
 *                     context.dispatch_invalid(seq)
 *                     context.dispatch_char(c)             # <<<<<<<<<<<<<<
 *                     state = _STATE_GROUND
 * 
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_char); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_v_c);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_c);
        __Pyx_GIVEREF(__pyx_v_c);
        __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "ctff.pyx":414
 *                     context.dispatch_invalid(seq)
 *                     context.dispatch_char(c)
 *                     state = _STATE_GROUND             # <<<<<<<<<<<<<<
 * 
 *                 else:
 */
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_GROUND); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_1);
        __pyx_t_1 = 0;
        goto __pyx_L9;
      }
      /*else*/ {

        /* "ctff.pyx":417
 * 
 *                 else:
 *                     context.dispatch_char(c)             # <<<<<<<<<<<<<<
 * 
 *             elif state == _STATE_CSI_INTERMEDIATE:
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_char); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_v_c);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_c);
        __Pyx_GIVEREF(__pyx_v_c);
        __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __pyx_L9:;
      goto __pyx_L5;
    }

    /* "ctff.pyx":419
 *                     context.dispatch_char(c)
 * 
 *             elif state == _STATE_CSI_INTERMEDIATE:             # <<<<<<<<<<<<<<
 *                 # parse control sequence
 *                 #
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_CSI_INTERMEDIATE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = PyObject_RichCompare(__pyx_v_state, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_6) {

      /* "ctff.pyx":424
 *                 # CSI P ... P I ... I F
 *                 #             ^
 *                 if c > 0x7e:             # <<<<<<<<<<<<<<
 *                     if c == 0x7f:  # control character
 *                         context.dispatch_char(c)
 */
      __pyx_t_7 = PyObject_RichCompare(__pyx_v_c, __pyx_int_126, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_6) {

        /* "ctff.pyx":425
 *                 #             ^
 *                 if c > 0x7e:
 *                     if c == 0x7f:  # control character             # <<<<<<<<<<<<<<
 *                         context.dispatch_char(c)
 *                     else:
 */
        __pyx_t_7 = PyObject_RichCompare(__pyx_v_c, __pyx_int_127, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (__pyx_t_6) {

          /* "ctff.pyx":426
 *                 if c > 0x7e:
 *                     if c == 0x7f:  # control character
 *                         context.dispatch_char(c)             # <<<<<<<<<<<<<<
 *                     else:
 *                         seq = [0x1b, 0x5b] + pbytes + ibytes
 */
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_char); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_v_c);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_c);
          __Pyx_GIVEREF(__pyx_v_c);
          __pyx_t_1 = PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L12;
        }
        /*else*/ {

          /* "ctff.pyx":428
 *                         context.dispatch_char(c)
 *                     else:
 *                         seq = [0x1b, 0x5b] + pbytes + ibytes             # <<<<<<<<<<<<<<
 *                         context.dispatch_invalid(seq)
 *                         state = _STATE_GROUND
 */
          __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_int_27);
          PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_27);
          __Pyx_GIVEREF(__pyx_int_27);
          __Pyx_INCREF(__pyx_int_91);
          PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_91);
          __Pyx_GIVEREF(__pyx_int_91);
          __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_pbytes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_ibytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF_SET(__pyx_v_seq, __pyx_t_1);
          __pyx_t_1 = 0;

          /* "ctff.pyx":429
 *                     else:
 *                         seq = [0x1b, 0x5b] + pbytes + ibytes
 *                         context.dispatch_invalid(seq)             # <<<<<<<<<<<<<<
 *                         state = _STATE_GROUND
 *                 elif c > 0x3f:  # Final byte, @ to ~
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_invalid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_v_seq);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_seq);
          __Pyx_GIVEREF(__pyx_v_seq);
          __pyx_t_7 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "ctff.pyx":430
 *                         seq = [0x1b, 0x5b] + pbytes + ibytes
 *                         context.dispatch_invalid(seq)
 *                         state = _STATE_GROUND             # <<<<<<<<<<<<<<
 *                 elif c > 0x3f:  # Final byte, @ to ~
 *                     context.dispatch_csi(pbytes, ibytes, c)
 */
          __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_GROUND); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_7);
          __pyx_t_7 = 0;
        }
        __pyx_L12:;
        goto __pyx_L11;
      }

      /* "ctff.pyx":431
 *                         context.dispatch_invalid(seq)
 *                         state = _STATE_GROUND
 *                 elif c > 0x3f:  # Final byte, @ to ~             # <<<<<<<<<<<<<<
 *                     context.dispatch_csi(pbytes, ibytes, c)
 *                     state = _STATE_GROUND
 */
      __pyx_t_7 = PyObject_RichCompare(__pyx_v_c, __pyx_int_63, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_6) {

        /* "ctff.pyx":432
 *                         state = _STATE_GROUND
 *                 elif c > 0x3f:  # Final byte, @ to ~
 *                     context.dispatch_csi(pbytes, ibytes, c)             # <<<<<<<<<<<<<<
 *                     state = _STATE_GROUND
 *                 elif c > 0x2f:
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_csi); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_pbytes);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_pbytes);
        __Pyx_GIVEREF(__pyx_v_pbytes);
        __Pyx_INCREF(__pyx_v_ibytes);
        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_ibytes);
        __Pyx_GIVEREF(__pyx_v_ibytes);
        __Pyx_INCREF(__pyx_v_c);
        PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_c);
        __Pyx_GIVEREF(__pyx_v_c);
        __pyx_t_1 = PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "ctff.pyx":433
 *                 elif c > 0x3f:  # Final byte, @ to ~
 *                     context.dispatch_csi(pbytes, ibytes, c)
 *                     state = _STATE_GROUND             # <<<<<<<<<<<<<<
 *                 elif c > 0x2f:
 *                     seq = [0x1b, 0x5b] + pbytes + ibytes + [c]
 */
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_GROUND); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_1);
        __pyx_t_1 = 0;
        goto __pyx_L11;
      }

      /* "ctff.pyx":434
 *                     context.dispatch_csi(pbytes, ibytes, c)
 *                     state = _STATE_GROUND
 *                 elif c > 0x2f:             # <<<<<<<<<<<<<<
 *                     seq = [0x1b, 0x5b] + pbytes + ibytes + [c]
 *                     context.dispatch_invalid(seq)
 */
      __pyx_t_1 = PyObject_RichCompare(__pyx_v_c, __pyx_int_47, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_6) {

        /* "ctff.pyx":435
 *                     state = _STATE_GROUND
 *                 elif c > 0x2f:
 *                     seq = [0x1b, 0x5b] + pbytes + ibytes + [c]             # <<<<<<<<<<<<<<
 *                     context.dispatch_invalid(seq)
 *                     state = _STATE_GROUND
 */
        __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_int_27);
        PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_27);
        __Pyx_GIVEREF(__pyx_int_27);
        __Pyx_INCREF(__pyx_int_91);
        PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_91);
        __Pyx_GIVEREF(__pyx_int_91);
        __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_pbytes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_ibytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_c);
        PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_c);
        __Pyx_GIVEREF(__pyx_v_c);
        __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF_SET(__pyx_v_seq, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "ctff.pyx":436
 *                 elif c > 0x2f:
 *                     seq = [0x1b, 0x5b] + pbytes + ibytes + [c]
 *                     context.dispatch_invalid(seq)             # <<<<<<<<<<<<<<
 *                     state = _STATE_GROUND
 *                 elif c > 0x1f:  # intermediate, SP to /
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_invalid); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_seq);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_seq);
        __Pyx_GIVEREF(__pyx_v_seq);
        __pyx_t_1 = PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "ctff.pyx":437
 *                     seq = [0x1b, 0x5b] + pbytes + ibytes + [c]
 *                     context.dispatch_invalid(seq)
 *                     state = _STATE_GROUND             # <<<<<<<<<<<<<<
 *                 elif c > 0x1f:  # intermediate, SP to /
 *                     ibytes.append(c)
 */
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_GROUND); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_1);
        __pyx_t_1 = 0;
        goto __pyx_L11;
      }

      /* "ctff.pyx":438
 *                     context.dispatch_invalid(seq)
 *                     state = _STATE_GROUND
 *                 elif c > 0x1f:  # intermediate, SP to /             # <<<<<<<<<<<<<<
 *                     ibytes.append(c)
 *                     state = _STATE_CSI_INTERMEDIATE
 */
      __pyx_t_1 = PyObject_RichCompare(__pyx_v_c, __pyx_int_31, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_6) {

        /* "ctff.pyx":439
 *                     state = _STATE_GROUND
 *                 elif c > 0x1f:  # intermediate, SP to /
 *                     ibytes.append(c)             # <<<<<<<<<<<<<<
 *                     state = _STATE_CSI_INTERMEDIATE
 * 
 */
        __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_ibytes, __pyx_v_c); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "ctff.pyx":440
 *                 elif c > 0x1f:  # intermediate, SP to /
 *                     ibytes.append(c)
 *                     state = _STATE_CSI_INTERMEDIATE             # <<<<<<<<<<<<<<
 * 
 *                 # control chars
 */
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_CSI_INTERMEDIATE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_1);
        __pyx_t_1 = 0;
        goto __pyx_L11;
      }

      /* "ctff.pyx":443
 * 
 *                 # control chars
 *                 elif c == 0x1b:  # ESC             # <<<<<<<<<<<<<<
 *                     seq = [0x1b, 0x5b] + pbytes + ibytes
 *                     context.dispatch_invalid(seq)
 */
      __pyx_t_1 = PyObject_RichCompare(__pyx_v_c, __pyx_int_27, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_6) {

        /* "ctff.pyx":444
 *                 # control chars
 *                 elif c == 0x1b:  # ESC
 *                     seq = [0x1b, 0x5b] + pbytes + ibytes             # <<<<<<<<<<<<<<
 *                     context.dispatch_invalid(seq)
 *                     ibytes = []
 */
        __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_int_27);
        PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_27);
        __Pyx_GIVEREF(__pyx_int_27);
        __Pyx_INCREF(__pyx_int_91);
        PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_91);
        __Pyx_GIVEREF(__pyx_int_91);
        __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_pbytes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_ibytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF_SET(__pyx_v_seq, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "ctff.pyx":445
 *                 elif c == 0x1b:  # ESC
 *                     seq = [0x1b, 0x5b] + pbytes + ibytes
 *                     context.dispatch_invalid(seq)             # <<<<<<<<<<<<<<
 *                     ibytes = []
 *                     state = _STATE_ESC
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_invalid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_seq);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_seq);
        __Pyx_GIVEREF(__pyx_v_seq);
        __pyx_t_7 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "ctff.pyx":446
 *                     seq = [0x1b, 0x5b] + pbytes + ibytes
 *                     context.dispatch_invalid(seq)
 *                     ibytes = []             # <<<<<<<<<<<<<<
 *                     state = _STATE_ESC
 *                 elif c == 0x18 or c == 0x1a:
 */
        __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF_SET(__pyx_v_ibytes, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "ctff.pyx":447
 *                     context.dispatch_invalid(seq)
 *                     ibytes = []
 *                     state = _STATE_ESC             # <<<<<<<<<<<<<<
 *                 elif c == 0x18 or c == 0x1a:
 *                     seq = [0x1b, 0x5b] + pbytes + ibytes
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_ESC); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_7);
        __pyx_t_7 = 0;
        goto __pyx_L11;
      }

      /* "ctff.pyx":448
 *                     ibytes = []
 *                     state = _STATE_ESC
 *                 elif c == 0x18 or c == 0x1a:             # <<<<<<<<<<<<<<
 *                     seq = [0x1b, 0x5b] + pbytes + ibytes
 *                     context.dispatch_invalid(seq)
 */
      __pyx_t_7 = PyObject_RichCompare(__pyx_v_c, __pyx_int_24, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (!__pyx_t_6) {
        __pyx_t_7 = PyObject_RichCompare(__pyx_v_c, __pyx_int_26, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_8 = __pyx_t_9;
      } else {
        __pyx_t_8 = __pyx_t_6;
      }
      if (__pyx_t_8) {

        /* "ctff.pyx":449
 *                     state = _STATE_ESC
 *                 elif c == 0x18 or c == 0x1a:
 *                     seq = [0x1b, 0x5b] + pbytes + ibytes             # <<<<<<<<<<<<<<
 *                     context.dispatch_invalid(seq)
 *                     context.dispatch_char(c)
 */
        __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_int_27);
        PyList_SET_ITEM(__pyx_t_7, 0, __pyx_int_27);
        __Pyx_GIVEREF(__pyx_int_27);
        __Pyx_INCREF(__pyx_int_91);
        PyList_SET_ITEM(__pyx_t_7, 1, __pyx_int_91);
        __Pyx_GIVEREF(__pyx_int_91);
        __pyx_t_2 = PyNumber_Add(__pyx_t_7, __pyx_v_pbytes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyNumber_Add(__pyx_t_2, __pyx_v_ibytes); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF_SET(__pyx_v_seq, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "ctff.pyx":450
 *                 elif c == 0x18 or c == 0x1a:
 *                     seq = [0x1b, 0x5b] + pbytes + ibytes
 *                     context.dispatch_invalid(seq)             # <<<<<<<<<<<<<<
 *                     context.dispatch_char(c)
 *                     state = _STATE_GROUND
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_invalid); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_seq);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_seq);
        __Pyx_GIVEREF(__pyx_v_seq);
        __pyx_t_1 = PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "ctff.pyx":451
 *                     seq = [0x1b, 0x5b] + pbytes + ibytes
 *                     context.dispatch_invalid(seq)
 *                     context.dispatch_char(c)             # <<<<<<<<<<<<<<
 *                     state = _STATE_GROUND
 *                 else:
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_char); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_c);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_c);
        __Pyx_GIVEREF(__pyx_v_c);
        __pyx_t_7 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "ctff.pyx":452
 *                     context.dispatch_invalid(seq)
 *                     context.dispatch_char(c)
 *                     state = _STATE_GROUND             # <<<<<<<<<<<<<<
 *                 else:
 *                     context.dispatch_char(c)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_GROUND); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_7);
        __pyx_t_7 = 0;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "ctff.pyx":454
 *                     state = _STATE_GROUND
 *                 else:
 *                     context.dispatch_char(c)             # <<<<<<<<<<<<<<
 * 
 *             elif state == _STATE_ESC_INTERMEDIATE:
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_char); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_c);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_c);
        __Pyx_GIVEREF(__pyx_v_c);
        __pyx_t_1 = PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __pyx_L11:;
      goto __pyx_L5;
    }

    /* "ctff.pyx":456
 *                     context.dispatch_char(c)
 * 
 *             elif state == _STATE_ESC_INTERMEDIATE:             # <<<<<<<<<<<<<<
 *                 if c > 0x7e:
 *                     if c == 0x7f:  # control character
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_ESC_INTERMEDIATE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_state, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_8) {

      /* "ctff.pyx":457
 * 
 *             elif state == _STATE_ESC_INTERMEDIATE:
 *                 if c > 0x7e:             # <<<<<<<<<<<<<<
 *                     if c == 0x7f:  # control character
 *                         context.dispatch_char(c)
 */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_c, __pyx_int_126, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_8) {

        /* "ctff.pyx":458
 *             elif state == _STATE_ESC_INTERMEDIATE:
 *                 if c > 0x7e:
 *                     if c == 0x7f:  # control character             # <<<<<<<<<<<<<<
 *                         context.dispatch_char(c)
 *                     else:
 */
        __pyx_t_2 = PyObject_RichCompare(__pyx_v_c, __pyx_int_127, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (__pyx_t_8) {

          /* "ctff.pyx":459
 *                 if c > 0x7e:
 *                     if c == 0x7f:  # control character
 *                         context.dispatch_char(c)             # <<<<<<<<<<<<<<
 *                     else:
 *                         seq = [0x1b] + ibytes + [c]
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_char); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_v_c);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_c);
          __Pyx_GIVEREF(__pyx_v_c);
          __pyx_t_7 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          goto __pyx_L14;
        }
        /*else*/ {

          /* "ctff.pyx":461
 *                         context.dispatch_char(c)
 *                     else:
 *                         seq = [0x1b] + ibytes + [c]             # <<<<<<<<<<<<<<
 *                         context.dispatch_invalid(seq)
 *                         state = _STATE_GROUND
 */
          __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_INCREF(__pyx_int_27);
          PyList_SET_ITEM(__pyx_t_7, 0, __pyx_int_27);
          __Pyx_GIVEREF(__pyx_int_27);
          __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_v_ibytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_INCREF(__pyx_v_c);
          PyList_SET_ITEM(__pyx_t_7, 0, __pyx_v_c);
          __Pyx_GIVEREF(__pyx_v_c);
          __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF_SET(__pyx_v_seq, __pyx_t_2);
          __pyx_t_2 = 0;

          /* "ctff.pyx":462
 *                     else:
 *                         seq = [0x1b] + ibytes + [c]
 *                         context.dispatch_invalid(seq)             # <<<<<<<<<<<<<<
 *                         state = _STATE_GROUND
 *                 elif c > 0x2f:  # 0 to ~, Final byte
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_invalid); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_INCREF(__pyx_v_seq);
          PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_seq);
          __Pyx_GIVEREF(__pyx_v_seq);
          __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "ctff.pyx":463
 *                         seq = [0x1b] + ibytes + [c]
 *                         context.dispatch_invalid(seq)
 *                         state = _STATE_GROUND             # <<<<<<<<<<<<<<
 *                 elif c > 0x2f:  # 0 to ~, Final byte
 *                     context.dispatch_esc(ibytes, c)
 */
          __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_GROUND); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_1);
          __pyx_t_1 = 0;
        }
        __pyx_L14:;
        goto __pyx_L13;
      }

      /* "ctff.pyx":464
 *                         context.dispatch_invalid(seq)
 *                         state = _STATE_GROUND
 *                 elif c > 0x2f:  # 0 to ~, Final byte             # <<<<<<<<<<<<<<
 *                     context.dispatch_esc(ibytes, c)
 *                     state = _STATE_GROUND
 */
      __pyx_t_1 = PyObject_RichCompare(__pyx_v_c, __pyx_int_47, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_8) {

        /* "ctff.pyx":465
 *                         state = _STATE_GROUND
 *                 elif c > 0x2f:  # 0 to ~, Final byte
 *                     context.dispatch_esc(ibytes, c)             # <<<<<<<<<<<<<<
 *                     state = _STATE_GROUND
 *                 elif c > 0x1f:  # SP to /
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_esc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_v_ibytes);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_ibytes);
        __Pyx_GIVEREF(__pyx_v_ibytes);
        __Pyx_INCREF(__pyx_v_c);
        PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_c);
        __Pyx_GIVEREF(__pyx_v_c);
        __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "ctff.pyx":466
 *                 elif c > 0x2f:  # 0 to ~, Final byte
 *                     context.dispatch_esc(ibytes, c)
 *                     state = _STATE_GROUND             # <<<<<<<<<<<<<<
 *                 elif c > 0x1f:  # SP to /
 *                     ibytes.append(c)
 */
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_GROUND); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2);
        __pyx_t_2 = 0;
        goto __pyx_L13;
      }

      /* "ctff.pyx":467
 *                     context.dispatch_esc(ibytes, c)
 *                     state = _STATE_GROUND
 *                 elif c > 0x1f:  # SP to /             # <<<<<<<<<<<<<<
 *                     ibytes.append(c)
 *                     state = _STATE_ESC_INTERMEDIATE
 */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_c, __pyx_int_31, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_8) {

        /* "ctff.pyx":468
 *                     state = _STATE_GROUND
 *                 elif c > 0x1f:  # SP to /
 *                     ibytes.append(c)             # <<<<<<<<<<<<<<
 *                     state = _STATE_ESC_INTERMEDIATE
 *                 elif c == 0x1b:  # ESC
 */
        __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_ibytes, __pyx_v_c); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "ctff.pyx":469
 *                 elif c > 0x1f:  # SP to /
 *                     ibytes.append(c)
 *                     state = _STATE_ESC_INTERMEDIATE             # <<<<<<<<<<<<<<
 *                 elif c == 0x1b:  # ESC
 *                     seq = [0x1b] + ibytes
 */
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_ESC_INTERMEDIATE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2);
        __pyx_t_2 = 0;
        goto __pyx_L13;
      }

      /* "ctff.pyx":470
 *                     ibytes.append(c)
 *                     state = _STATE_ESC_INTERMEDIATE
 *                 elif c == 0x1b:  # ESC             # <<<<<<<<<<<<<<
 *                     seq = [0x1b] + ibytes
 *                     context.dispatch_invalid(seq)
 */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_c, __pyx_int_27, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_8) {

        /* "ctff.pyx":471
 *                     state = _STATE_ESC_INTERMEDIATE
 *                 elif c == 0x1b:  # ESC
 *                     seq = [0x1b] + ibytes             # <<<<<<<<<<<<<<
 *                     context.dispatch_invalid(seq)
 *                     ibytes = []
 */
        __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_int_27);
        PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_27);
        __Pyx_GIVEREF(__pyx_int_27);
        __pyx_t_7 = PyNumber_Add(__pyx_t_2, __pyx_v_ibytes); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF_SET(__pyx_v_seq, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "ctff.pyx":472
 *                 elif c == 0x1b:  # ESC
 *                     seq = [0x1b] + ibytes
 *                     context.dispatch_invalid(seq)             # <<<<<<<<<<<<<<
 *                     ibytes = []
 *                     state = _STATE_ESC
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_invalid); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_seq);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_seq);
        __Pyx_GIVEREF(__pyx_v_seq);
        __pyx_t_1 = PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "ctff.pyx":473
 *                     seq = [0x1b] + ibytes
 *                     context.dispatch_invalid(seq)
 *                     ibytes = []             # <<<<<<<<<<<<<<
 *                     state = _STATE_ESC
 *                 elif c == 0x18 or c == 0x1a:
 */
        __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_ibytes, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "ctff.pyx":474
 *                     context.dispatch_invalid(seq)
 *                     ibytes = []
 *                     state = _STATE_ESC             # <<<<<<<<<<<<<<
 *                 elif c == 0x18 or c == 0x1a:
 *                     seq = [0x1b] + ibytes
 */
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_ESC); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_1);
        __pyx_t_1 = 0;
        goto __pyx_L13;
      }

      /* "ctff.pyx":475
 *                     ibytes = []
 *                     state = _STATE_ESC
 *                 elif c == 0x18 or c == 0x1a:             # <<<<<<<<<<<<<<
 *                     seq = [0x1b] + ibytes
 *                     context.dispatch_invalid(seq)
 */
      __pyx_t_1 = PyObject_RichCompare(__pyx_v_c, __pyx_int_24, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!__pyx_t_8) {
        __pyx_t_1 = PyObject_RichCompare(__pyx_v_c, __pyx_int_26, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_9 = __pyx_t_6;
      } else {
        __pyx_t_9 = __pyx_t_8;
      }
      if (__pyx_t_9) {

        /* "ctff.pyx":476
 *                     state = _STATE_ESC
 *                 elif c == 0x18 or c == 0x1a:
 *                     seq = [0x1b] + ibytes             # <<<<<<<<<<<<<<
 *                     context.dispatch_invalid(seq)
 *                     context.dispatch_char(c)
 */
        __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_int_27);
        PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_27);
        __Pyx_GIVEREF(__pyx_int_27);
        __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_ibytes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF_SET(__pyx_v_seq, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "ctff.pyx":477
 *                 elif c == 0x18 or c == 0x1a:
 *                     seq = [0x1b] + ibytes
 *                     context.dispatch_invalid(seq)             # <<<<<<<<<<<<<<
 *                     context.dispatch_char(c)
 *                     state = _STATE_GROUND
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_invalid); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_seq);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_seq);
        __Pyx_GIVEREF(__pyx_v_seq);
        __pyx_t_7 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "ctff.pyx":478
 *                     seq = [0x1b] + ibytes
 *                     context.dispatch_invalid(seq)
 *                     context.dispatch_char(c)             # <<<<<<<<<<<<<<
 *                     state = _STATE_GROUND
 *                 else:
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_char); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_c);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_c);
        __Pyx_GIVEREF(__pyx_v_c);
        __pyx_t_2 = PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "ctff.pyx":479
 *                     context.dispatch_invalid(seq)
 *                     context.dispatch_char(c)
 *                     state = _STATE_GROUND             # <<<<<<<<<<<<<<
 *                 else:
 *                     context.dispatch_char(c)
 */
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_GROUND); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2);
        __pyx_t_2 = 0;
        goto __pyx_L13;
      }
      /*else*/ {

        /* "ctff.pyx":481
 *                     state = _STATE_GROUND
 *                 else:
 *                     context.dispatch_char(c)             # <<<<<<<<<<<<<<
 * 
 *             elif state == _STATE_OSC:
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_char); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_c);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_c);
        __Pyx_GIVEREF(__pyx_v_c);
        __pyx_t_7 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __pyx_L13:;
      goto __pyx_L5;
    }

    /* "ctff.pyx":483
 *                     context.dispatch_char(c)
 * 
 *             elif state == _STATE_OSC:             # <<<<<<<<<<<<<<
 *                 # parse control string
 *                 if c == 0x07:
 */
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_OSC); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_state, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "ctff.pyx":485
 *             elif state == _STATE_OSC:
 *                 # parse control string
 *                 if c == 0x07:             # <<<<<<<<<<<<<<
 *                     context.dispatch_control_string(pbytes[0], ibytes)
 *                     state = _STATE_GROUND
 */
      __pyx_t_1 = PyObject_RichCompare(__pyx_v_c, __pyx_int_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_9) {

        /* "ctff.pyx":486
 *                 # parse control string
 *                 if c == 0x07:
 *                     context.dispatch_control_string(pbytes[0], ibytes)             # <<<<<<<<<<<<<<
 *                     state = _STATE_GROUND
 *                 elif c < 0x08:
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_control_string); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_pbytes, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_v_ibytes);
        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_ibytes);
        __Pyx_GIVEREF(__pyx_v_ibytes);
        __pyx_t_7 = 0;
        __pyx_t_7 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "ctff.pyx":487
 *                 if c == 0x07:
 *                     context.dispatch_control_string(pbytes[0], ibytes)
 *                     state = _STATE_GROUND             # <<<<<<<<<<<<<<
 *                 elif c < 0x08:
 *                     seq = [0x1b] + pbytes + ibytes + [c]
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_GROUND); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_7);
        __pyx_t_7 = 0;
        goto __pyx_L15;
      }

      /* "ctff.pyx":488
 *                     context.dispatch_control_string(pbytes[0], ibytes)
 *                     state = _STATE_GROUND
 *                 elif c < 0x08:             # <<<<<<<<<<<<<<
 *                     seq = [0x1b] + pbytes + ibytes + [c]
 *                     context.dispatch_invalid(seq)
 */
      __pyx_t_7 = PyObject_RichCompare(__pyx_v_c, __pyx_int_8, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_9) {

        /* "ctff.pyx":489
 *                     state = _STATE_GROUND
 *                 elif c < 0x08:
 *                     seq = [0x1b] + pbytes + ibytes + [c]             # <<<<<<<<<<<<<<
 *                     context.dispatch_invalid(seq)
 *                     state = _STATE_GROUND
 */
        __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_int_27);
        PyList_SET_ITEM(__pyx_t_7, 0, __pyx_int_27);
        __Pyx_GIVEREF(__pyx_int_27);
        __pyx_t_2 = PyNumber_Add(__pyx_t_7, __pyx_v_pbytes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyNumber_Add(__pyx_t_2, __pyx_v_ibytes); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_c);
        PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_c);
        __Pyx_GIVEREF(__pyx_v_c);
        __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF_SET(__pyx_v_seq, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "ctff.pyx":490
 *                 elif c < 0x08:
 *                     seq = [0x1b] + pbytes + ibytes + [c]
 *                     context.dispatch_invalid(seq)             # <<<<<<<<<<<<<<
 *                     state = _STATE_GROUND
 *                 elif c < 0x0e:
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_invalid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_seq);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_seq);
        __Pyx_GIVEREF(__pyx_v_seq);
        __pyx_t_7 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "ctff.pyx":491
 *                     seq = [0x1b] + pbytes + ibytes + [c]
 *                     context.dispatch_invalid(seq)
 *                     state = _STATE_GROUND             # <<<<<<<<<<<<<<
 *                 elif c < 0x0e:
 *                     ibytes.append(c)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_GROUND); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_7);
        __pyx_t_7 = 0;
        goto __pyx_L15;
      }

      /* "ctff.pyx":492
 *                     context.dispatch_invalid(seq)
 *                     state = _STATE_GROUND
 *                 elif c < 0x0e:             # <<<<<<<<<<<<<<
 *                     ibytes.append(c)
 *                 elif c == 0x1b:
 */
      __pyx_t_7 = PyObject_RichCompare(__pyx_v_c, __pyx_int_14, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_9) {

        /* "ctff.pyx":493
 *                     state = _STATE_GROUND
 *                 elif c < 0x0e:
 *                     ibytes.append(c)             # <<<<<<<<<<<<<<
 *                 elif c == 0x1b:
 *                     state = _STATE_OSC_ESC
 */
        __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_ibytes, __pyx_v_c); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L15;
      }

      /* "ctff.pyx":494
 *                 elif c < 0x0e:
 *                     ibytes.append(c)
 *                 elif c == 0x1b:             # <<<<<<<<<<<<<<
 *                     state = _STATE_OSC_ESC
 *                 elif c < 0x20:
 */
      __pyx_t_7 = PyObject_RichCompare(__pyx_v_c, __pyx_int_27, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_9) {

        /* "ctff.pyx":495
 *                     ibytes.append(c)
 *                 elif c == 0x1b:
 *                     state = _STATE_OSC_ESC             # <<<<<<<<<<<<<<
 *                 elif c < 0x20:
 *                     seq = [0x1b] + pbytes + ibytes + [c]
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_OSC_ESC); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_7);
        __pyx_t_7 = 0;
        goto __pyx_L15;
      }

      /* "ctff.pyx":496
 *                 elif c == 0x1b:
 *                     state = _STATE_OSC_ESC
 *                 elif c < 0x20:             # <<<<<<<<<<<<<<
 *                     seq = [0x1b] + pbytes + ibytes + [c]
 *                     context.dispatch_invalid(seq)
 */
      __pyx_t_7 = PyObject_RichCompare(__pyx_v_c, __pyx_int_32, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_9) {

        /* "ctff.pyx":497
 *                     state = _STATE_OSC_ESC
 *                 elif c < 0x20:
 *                     seq = [0x1b] + pbytes + ibytes + [c]             # <<<<<<<<<<<<<<
 *                     context.dispatch_invalid(seq)
 *                     state = _STATE_GROUND
 */
        __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_int_27);
        PyList_SET_ITEM(__pyx_t_7, 0, __pyx_int_27);
        __Pyx_GIVEREF(__pyx_int_27);
        __pyx_t_2 = PyNumber_Add(__pyx_t_7, __pyx_v_pbytes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyNumber_Add(__pyx_t_2, __pyx_v_ibytes); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_c);
        PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_c);
        __Pyx_GIVEREF(__pyx_v_c);
        __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF_SET(__pyx_v_seq, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "ctff.pyx":498
 *                 elif c < 0x20:
 *                     seq = [0x1b] + pbytes + ibytes + [c]
 *                     context.dispatch_invalid(seq)             # <<<<<<<<<<<<<<
 *                     state = _STATE_GROUND
 *                 else:
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_invalid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_seq);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_seq);
        __Pyx_GIVEREF(__pyx_v_seq);
        __pyx_t_7 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "ctff.pyx":499
 *                     seq = [0x1b] + pbytes + ibytes + [c]
 *                     context.dispatch_invalid(seq)
 *                     state = _STATE_GROUND             # <<<<<<<<<<<<<<
 *                 else:
 *                     ibytes.append(c)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_GROUND); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_7);
        __pyx_t_7 = 0;
        goto __pyx_L15;
      }
      /*else*/ {

        /* "ctff.pyx":501
 *                     state = _STATE_GROUND
 *                 else:
 *                     ibytes.append(c)             # <<<<<<<<<<<<<<
 * 
 *             elif state == _STATE_STR:
 */
        __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_ibytes, __pyx_v_c); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L15:;
      goto __pyx_L5;
    }

    /* "ctff.pyx":503
 *                     ibytes.append(c)
 * 
 *             elif state == _STATE_STR:             # <<<<<<<<<<<<<<
 *                 # parse control string
 *                 # 00/08 - 00/13, 02/00 - 07/14
 */
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_STR); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_state, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_9) {

      /* "ctff.pyx":507
 *                 # 00/08 - 00/13, 02/00 - 07/14
 *                 #
 *                 if c < 0x08:             # <<<<<<<<<<<<<<
 *                     seq = [0x1b] + pbytes + ibytes + [c]
 *                     context.dispatch_invalid(seq)
 */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_c, __pyx_int_8, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_9) {

        /* "ctff.pyx":508
 *                 #
 *                 if c < 0x08:
 *                     seq = [0x1b] + pbytes + ibytes + [c]             # <<<<<<<<<<<<<<
 *                     context.dispatch_invalid(seq)
 *                     state = _STATE_GROUND
 */
        __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_int_27);
        PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_27);
        __Pyx_GIVEREF(__pyx_int_27);
        __pyx_t_7 = PyNumber_Add(__pyx_t_2, __pyx_v_pbytes); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyNumber_Add(__pyx_t_7, __pyx_v_ibytes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_v_c);
        PyList_SET_ITEM(__pyx_t_7, 0, __pyx_v_c);
        __Pyx_GIVEREF(__pyx_v_c);
        __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF_SET(__pyx_v_seq, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "ctff.pyx":509
 *                 if c < 0x08:
 *                     seq = [0x1b] + pbytes + ibytes + [c]
 *                     context.dispatch_invalid(seq)             # <<<<<<<<<<<<<<
 *                     state = _STATE_GROUND
 *                 elif c < 0x0e:
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_invalid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_v_seq);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_seq);
        __Pyx_GIVEREF(__pyx_v_seq);
        __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "ctff.pyx":510
 *                     seq = [0x1b] + pbytes + ibytes + [c]
 *                     context.dispatch_invalid(seq)
 *                     state = _STATE_GROUND             # <<<<<<<<<<<<<<
 *                 elif c < 0x0e:
 *                     ibytes.append(c)
 */
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_GROUND); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2);
        __pyx_t_2 = 0;
        goto __pyx_L16;
      }

      /* "ctff.pyx":511
 *                     context.dispatch_invalid(seq)
 *                     state = _STATE_GROUND
 *                 elif c < 0x0e:             # <<<<<<<<<<<<<<
 *                     ibytes.append(c)
 *                 elif c == 0x1b:
 */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_c, __pyx_int_14, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_9) {

        /* "ctff.pyx":512
 *                     state = _STATE_GROUND
 *                 elif c < 0x0e:
 *                     ibytes.append(c)             # <<<<<<<<<<<<<<
 *                 elif c == 0x1b:
 *                     state = _STATE_STR_ESC
 */
        __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_ibytes, __pyx_v_c); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L16;
      }

      /* "ctff.pyx":513
 *                 elif c < 0x0e:
 *                     ibytes.append(c)
 *                 elif c == 0x1b:             # <<<<<<<<<<<<<<
 *                     state = _STATE_STR_ESC
 *                 elif c < 0x20:
 */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_c, __pyx_int_27, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_9) {

        /* "ctff.pyx":514
 *                     ibytes.append(c)
 *                 elif c == 0x1b:
 *                     state = _STATE_STR_ESC             # <<<<<<<<<<<<<<
 *                 elif c < 0x20:
 *                     seq = [0x1b] + pbytes + ibytes + [c]
 */
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_STR_ESC); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2);
        __pyx_t_2 = 0;
        goto __pyx_L16;
      }

      /* "ctff.pyx":515
 *                 elif c == 0x1b:
 *                     state = _STATE_STR_ESC
 *                 elif c < 0x20:             # <<<<<<<<<<<<<<
 *                     seq = [0x1b] + pbytes + ibytes + [c]
 *                     context.dispatch_invalid(seq)
 */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_c, __pyx_int_32, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_9) {

        /* "ctff.pyx":516
 *                     state = _STATE_STR_ESC
 *                 elif c < 0x20:
 *                     seq = [0x1b] + pbytes + ibytes + [c]             # <<<<<<<<<<<<<<
 *                     context.dispatch_invalid(seq)
 *                     state = _STATE_GROUND
 */
        __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_int_27);
        PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_27);
        __Pyx_GIVEREF(__pyx_int_27);
        __pyx_t_7 = PyNumber_Add(__pyx_t_2, __pyx_v_pbytes); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyNumber_Add(__pyx_t_7, __pyx_v_ibytes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_v_c);
        PyList_SET_ITEM(__pyx_t_7, 0, __pyx_v_c);
        __Pyx_GIVEREF(__pyx_v_c);
        __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF_SET(__pyx_v_seq, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "ctff.pyx":517
 *                 elif c < 0x20:
 *                     seq = [0x1b] + pbytes + ibytes + [c]
 *                     context.dispatch_invalid(seq)             # <<<<<<<<<<<<<<
 *                     state = _STATE_GROUND
 *                 else:
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_invalid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_v_seq);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_seq);
        __Pyx_GIVEREF(__pyx_v_seq);
        __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "ctff.pyx":518
 *                     seq = [0x1b] + pbytes + ibytes + [c]
 *                     context.dispatch_invalid(seq)
 *                     state = _STATE_GROUND             # <<<<<<<<<<<<<<
 *                 else:
 *                     ibytes.append(c)
 */
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_GROUND); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2);
        __pyx_t_2 = 0;
        goto __pyx_L16;
      }
      /*else*/ {

        /* "ctff.pyx":520
 *                     state = _STATE_GROUND
 *                 else:
 *                     ibytes.append(c)             # <<<<<<<<<<<<<<
 * 
 *             elif state == _STATE_OSC_ESC:
 */
        __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_ibytes, __pyx_v_c); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L16:;
      goto __pyx_L5;
    }

    /* "ctff.pyx":522
 *                     ibytes.append(c)
 * 
 *             elif state == _STATE_OSC_ESC:             # <<<<<<<<<<<<<<
 *                 # parse control string
 *                 if c == 0x5c:
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_OSC_ESC); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = PyObject_RichCompare(__pyx_v_state, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_9) {

      /* "ctff.pyx":524
 *             elif state == _STATE_OSC_ESC:
 *                 # parse control string
 *                 if c == 0x5c:             # <<<<<<<<<<<<<<
 *                     context.dispatch_control_string(pbytes[0], ibytes)
 *                     state = _STATE_GROUND
 */
      __pyx_t_7 = PyObject_RichCompare(__pyx_v_c, __pyx_int_92, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_9) {

        /* "ctff.pyx":525
 *                 # parse control string
 *                 if c == 0x5c:
 *                     context.dispatch_control_string(pbytes[0], ibytes)             # <<<<<<<<<<<<<<
 *                     state = _STATE_GROUND
 *                 else:
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_control_string); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_pbytes, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_ibytes);
        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ibytes);
        __Pyx_GIVEREF(__pyx_v_ibytes);
        __pyx_t_2 = 0;
        __pyx_t_2 = PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "ctff.pyx":526
 *                 if c == 0x5c:
 *                     context.dispatch_control_string(pbytes[0], ibytes)
 *                     state = _STATE_GROUND             # <<<<<<<<<<<<<<
 *                 else:
 *                     seq = [0x1b] + pbytes + ibytes + [0x1b, c]
 */
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_GROUND); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2);
        __pyx_t_2 = 0;
        goto __pyx_L17;
      }
      /*else*/ {

        /* "ctff.pyx":528
 *                     state = _STATE_GROUND
 *                 else:
 *                     seq = [0x1b] + pbytes + ibytes + [0x1b, c]             # <<<<<<<<<<<<<<
 *                     context.dispatch_invalid(seq)
 *                     state = _STATE_GROUND
 */
        __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_int_27);
        PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_27);
        __Pyx_GIVEREF(__pyx_int_27);
        __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_pbytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_ibytes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_int_27);
        PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_27);
        __Pyx_GIVEREF(__pyx_int_27);
        __Pyx_INCREF(__pyx_v_c);
        PyList_SET_ITEM(__pyx_t_1, 1, __pyx_v_c);
        __Pyx_GIVEREF(__pyx_v_c);
        __pyx_t_7 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF_SET(__pyx_v_seq, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "ctff.pyx":529
 *                 else:
 *                     seq = [0x1b] + pbytes + ibytes + [0x1b, c]
 *                     context.dispatch_invalid(seq)             # <<<<<<<<<<<<<<
 *                     state = _STATE_GROUND
 * 
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_invalid); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_seq);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_seq);
        __Pyx_GIVEREF(__pyx_v_seq);
        __pyx_t_2 = PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "ctff.pyx":530
 *                     seq = [0x1b] + pbytes + ibytes + [0x1b, c]
 *                     context.dispatch_invalid(seq)
 *                     state = _STATE_GROUND             # <<<<<<<<<<<<<<
 * 
 *             elif state == _STATE_STR_ESC:
 */
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_GROUND); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2);
        __pyx_t_2 = 0;
      }
      __pyx_L17:;
      goto __pyx_L5;
    }

    /* "ctff.pyx":532
 *                     state = _STATE_GROUND
 * 
 *             elif state == _STATE_STR_ESC:             # <<<<<<<<<<<<<<
 *                 # parse control string
 *                 # 00/08 - 00/13, 02/00 - 07/14
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_STR_ESC); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_state, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "ctff.pyx":536
 *                 # 00/08 - 00/13, 02/00 - 07/14
 *                 #
 *                 if c == 0x5c:             # <<<<<<<<<<<<<<
 *                     context.dispatch_control_string(pbytes[0], ibytes)
 *                     state = _STATE_GROUND
 */
      __pyx_t_1 = PyObject_RichCompare(__pyx_v_c, __pyx_int_92, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_9) {

        /* "ctff.pyx":537
 *                 #
 *                 if c == 0x5c:
 *                     context.dispatch_control_string(pbytes[0], ibytes)             # <<<<<<<<<<<<<<
 *                     state = _STATE_GROUND
 *                 else:
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_control_string); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_pbytes, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_ibytes);
        PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_ibytes);
        __Pyx_GIVEREF(__pyx_v_ibytes);
        __pyx_t_2 = 0;
        __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "ctff.pyx":538
 *                 if c == 0x5c:
 *                     context.dispatch_control_string(pbytes[0], ibytes)
 *                     state = _STATE_GROUND             # <<<<<<<<<<<<<<
 *                 else:
 *                     seq = [0x1b] + pbytes + ibytes + [0x1b, c]
 */
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_GROUND); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2);
        __pyx_t_2 = 0;
        goto __pyx_L18;
      }
      /*else*/ {

        /* "ctff.pyx":540
 *                     state = _STATE_GROUND
 *                 else:
 *                     seq = [0x1b] + pbytes + ibytes + [0x1b, c]             # <<<<<<<<<<<<<<
 *                     context.dispatch_invalid(seq)
 *                     state = _STATE_GROUND
 */
        __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_int_27);
        PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_27);
        __Pyx_GIVEREF(__pyx_int_27);
        __pyx_t_7 = PyNumber_Add(__pyx_t_2, __pyx_v_pbytes); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyNumber_Add(__pyx_t_7, __pyx_v_ibytes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_int_27);
        PyList_SET_ITEM(__pyx_t_7, 0, __pyx_int_27);
        __Pyx_GIVEREF(__pyx_int_27);
        __Pyx_INCREF(__pyx_v_c);
        PyList_SET_ITEM(__pyx_t_7, 1, __pyx_v_c);
        __Pyx_GIVEREF(__pyx_v_c);
        __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF_SET(__pyx_v_seq, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "ctff.pyx":541
 *                 else:
 *                     seq = [0x1b] + pbytes + ibytes + [0x1b, c]
 *                     context.dispatch_invalid(seq)             # <<<<<<<<<<<<<<
 *                     state = _STATE_GROUND
 * 
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_invalid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_v_seq);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_seq);
        __Pyx_GIVEREF(__pyx_v_seq);
        __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "ctff.pyx":542
 *                     seq = [0x1b] + pbytes + ibytes + [0x1b, c]
 *                     context.dispatch_invalid(seq)
 *                     state = _STATE_GROUND             # <<<<<<<<<<<<<<
 * 
 *             elif state == _STATE_SS3:
 */
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_GROUND); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2);
        __pyx_t_2 = 0;
      }
      __pyx_L18:;
      goto __pyx_L5;
    }

    /* "ctff.pyx":544
 *                     state = _STATE_GROUND
 * 
 *             elif state == _STATE_SS3:             # <<<<<<<<<<<<<<
 *                 if c < 0x20:  # control character
 *                     if c == 0x1b:  # ESC
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_SS3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = PyObject_RichCompare(__pyx_v_state, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_9) {

      /* "ctff.pyx":545
 * 
 *             elif state == _STATE_SS3:
 *                 if c < 0x20:  # control character             # <<<<<<<<<<<<<<
 *                     if c == 0x1b:  # ESC
 *                         seq = [0x1b, 0x4f]
 */
      __pyx_t_7 = PyObject_RichCompare(__pyx_v_c, __pyx_int_32, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_9) {

        /* "ctff.pyx":546
 *             elif state == _STATE_SS3:
 *                 if c < 0x20:  # control character
 *                     if c == 0x1b:  # ESC             # <<<<<<<<<<<<<<
 *                         seq = [0x1b, 0x4f]
 *                         context.dispatch_invalid(seq)
 */
        __pyx_t_7 = PyObject_RichCompare(__pyx_v_c, __pyx_int_27, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (__pyx_t_9) {

          /* "ctff.pyx":547
 *                 if c < 0x20:  # control character
 *                     if c == 0x1b:  # ESC
 *                         seq = [0x1b, 0x4f]             # <<<<<<<<<<<<<<
 *                         context.dispatch_invalid(seq)
 *                         ibytes = []
 */
          __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_INCREF(__pyx_int_27);
          PyList_SET_ITEM(__pyx_t_7, 0, __pyx_int_27);
          __Pyx_GIVEREF(__pyx_int_27);
          __Pyx_INCREF(__pyx_int_79);
          PyList_SET_ITEM(__pyx_t_7, 1, __pyx_int_79);
          __Pyx_GIVEREF(__pyx_int_79);
          __Pyx_XDECREF_SET(__pyx_v_seq, __pyx_t_7);
          __pyx_t_7 = 0;

          /* "ctff.pyx":548
 *                     if c == 0x1b:  # ESC
 *                         seq = [0x1b, 0x4f]
 *                         context.dispatch_invalid(seq)             # <<<<<<<<<<<<<<
 *                         ibytes = []
 *                         state = _STATE_ESC
 */
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_invalid); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_v_seq);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_seq);
          __Pyx_GIVEREF(__pyx_v_seq);
          __pyx_t_1 = PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "ctff.pyx":549
 *                         seq = [0x1b, 0x4f]
 *                         context.dispatch_invalid(seq)
 *                         ibytes = []             # <<<<<<<<<<<<<<
 *                         state = _STATE_ESC
 *                     elif c == 0x18 or c == 0x1a:
 */
          __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF_SET(__pyx_v_ibytes, __pyx_t_1);
          __pyx_t_1 = 0;

          /* "ctff.pyx":550
 *                         context.dispatch_invalid(seq)
 *                         ibytes = []
 *                         state = _STATE_ESC             # <<<<<<<<<<<<<<
 *                     elif c == 0x18 or c == 0x1a:
 *                         seq = [0x1b, 0x4f]
 */
          __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_ESC); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_1);
          __pyx_t_1 = 0;
          goto __pyx_L20;
        }

        /* "ctff.pyx":551
 *                         ibytes = []
 *                         state = _STATE_ESC
 *                     elif c == 0x18 or c == 0x1a:             # <<<<<<<<<<<<<<
 *                         seq = [0x1b, 0x4f]
 *                         context.dispatch_invalid(seq)
 */
        __pyx_t_1 = PyObject_RichCompare(__pyx_v_c, __pyx_int_24, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (!__pyx_t_9) {
          __pyx_t_1 = PyObject_RichCompare(__pyx_v_c, __pyx_int_26, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_6 = __pyx_t_8;
        } else {
          __pyx_t_6 = __pyx_t_9;
        }
        if (__pyx_t_6) {

          /* "ctff.pyx":552
 *                         state = _STATE_ESC
 *                     elif c == 0x18 or c == 0x1a:
 *                         seq = [0x1b, 0x4f]             # <<<<<<<<<<<<<<
 *                         context.dispatch_invalid(seq)
 *                         context.dispatch_char(c)
 */
          __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_int_27);
          PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_27);
          __Pyx_GIVEREF(__pyx_int_27);
          __Pyx_INCREF(__pyx_int_79);
          PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_79);
          __Pyx_GIVEREF(__pyx_int_79);
          __Pyx_XDECREF_SET(__pyx_v_seq, __pyx_t_1);
          __pyx_t_1 = 0;

          /* "ctff.pyx":553
 *                     elif c == 0x18 or c == 0x1a:
 *                         seq = [0x1b, 0x4f]
 *                         context.dispatch_invalid(seq)             # <<<<<<<<<<<<<<
 *                         context.dispatch_char(c)
 *                         state = _STATE_GROUND
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_invalid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_v_seq);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_seq);
          __Pyx_GIVEREF(__pyx_v_seq);
          __pyx_t_7 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "ctff.pyx":554
 *                         seq = [0x1b, 0x4f]
 *                         context.dispatch_invalid(seq)
 *                         context.dispatch_char(c)             # <<<<<<<<<<<<<<
 *                         state = _STATE_GROUND
 *                     else:
 */
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_char); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_v_c);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_c);
          __Pyx_GIVEREF(__pyx_v_c);
          __pyx_t_1 = PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "ctff.pyx":555
 *                         context.dispatch_invalid(seq)
 *                         context.dispatch_char(c)
 *                         state = _STATE_GROUND             # <<<<<<<<<<<<<<
 *                     else:
 *                         context.dispatch_char(c)
 */
          __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_GROUND); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_1);
          __pyx_t_1 = 0;
          goto __pyx_L20;
        }
        /*else*/ {

          /* "ctff.pyx":557
 *                         state = _STATE_GROUND
 *                     else:
 *                         context.dispatch_char(c)             # <<<<<<<<<<<<<<
 *                 elif c < 0x7f:
 *                     context.dispatch_ss3(c)
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_char); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_v_c);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_c);
          __Pyx_GIVEREF(__pyx_v_c);
          __pyx_t_7 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __pyx_L20:;
        goto __pyx_L19;
      }

      /* "ctff.pyx":558
 *                     else:
 *                         context.dispatch_char(c)
 *                 elif c < 0x7f:             # <<<<<<<<<<<<<<
 *                     context.dispatch_ss3(c)
 *                     state = _STATE_GROUND
 */
      __pyx_t_7 = PyObject_RichCompare(__pyx_v_c, __pyx_int_127, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_6) {

        /* "ctff.pyx":559
 *                         context.dispatch_char(c)
 *                 elif c < 0x7f:
 *                     context.dispatch_ss3(c)             # <<<<<<<<<<<<<<
 *                     state = _STATE_GROUND
 *                 else:
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_ss3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_c);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_c);
        __Pyx_GIVEREF(__pyx_v_c);
        __pyx_t_1 = PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "ctff.pyx":560
 *                 elif c < 0x7f:
 *                     context.dispatch_ss3(c)
 *                     state = _STATE_GROUND             # <<<<<<<<<<<<<<
 *                 else:
 *                     seq = [0x1b, 0x4f]
 */
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_GROUND); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_1);
        __pyx_t_1 = 0;
        goto __pyx_L19;
      }
      /*else*/ {

        /* "ctff.pyx":562
 *                     state = _STATE_GROUND
 *                 else:
 *                     seq = [0x1b, 0x4f]             # <<<<<<<<<<<<<<
 *                     context.dispatch_invalid(seq)
 *                     context.dispatch_char(c)
 */
        __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_int_27);
        PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_27);
        __Pyx_GIVEREF(__pyx_int_27);
        __Pyx_INCREF(__pyx_int_79);
        PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_79);
        __Pyx_GIVEREF(__pyx_int_79);
        __Pyx_XDECREF_SET(__pyx_v_seq, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "ctff.pyx":563
 *                 else:
 *                     seq = [0x1b, 0x4f]
 *                     context.dispatch_invalid(seq)             # <<<<<<<<<<<<<<
 *                     context.dispatch_char(c)
 * 
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_invalid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_seq);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_seq);
        __Pyx_GIVEREF(__pyx_v_seq);
        __pyx_t_7 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "ctff.pyx":564
 *                     seq = [0x1b, 0x4f]
 *                     context.dispatch_invalid(seq)
 *                     context.dispatch_char(c)             # <<<<<<<<<<<<<<
 * 
 *             elif state == _STATE_SS2:
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_char); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_c);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_c);
        __Pyx_GIVEREF(__pyx_v_c);
        __pyx_t_1 = PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __pyx_L19:;
      goto __pyx_L5;
    }

    /* "ctff.pyx":566
 *                     context.dispatch_char(c)
 * 
 *             elif state == _STATE_SS2:             # <<<<<<<<<<<<<<
 *                 if c < 0x20:  # control character
 *                     if c == 0x1b:  # ESC
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_SS2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_state, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_6) {

      /* "ctff.pyx":567
 * 
 *             elif state == _STATE_SS2:
 *                 if c < 0x20:  # control character             # <<<<<<<<<<<<<<
 *                     if c == 0x1b:  # ESC
 *                         seq = [0x1b, 0x4e]
 */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_c, __pyx_int_32, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_6) {

        /* "ctff.pyx":568
 *             elif state == _STATE_SS2:
 *                 if c < 0x20:  # control character
 *                     if c == 0x1b:  # ESC             # <<<<<<<<<<<<<<
 *                         seq = [0x1b, 0x4e]
 *                         context.dispatch_invalid(seq)
 */
        __pyx_t_2 = PyObject_RichCompare(__pyx_v_c, __pyx_int_27, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (__pyx_t_6) {

          /* "ctff.pyx":569
 *                 if c < 0x20:  # control character
 *                     if c == 0x1b:  # ESC
 *                         seq = [0x1b, 0x4e]             # <<<<<<<<<<<<<<
 *                         context.dispatch_invalid(seq)
 *                         ibytes = []
 */
          __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_int_27);
          PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_27);
          __Pyx_GIVEREF(__pyx_int_27);
          __Pyx_INCREF(__pyx_int_78);
          PyList_SET_ITEM(__pyx_t_2, 1, __pyx_int_78);
          __Pyx_GIVEREF(__pyx_int_78);
          __Pyx_XDECREF_SET(__pyx_v_seq, __pyx_t_2);
          __pyx_t_2 = 0;

          /* "ctff.pyx":570
 *                     if c == 0x1b:  # ESC
 *                         seq = [0x1b, 0x4e]
 *                         context.dispatch_invalid(seq)             # <<<<<<<<<<<<<<
 *                         ibytes = []
 *                         state = _STATE_ESC
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_invalid); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_v_seq);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_seq);
          __Pyx_GIVEREF(__pyx_v_seq);
          __pyx_t_7 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "ctff.pyx":571
 *                         seq = [0x1b, 0x4e]
 *                         context.dispatch_invalid(seq)
 *                         ibytes = []             # <<<<<<<<<<<<<<
 *                         state = _STATE_ESC
 *                     elif c == 0x18 or c == 0x1a:
 */
          __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF_SET(__pyx_v_ibytes, __pyx_t_7);
          __pyx_t_7 = 0;

          /* "ctff.pyx":572
 *                         context.dispatch_invalid(seq)
 *                         ibytes = []
 *                         state = _STATE_ESC             # <<<<<<<<<<<<<<
 *                     elif c == 0x18 or c == 0x1a:
 *                         seq = [0x1b, 0x4e]
 */
          __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_ESC); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_7);
          __pyx_t_7 = 0;
          goto __pyx_L22;
        }

        /* "ctff.pyx":573
 *                         ibytes = []
 *                         state = _STATE_ESC
 *                     elif c == 0x18 or c == 0x1a:             # <<<<<<<<<<<<<<
 *                         seq = [0x1b, 0x4e]
 *                         context.dispatch_invalid(seq)
 */
        __pyx_t_7 = PyObject_RichCompare(__pyx_v_c, __pyx_int_24, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (!__pyx_t_6) {
          __pyx_t_7 = PyObject_RichCompare(__pyx_v_c, __pyx_int_26, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_8 = __pyx_t_9;
        } else {
          __pyx_t_8 = __pyx_t_6;
        }
        if (__pyx_t_8) {

          /* "ctff.pyx":574
 *                         state = _STATE_ESC
 *                     elif c == 0x18 or c == 0x1a:
 *                         seq = [0x1b, 0x4e]             # <<<<<<<<<<<<<<
 *                         context.dispatch_invalid(seq)
 *                         context.dispatch_char(c)
 */
          __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_INCREF(__pyx_int_27);
          PyList_SET_ITEM(__pyx_t_7, 0, __pyx_int_27);
          __Pyx_GIVEREF(__pyx_int_27);
          __Pyx_INCREF(__pyx_int_78);
          PyList_SET_ITEM(__pyx_t_7, 1, __pyx_int_78);
          __Pyx_GIVEREF(__pyx_int_78);
          __Pyx_XDECREF_SET(__pyx_v_seq, __pyx_t_7);
          __pyx_t_7 = 0;

          /* "ctff.pyx":575
 *                     elif c == 0x18 or c == 0x1a:
 *                         seq = [0x1b, 0x4e]
 *                         context.dispatch_invalid(seq)             # <<<<<<<<<<<<<<
 *                         context.dispatch_char(c)
 *                         state = _STATE_GROUND
 */
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_invalid); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_v_seq);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_seq);
          __Pyx_GIVEREF(__pyx_v_seq);
          __pyx_t_2 = PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "ctff.pyx":576
 *                         seq = [0x1b, 0x4e]
 *                         context.dispatch_invalid(seq)
 *                         context.dispatch_char(c)             # <<<<<<<<<<<<<<
 *                         state = _STATE_GROUND
 *                     else:
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_char); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_v_c);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_c);
          __Pyx_GIVEREF(__pyx_v_c);
          __pyx_t_7 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "ctff.pyx":577
 *                         context.dispatch_invalid(seq)
 *                         context.dispatch_char(c)
 *                         state = _STATE_GROUND             # <<<<<<<<<<<<<<
 *                     else:
 *                         context.dispatch_char(c)
 */
          __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_GROUND); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_7);
          __pyx_t_7 = 0;
          goto __pyx_L22;
        }
        /*else*/ {

          /* "ctff.pyx":579
 *                         state = _STATE_GROUND
 *                     else:
 *                         context.dispatch_char(c)             # <<<<<<<<<<<<<<
 *                 elif c < 0x7f:
 *                     context.dispatch_ss2(c)
 */
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_char); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_v_c);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_c);
          __Pyx_GIVEREF(__pyx_v_c);
          __pyx_t_2 = PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __pyx_L22:;
        goto __pyx_L21;
      }

      /* "ctff.pyx":580
 *                     else:
 *                         context.dispatch_char(c)
 *                 elif c < 0x7f:             # <<<<<<<<<<<<<<
 *                     context.dispatch_ss2(c)
 *                     state = _STATE_GROUND
 */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_c, __pyx_int_127, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_8) {

        /* "ctff.pyx":581
 *                         context.dispatch_char(c)
 *                 elif c < 0x7f:
 *                     context.dispatch_ss2(c)             # <<<<<<<<<<<<<<
 *                     state = _STATE_GROUND
 *                 else:
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_ss2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_c);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_c);
        __Pyx_GIVEREF(__pyx_v_c);
        __pyx_t_7 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "ctff.pyx":582
 *                 elif c < 0x7f:
 *                     context.dispatch_ss2(c)
 *                     state = _STATE_GROUND             # <<<<<<<<<<<<<<
 *                 else:
 *                     seq = [0x1b, 0x4f]
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_STATE_GROUND); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_7);
        __pyx_t_7 = 0;
        goto __pyx_L21;
      }
      /*else*/ {

        /* "ctff.pyx":584
 *                     state = _STATE_GROUND
 *                 else:
 *                     seq = [0x1b, 0x4f]             # <<<<<<<<<<<<<<
 *                     context.dispatch_invalid(seq)
 *                     context.dispatch_char(c)
 */
        __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_int_27);
        PyList_SET_ITEM(__pyx_t_7, 0, __pyx_int_27);
        __Pyx_GIVEREF(__pyx_int_27);
        __Pyx_INCREF(__pyx_int_79);
        PyList_SET_ITEM(__pyx_t_7, 1, __pyx_int_79);
        __Pyx_GIVEREF(__pyx_int_79);
        __Pyx_XDECREF_SET(__pyx_v_seq, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "ctff.pyx":585
 *                 else:
 *                     seq = [0x1b, 0x4f]
 *                     context.dispatch_invalid(seq)             # <<<<<<<<<<<<<<
 *                     context.dispatch_char(c)
 * 
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_invalid); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_seq);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_seq);
        __Pyx_GIVEREF(__pyx_v_seq);
        __pyx_t_2 = PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "ctff.pyx":586
 *                     seq = [0x1b, 0x4f]
 *                     context.dispatch_invalid(seq)
 *                     context.dispatch_char(c)             # <<<<<<<<<<<<<<
 * 
 *         self.__pbytes = pbytes
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_context, __pyx_n_s_dispatch_char); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_c);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_c);
        __Pyx_GIVEREF(__pyx_v_c);
        __pyx_t_7 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __pyx_L21:;
      goto __pyx_L5;
    }
    __pyx_L5:;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ctff.pyx":588
 *                     context.dispatch_char(c)
 * 
 *         self.__pbytes = pbytes             # <<<<<<<<<<<<<<
 *         self.__ibytes = ibytes
 *         self.__state = state
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_DefaultParser__pbytes, __pyx_v_pbytes) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":589
 * 
 *         self.__pbytes = pbytes
 *         self.__ibytes = ibytes             # <<<<<<<<<<<<<<
 *         self.__state = state
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_DefaultParser__ibytes, __pyx_v_ibytes) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":590
 *         self.__pbytes = pbytes
 *         self.__ibytes = ibytes
 *         self.__state = state             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_DefaultParser__state, __pyx_v_state) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":315
 *         self.__ibytes = []
 * 
 *     def parse(self, data):             # <<<<<<<<<<<<<<
 * 
 *         context = self.__context
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("ctff.DefaultParser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_context);
  __Pyx_XDECREF(__pyx_v_pbytes);
  __Pyx_XDECREF(__pyx_v_ibytes);
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XDECREF(__pyx_v_seq);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":601
 *     ''' scan input stream and iterate UCS code points '''
 * 
 *     def __init__(self, ucs4=True, termenc=None):             # <<<<<<<<<<<<<<
 *         """
 *         >>> scanner = DefaultScanner()
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_14DefaultScanner_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4ctff_14DefaultScanner___init__[] = "\n        >>> scanner = DefaultScanner()\n        >>> scanner._ucs4\n        True\n        ";
static PyMethodDef __pyx_mdef_4ctff_14DefaultScanner_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_4ctff_14DefaultScanner_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4ctff_14DefaultScanner___init__)};
static PyObject *__pyx_pw_4ctff_14DefaultScanner_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_ucs4 = 0;
  PyObject *__pyx_v_termenc = 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_ucs4,&__pyx_n_s_termenc,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)((PyObject *)Py_True));
    values[2] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ucs4);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_termenc);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_ucs4 = values[1];
    __pyx_v_termenc = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.DefaultScanner.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_14DefaultScanner___init__(__pyx_self, __pyx_v_self, __pyx_v_ucs4, __pyx_v_termenc);

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

static PyObject *__pyx_pf_4ctff_14DefaultScanner___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ucs4, PyObject *__pyx_v_termenc) {
  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("__init__", 0);

  /* "ctff.pyx":607
 *         True
 *         """
 *         self._data = None             # <<<<<<<<<<<<<<
 *         self._ucs4 = ucs4
 *         if termenc:
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_data_2, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":608
 *         """
 *         self._data = None
 *         self._ucs4 = ucs4             # <<<<<<<<<<<<<<
 *         if termenc:
 *             self._decoder = codecs.getincrementaldecoder(termenc)(errors='replace')
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ucs4_2, __pyx_v_ucs4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":609
 *         self._data = None
 *         self._ucs4 = ucs4
 *         if termenc:             # <<<<<<<<<<<<<<
 *             self._decoder = codecs.getincrementaldecoder(termenc)(errors='replace')
 *             self._termenc = termenc
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_termenc); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "ctff.pyx":610
 *         self._ucs4 = ucs4
 *         if termenc:
 *             self._decoder = codecs.getincrementaldecoder(termenc)(errors='replace')             # <<<<<<<<<<<<<<
 *             self._termenc = termenc
 *         else:
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_codecs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getincrementaldecoder); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_termenc);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_termenc);
    __Pyx_GIVEREF(__pyx_v_termenc);
    __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_errors, __pyx_n_s_replace) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_decoder, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "ctff.pyx":611
 *         if termenc:
 *             self._decoder = codecs.getincrementaldecoder(termenc)(errors='replace')
 *             self._termenc = termenc             # <<<<<<<<<<<<<<
 *         else:
 *             self._decoder = None
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_termenc_2, __pyx_v_termenc) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  /*else*/ {

    /* "ctff.pyx":613
 *             self._termenc = termenc
 *         else:
 *             self._decoder = None             # <<<<<<<<<<<<<<
 *             self._termenc = None
 * 
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_decoder, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "ctff.pyx":614
 *         else:
 *             self._decoder = None
 *             self._termenc = None             # <<<<<<<<<<<<<<
 * 
 *     # deprecated
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_termenc_2, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "ctff.pyx":601
 *     ''' scan input stream and iterate UCS code points '''
 * 
 *     def __init__(self, ucs4=True, termenc=None):             # <<<<<<<<<<<<<<
 *         """
 *         >>> scanner = DefaultScanner()
 */

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

/* "ctff.pyx":617
 * 
 *     # deprecated
 *     def assign(self, value, termenc):             # <<<<<<<<<<<<<<
 *         """
 *         >>> scanner = DefaultScanner()
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_14DefaultScanner_3assign(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4ctff_14DefaultScanner_2assign[] = "\n        >>> scanner = DefaultScanner()\n        >>> scanner.assign(\"01234\", \"ascii\")\n        >>> scanner._data\n        u'01234'\n        ";
static PyMethodDef __pyx_mdef_4ctff_14DefaultScanner_3assign = {__Pyx_NAMESTR("assign"), (PyCFunction)__pyx_pw_4ctff_14DefaultScanner_3assign, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4ctff_14DefaultScanner_2assign)};
static PyObject *__pyx_pw_4ctff_14DefaultScanner_3assign(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_termenc = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assign (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,&__pyx_n_s_termenc,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);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("assign", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_termenc)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("assign", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "assign") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __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_value = values[1];
    __pyx_v_termenc = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("assign", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.DefaultScanner.assign", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_14DefaultScanner_2assign(__pyx_self, __pyx_v_self, __pyx_v_value, __pyx_v_termenc);

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

static PyObject *__pyx_pf_4ctff_14DefaultScanner_2assign(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value, PyObject *__pyx_v_termenc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("assign", 0);

  /* "ctff.pyx":624
 *         u'01234'
 *         """
 *         if self._termenc != termenc:             # <<<<<<<<<<<<<<
 *             self._decoder = codecs.getincrementaldecoder(termenc)(errors='replace')
 *             self._termenc = termenc
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_termenc_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_v_termenc, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "ctff.pyx":625
 *         """
 *         if self._termenc != termenc:
 *             self._decoder = codecs.getincrementaldecoder(termenc)(errors='replace')             # <<<<<<<<<<<<<<
 *             self._termenc = termenc
 *         self._data = self._decoder.decode(value)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_codecs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getincrementaldecoder); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_termenc);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_termenc);
    __Pyx_GIVEREF(__pyx_v_termenc);
    __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_errors, __pyx_n_s_replace) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_decoder, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "ctff.pyx":626
 *         if self._termenc != termenc:
 *             self._decoder = codecs.getincrementaldecoder(termenc)(errors='replace')
 *             self._termenc = termenc             # <<<<<<<<<<<<<<
 *         self._data = self._decoder.decode(value)
 * 
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_termenc_2, __pyx_v_termenc) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "ctff.pyx":627
 *             self._decoder = codecs.getincrementaldecoder(termenc)(errors='replace')
 *             self._termenc = termenc
 *         self._data = self._decoder.decode(value)             # <<<<<<<<<<<<<<
 * 
 *     def continuous_assign(self, value):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_decoder); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_data_2, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":617
 * 
 *     # deprecated
 *     def assign(self, value, termenc):             # <<<<<<<<<<<<<<
 *         """
 *         >>> scanner = DefaultScanner()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("ctff.DefaultScanner.assign", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":629
 *         self._data = self._decoder.decode(value)
 * 
 *     def continuous_assign(self, value):             # <<<<<<<<<<<<<<
 *         """
 *         >>> scanner = DefaultScanner(termenc="utf-8")
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_14DefaultScanner_5continuous_assign(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4ctff_14DefaultScanner_4continuous_assign[] = "\n        >>> scanner = DefaultScanner(termenc=\"utf-8\")\n        >>> scanner.continuous_assign(\"01234\")\n        >>> scanner._data\n        u'01234'\n        ";
static PyMethodDef __pyx_mdef_4ctff_14DefaultScanner_5continuous_assign = {__Pyx_NAMESTR("continuous_assign"), (PyCFunction)__pyx_pw_4ctff_14DefaultScanner_5continuous_assign, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4ctff_14DefaultScanner_4continuous_assign)};
static PyObject *__pyx_pw_4ctff_14DefaultScanner_5continuous_assign(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 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("continuous_assign (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("continuous_assign", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "continuous_assign") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_value = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("continuous_assign", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.DefaultScanner.continuous_assign", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_14DefaultScanner_4continuous_assign(__pyx_self, __pyx_v_self, __pyx_v_value);

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

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

  /* "ctff.pyx":636
 *         u'01234'
 *         """
 *         self._data = self._decoder.decode(value)             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_decoder); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __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 (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_data_2, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ctff.pyx":629
 *         self._data = self._decoder.decode(value)
 * 
 *     def continuous_assign(self, value):             # <<<<<<<<<<<<<<
 *         """
 *         >>> scanner = DefaultScanner(termenc="utf-8")
 */

  /* 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("ctff.DefaultScanner.continuous_assign", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_4ctff_14DefaultScanner_8generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "ctff.pyx":638
 *         self._data = self._decoder.decode(value)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         >>> scanner = DefaultScanner()
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_14DefaultScanner_7__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_4ctff_14DefaultScanner_6__iter__[] = "\n        >>> scanner = DefaultScanner()\n        >>> scanner.assign(\"abcde\", \"UTF-8\")\n        >>> print [ c for c in scanner ]\n        [97, 98, 99, 100, 101]\n        ";
static PyMethodDef __pyx_mdef_4ctff_14DefaultScanner_7__iter__ = {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pw_4ctff_14DefaultScanner_7__iter__, METH_O, __Pyx_DOCSTR(__pyx_doc_4ctff_14DefaultScanner_6__iter__)};
static PyObject *__pyx_pw_4ctff_14DefaultScanner_7__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_14DefaultScanner_6__iter__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ctff_14DefaultScanner_6__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  struct __pyx_obj_4ctff___pyx_scope_struct_1___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ctff___pyx_scope_struct_1___iter__ *)__pyx_tp_new_4ctff___pyx_scope_struct_1___iter__(__pyx_ptype_4ctff___pyx_scope_struct_1___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4ctff_14DefaultScanner_8generator1, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("ctff.DefaultScanner.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4ctff_14DefaultScanner_8generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4ctff___pyx_scope_struct_1___iter__ *__pyx_cur_scope = ((struct __pyx_obj_4ctff___pyx_scope_struct_1___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L8_resume_from_yield;
    case 2: goto __pyx_L11_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":645
 *         [97, 98, 99, 100, 101]
 *         """
 *         if self._ucs4:             # <<<<<<<<<<<<<<
 *             c1 = 0
 *             for x in self._data:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_ucs4_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "ctff.pyx":646
 *         """
 *         if self._ucs4:
 *             c1 = 0             # <<<<<<<<<<<<<<
 *             for x in self._data:
 *                 c = ord(x)
 */
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    __pyx_cur_scope->__pyx_v_c1 = __pyx_int_0;

    /* "ctff.pyx":647
 *         if self._ucs4:
 *             c1 = 0
 *             for x in self._data:             # <<<<<<<<<<<<<<
 *                 c = ord(x)
 *                 if c >= 0xd800 and c <= 0xdbff:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_data_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
      __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_1 = __pyx_t_5(__pyx_t_3);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_x);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_x, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;

      /* "ctff.pyx":648
 *             c1 = 0
 *             for x in self._data:
 *                 c = ord(x)             # <<<<<<<<<<<<<<
 *                 if c >= 0xd800 and c <= 0xdbff:
 *                     c1 = c - 0xd800
 */
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_x);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_x);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_x);
      __pyx_t_6 = PyObject_Call(__pyx_builtin_ord, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_c);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_c, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;

      /* "ctff.pyx":649
 *             for x in self._data:
 *                 c = ord(x)
 *                 if c >= 0xd800 and c <= 0xdbff:             # <<<<<<<<<<<<<<
 *                     c1 = c - 0xd800
 *                     continue
 */
      __pyx_t_6 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_c, __pyx_int_55296, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_2) {
        __pyx_t_6 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_c, __pyx_int_56319, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_8 = __pyx_t_7;
      } else {
        __pyx_t_8 = __pyx_t_2;
      }
      if (__pyx_t_8) {

        /* "ctff.pyx":650
 *                 c = ord(x)
 *                 if c >= 0xd800 and c <= 0xdbff:
 *                     c1 = c - 0xd800             # <<<<<<<<<<<<<<
 *                     continue
 *                 elif c1 != 0 and c >= 0xdc00 and c <= 0xdfff:
 */
        __pyx_t_6 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_c, __pyx_int_55296); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_c1);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_c1, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        __pyx_t_6 = 0;

        /* "ctff.pyx":651
 *                 if c >= 0xd800 and c <= 0xdbff:
 *                     c1 = c - 0xd800
 *                     continue             # <<<<<<<<<<<<<<
 *                 elif c1 != 0 and c >= 0xdc00 and c <= 0xdfff:
 *                     c = 0x10000 + ((c1 << 10) | (c - 0xdc00))
 */
        goto __pyx_L5_continue;
      }

      /* "ctff.pyx":652
 *                     c1 = c - 0xd800
 *                     continue
 *                 elif c1 != 0 and c >= 0xdc00 and c <= 0xdfff:             # <<<<<<<<<<<<<<
 *                     c = 0x10000 + ((c1 << 10) | (c - 0xdc00))
 *                     c1 = 0
 */
      __pyx_t_6 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_c1, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_8) {
        __pyx_t_6 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_c, __pyx_int_56320, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_2) {
          __pyx_t_6 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_c, __pyx_int_57343, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_9 = __pyx_t_7;
        } else {
          __pyx_t_9 = __pyx_t_2;
        }
        __pyx_t_2 = __pyx_t_9;
      } else {
        __pyx_t_2 = __pyx_t_8;
      }
      if (__pyx_t_2) {

        /* "ctff.pyx":653
 *                     continue
 *                 elif c1 != 0 and c >= 0xdc00 and c <= 0xdfff:
 *                     c = 0x10000 + ((c1 << 10) | (c - 0xdc00))             # <<<<<<<<<<<<<<
 *                     c1 = 0
 *                 yield c
 */
        __pyx_t_6 = PyNumber_Lshift(__pyx_cur_scope->__pyx_v_c1, __pyx_int_10); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_1 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_c, __pyx_int_56320); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_10 = PyNumber_Or(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyNumber_Add(__pyx_int_65536, __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_c);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_c, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        __pyx_t_1 = 0;

        /* "ctff.pyx":654
 *                 elif c1 != 0 and c >= 0xdc00 and c <= 0xdfff:
 *                     c = 0x10000 + ((c1 << 10) | (c - 0xdc00))
 *                     c1 = 0             # <<<<<<<<<<<<<<
 *                 yield c
 *         else:
 */
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_c1);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_c1, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        goto __pyx_L7;
      }
      __pyx_L7:;

      /* "ctff.pyx":655
 *                     c = 0x10000 + ((c1 << 10) | (c - 0xdc00))
 *                     c1 = 0
 *                 yield c             # <<<<<<<<<<<<<<
 *         else:
 *             for x in self._data:
 */
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_c);
      __pyx_r = __pyx_cur_scope->__pyx_v_c;
      __Pyx_XGIVEREF(__pyx_t_3);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_3;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L8_resume_from_yield:;
      __pyx_t_3 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
      __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
      if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L5_continue:;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "ctff.pyx":657
 *                 yield c
 *         else:
 *             for x in self._data:             # <<<<<<<<<<<<<<
 *                 yield ord(x)
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_data_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_1)) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_1)) {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_3 = __pyx_t_5(__pyx_t_1);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_x);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_x, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;

      /* "ctff.pyx":658
 *         else:
 *             for x in self._data:
 *                 yield ord(x)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_x);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_x);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_x);
      __pyx_t_10 = PyObject_Call(__pyx_builtin_ord, __pyx_t_3, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_10;
      __pyx_t_10 = 0;
      __Pyx_XGIVEREF(__pyx_t_1);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 2;
      return __pyx_r;
      __pyx_L11_resume_from_yield:;
      __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
      __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
      if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L4:;

  /* "ctff.pyx":638
 *         self._data = self._decoder.decode(value)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         >>> scanner = DefaultScanner()
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* "ctff.pyx":669
 *     ''' default handler, pass through all ESC/CSI/string seqnceses '''
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_14DefaultHandler_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_14DefaultHandler_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_4ctff_14DefaultHandler_1__init__, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_14DefaultHandler_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_14DefaultHandler___init__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ctff_14DefaultHandler___init__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

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

/* "ctff.pyx":673
 * 
 * # EventObserver
 *     def handle_start(self, context):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_14DefaultHandler_3handle_start(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_14DefaultHandler_3handle_start = {__Pyx_NAMESTR("handle_start"), (PyCFunction)__pyx_pw_4ctff_14DefaultHandler_3handle_start, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_14DefaultHandler_3handle_start(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_context = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_start (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_start", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_start") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_context = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_start", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.DefaultHandler.handle_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_14DefaultHandler_2handle_start(__pyx_self, __pyx_v_self, __pyx_v_context);

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

static PyObject *__pyx_pf_4ctff_14DefaultHandler_2handle_start(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_start", 0);

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

/* "ctff.pyx":676
 *         pass
 * 
 *     def handle_end(self, context):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_14DefaultHandler_5handle_end(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_14DefaultHandler_5handle_end = {__Pyx_NAMESTR("handle_end"), (PyCFunction)__pyx_pw_4ctff_14DefaultHandler_5handle_end, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_14DefaultHandler_5handle_end(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_context = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_end (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_end", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_end") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_context = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_end", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.DefaultHandler.handle_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_14DefaultHandler_4handle_end(__pyx_self, __pyx_v_self, __pyx_v_context);

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

static PyObject *__pyx_pf_4ctff_14DefaultHandler_4handle_end(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_end", 0);

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

/* "ctff.pyx":679
 *         pass
 * 
 *     def handle_esc(self, context, intermediate, final):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_14DefaultHandler_7handle_esc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_14DefaultHandler_7handle_esc = {__Pyx_NAMESTR("handle_esc"), (PyCFunction)__pyx_pw_4ctff_14DefaultHandler_7handle_esc, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_14DefaultHandler_7handle_esc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_context = 0;
  CYTHON_UNUSED PyObject *__pyx_v_intermediate = 0;
  CYTHON_UNUSED PyObject *__pyx_v_final = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_esc (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,&__pyx_n_s_intermediate,&__pyx_n_s_final,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);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_esc", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_intermediate)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_esc", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_final)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_esc", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_esc") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_context = values[1];
    __pyx_v_intermediate = values[2];
    __pyx_v_final = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_esc", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.DefaultHandler.handle_esc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_14DefaultHandler_6handle_esc(__pyx_self, __pyx_v_self, __pyx_v_context, __pyx_v_intermediate, __pyx_v_final);

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

static PyObject *__pyx_pf_4ctff_14DefaultHandler_6handle_esc(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_intermediate, CYTHON_UNUSED PyObject *__pyx_v_final) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_esc", 0);

  /* "ctff.pyx":680
 * 
 *     def handle_esc(self, context, intermediate, final):
 *         return False             # <<<<<<<<<<<<<<
 * 
 *     def handle_csi(self, context, parameter, intermediate, final):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;

  /* "ctff.pyx":679
 *         pass
 * 
 *     def handle_esc(self, context, intermediate, final):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */

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

/* "ctff.pyx":682
 *         return False
 * 
 *     def handle_csi(self, context, parameter, intermediate, final):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_14DefaultHandler_9handle_csi(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_14DefaultHandler_9handle_csi = {__Pyx_NAMESTR("handle_csi"), (PyCFunction)__pyx_pw_4ctff_14DefaultHandler_9handle_csi, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_14DefaultHandler_9handle_csi(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_context = 0;
  CYTHON_UNUSED PyObject *__pyx_v_parameter = 0;
  CYTHON_UNUSED PyObject *__pyx_v_intermediate = 0;
  CYTHON_UNUSED PyObject *__pyx_v_final = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_csi (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,&__pyx_n_s_parameter,&__pyx_n_s_intermediate,&__pyx_n_s_final,0};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_csi", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parameter)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_csi", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_intermediate)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_csi", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_final)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_csi", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_csi") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_self = values[0];
    __pyx_v_context = values[1];
    __pyx_v_parameter = values[2];
    __pyx_v_intermediate = values[3];
    __pyx_v_final = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_csi", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.DefaultHandler.handle_csi", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_14DefaultHandler_8handle_csi(__pyx_self, __pyx_v_self, __pyx_v_context, __pyx_v_parameter, __pyx_v_intermediate, __pyx_v_final);

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

static PyObject *__pyx_pf_4ctff_14DefaultHandler_8handle_csi(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_parameter, CYTHON_UNUSED PyObject *__pyx_v_intermediate, CYTHON_UNUSED PyObject *__pyx_v_final) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_csi", 0);

  /* "ctff.pyx":683
 * 
 *     def handle_csi(self, context, parameter, intermediate, final):
 *         return False             # <<<<<<<<<<<<<<
 * 
 *     def handle_ss2(self, context, final):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;

  /* "ctff.pyx":682
 *         return False
 * 
 *     def handle_csi(self, context, parameter, intermediate, final):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */

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

/* "ctff.pyx":685
 *         return False
 * 
 *     def handle_ss2(self, context, final):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_14DefaultHandler_11handle_ss2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_14DefaultHandler_11handle_ss2 = {__Pyx_NAMESTR("handle_ss2"), (PyCFunction)__pyx_pw_4ctff_14DefaultHandler_11handle_ss2, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_14DefaultHandler_11handle_ss2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_context = 0;
  CYTHON_UNUSED PyObject *__pyx_v_final = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_ss2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,&__pyx_n_s_final,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);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_ss2", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_final)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_ss2", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_ss2") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __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_context = values[1];
    __pyx_v_final = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_ss2", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.DefaultHandler.handle_ss2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_14DefaultHandler_10handle_ss2(__pyx_self, __pyx_v_self, __pyx_v_context, __pyx_v_final);

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

static PyObject *__pyx_pf_4ctff_14DefaultHandler_10handle_ss2(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_final) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_ss2", 0);

  /* "ctff.pyx":686
 * 
 *     def handle_ss2(self, context, final):
 *         return False             # <<<<<<<<<<<<<<
 * 
 *     def handle_ss3(self, context, final):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;

  /* "ctff.pyx":685
 *         return False
 * 
 *     def handle_ss2(self, context, final):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */

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

/* "ctff.pyx":688
 *         return False
 * 
 *     def handle_ss3(self, context, final):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_14DefaultHandler_13handle_ss3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_14DefaultHandler_13handle_ss3 = {__Pyx_NAMESTR("handle_ss3"), (PyCFunction)__pyx_pw_4ctff_14DefaultHandler_13handle_ss3, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_14DefaultHandler_13handle_ss3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_context = 0;
  CYTHON_UNUSED PyObject *__pyx_v_final = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_ss3 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,&__pyx_n_s_final,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);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_ss3", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_final)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_ss3", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_ss3") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __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_context = values[1];
    __pyx_v_final = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_ss3", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.DefaultHandler.handle_ss3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_14DefaultHandler_12handle_ss3(__pyx_self, __pyx_v_self, __pyx_v_context, __pyx_v_final);

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

static PyObject *__pyx_pf_4ctff_14DefaultHandler_12handle_ss3(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_final) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_ss3", 0);

  /* "ctff.pyx":689
 * 
 *     def handle_ss3(self, context, final):
 *         return False             # <<<<<<<<<<<<<<
 * 
 *     def handle_control_string(self, context, prefix, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;

  /* "ctff.pyx":688
 *         return False
 * 
 *     def handle_ss3(self, context, final):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */

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

/* "ctff.pyx":691
 *         return False
 * 
 *     def handle_control_string(self, context, prefix, value):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_14DefaultHandler_15handle_control_string(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_14DefaultHandler_15handle_control_string = {__Pyx_NAMESTR("handle_control_string"), (PyCFunction)__pyx_pw_4ctff_14DefaultHandler_15handle_control_string, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_14DefaultHandler_15handle_control_string(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_context = 0;
  CYTHON_UNUSED PyObject *__pyx_v_prefix = 0;
  CYTHON_UNUSED 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("handle_control_string (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,&__pyx_n_s_prefix,&__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);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_control_string", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_control_string", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_control_string", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_control_string") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_context = values[1];
    __pyx_v_prefix = values[2];
    __pyx_v_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_control_string", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.DefaultHandler.handle_control_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_14DefaultHandler_14handle_control_string(__pyx_self, __pyx_v_self, __pyx_v_context, __pyx_v_prefix, __pyx_v_value);

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

static PyObject *__pyx_pf_4ctff_14DefaultHandler_14handle_control_string(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_prefix, CYTHON_UNUSED PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_control_string", 0);

  /* "ctff.pyx":692
 * 
 *     def handle_control_string(self, context, prefix, value):
 *         return False             # <<<<<<<<<<<<<<
 * 
 *     def handle_char(self, context, c):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;

  /* "ctff.pyx":691
 *         return False
 * 
 *     def handle_control_string(self, context, prefix, value):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */

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

/* "ctff.pyx":694
 *         return False
 * 
 *     def handle_char(self, context, c):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_14DefaultHandler_17handle_char(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_14DefaultHandler_17handle_char = {__Pyx_NAMESTR("handle_char"), (PyCFunction)__pyx_pw_4ctff_14DefaultHandler_17handle_char, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_14DefaultHandler_17handle_char(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_context = 0;
  CYTHON_UNUSED PyObject *__pyx_v_c = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_char (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,&__pyx_n_s_c,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);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_char", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_c)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_char", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_char") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __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_context = values[1];
    __pyx_v_c = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_char", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.DefaultHandler.handle_char", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_14DefaultHandler_16handle_char(__pyx_self, __pyx_v_self, __pyx_v_context, __pyx_v_c);

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

static PyObject *__pyx_pf_4ctff_14DefaultHandler_16handle_char(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_c) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_char", 0);

  /* "ctff.pyx":695
 * 
 *     def handle_char(self, context, c):
 *         return False             # <<<<<<<<<<<<<<
 * 
 *     def handle_invalid(self, context, seq):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;

  /* "ctff.pyx":694
 *         return False
 * 
 *     def handle_char(self, context, c):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */

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

/* "ctff.pyx":697
 *         return False
 * 
 *     def handle_invalid(self, context, seq):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_14DefaultHandler_19handle_invalid(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_14DefaultHandler_19handle_invalid = {__Pyx_NAMESTR("handle_invalid"), (PyCFunction)__pyx_pw_4ctff_14DefaultHandler_19handle_invalid, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_14DefaultHandler_19handle_invalid(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_context = 0;
  CYTHON_UNUSED PyObject *__pyx_v_seq = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_invalid (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,&__pyx_n_s_seq,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);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_invalid", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_invalid", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_invalid") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __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_context = values[1];
    __pyx_v_seq = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_invalid", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.DefaultHandler.handle_invalid", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_14DefaultHandler_18handle_invalid(__pyx_self, __pyx_v_self, __pyx_v_context, __pyx_v_seq);

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

static PyObject *__pyx_pf_4ctff_14DefaultHandler_18handle_invalid(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_seq) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_invalid", 0);

  /* "ctff.pyx":698
 * 
 *     def handle_invalid(self, context, seq):
 *         return False             # <<<<<<<<<<<<<<
 * 
 *     def handle_draw(self, context):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;

  /* "ctff.pyx":697
 *         return False
 * 
 *     def handle_invalid(self, context, seq):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */

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

/* "ctff.pyx":700
 *         return False
 * 
 *     def handle_draw(self, context):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_14DefaultHandler_21handle_draw(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_14DefaultHandler_21handle_draw = {__Pyx_NAMESTR("handle_draw"), (PyCFunction)__pyx_pw_4ctff_14DefaultHandler_21handle_draw, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_14DefaultHandler_21handle_draw(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_context = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_draw (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_draw", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_draw") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_context = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_draw", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.DefaultHandler.handle_draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_14DefaultHandler_20handle_draw(__pyx_self, __pyx_v_self, __pyx_v_context);

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

static PyObject *__pyx_pf_4ctff_14DefaultHandler_20handle_draw(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_draw", 0);

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

/* "ctff.pyx":703
 *         pass
 * 
 *     def handle_resize(self, context, row, col):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_14DefaultHandler_23handle_resize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_14DefaultHandler_23handle_resize = {__Pyx_NAMESTR("handle_resize"), (PyCFunction)__pyx_pw_4ctff_14DefaultHandler_23handle_resize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_14DefaultHandler_23handle_resize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_context = 0;
  CYTHON_UNUSED PyObject *__pyx_v_row = 0;
  CYTHON_UNUSED PyObject *__pyx_v_col = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_resize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,&__pyx_n_s_row,&__pyx_n_s_col,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);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_resize", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_resize", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_col)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_resize", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_resize") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_context = values[1];
    __pyx_v_row = values[2];
    __pyx_v_col = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_resize", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.DefaultHandler.handle_resize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_14DefaultHandler_22handle_resize(__pyx_self, __pyx_v_self, __pyx_v_context, __pyx_v_row, __pyx_v_col);

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

static PyObject *__pyx_pf_4ctff_14DefaultHandler_22handle_resize(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_row, CYTHON_UNUSED PyObject *__pyx_v_col) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_resize", 0);

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

/* "ctff.pyx":713
 * class FilterMultiplexer(EventObserver):
 * 
 *     def __init__(self, lhs, rhs):             # <<<<<<<<<<<<<<
 *         self.__lhs = lhs
 *         self.__rhs = rhs
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_17FilterMultiplexer_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_17FilterMultiplexer_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_4ctff_17FilterMultiplexer_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_17FilterMultiplexer_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_lhs = 0;
  PyObject *__pyx_v_rhs = 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_lhs,&__pyx_n_s_rhs,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);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lhs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __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_lhs = values[1];
    __pyx_v_rhs = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.FilterMultiplexer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_17FilterMultiplexer___init__(__pyx_self, __pyx_v_self, __pyx_v_lhs, __pyx_v_rhs);

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

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

  /* "ctff.pyx":714
 * 
 *     def __init__(self, lhs, rhs):
 *         self.__lhs = lhs             # <<<<<<<<<<<<<<
 *         self.__rhs = rhs
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_FilterMultiplexer__lhs, __pyx_v_lhs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":715
 *     def __init__(self, lhs, rhs):
 *         self.__lhs = lhs
 *         self.__rhs = rhs             # <<<<<<<<<<<<<<
 * 
 *     def get_lhs(self):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_FilterMultiplexer__rhs, __pyx_v_rhs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":713
 * class FilterMultiplexer(EventObserver):
 * 
 *     def __init__(self, lhs, rhs):             # <<<<<<<<<<<<<<
 *         self.__lhs = lhs
 *         self.__rhs = rhs
 */

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

/* "ctff.pyx":717
 *         self.__rhs = rhs
 * 
 *     def get_lhs(self):             # <<<<<<<<<<<<<<
 *         return self.__lhs
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_17FilterMultiplexer_3get_lhs(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_17FilterMultiplexer_3get_lhs = {__Pyx_NAMESTR("get_lhs"), (PyCFunction)__pyx_pw_4ctff_17FilterMultiplexer_3get_lhs, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_17FilterMultiplexer_3get_lhs(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_lhs (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_17FilterMultiplexer_2get_lhs(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "ctff.pyx":718
 * 
 *     def get_lhs(self):
 *         return self.__lhs             # <<<<<<<<<<<<<<
 * 
 *     def get_rhs(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FilterMultiplexer__lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "ctff.pyx":717
 *         self.__rhs = rhs
 * 
 *     def get_lhs(self):             # <<<<<<<<<<<<<<
 *         return self.__lhs
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("ctff.FilterMultiplexer.get_lhs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":720
 *         return self.__lhs
 * 
 *     def get_rhs(self):             # <<<<<<<<<<<<<<
 *         return self.__rhs
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_17FilterMultiplexer_5get_rhs(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_17FilterMultiplexer_5get_rhs = {__Pyx_NAMESTR("get_rhs"), (PyCFunction)__pyx_pw_4ctff_17FilterMultiplexer_5get_rhs, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_17FilterMultiplexer_5get_rhs(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_rhs (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_17FilterMultiplexer_4get_rhs(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "ctff.pyx":721
 * 
 *     def get_rhs(self):
 *         return self.__rhs             # <<<<<<<<<<<<<<
 * 
 *     def handle_start(self, context):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FilterMultiplexer__rhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "ctff.pyx":720
 *         return self.__lhs
 * 
 *     def get_rhs(self):             # <<<<<<<<<<<<<<
 *         return self.__rhs
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("ctff.FilterMultiplexer.get_rhs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":723
 *         return self.__rhs
 * 
 *     def handle_start(self, context):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_start(context)
 *         handled_rhs = self.__rhs.handle_start(context)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_17FilterMultiplexer_7handle_start(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_17FilterMultiplexer_7handle_start = {__Pyx_NAMESTR("handle_start"), (PyCFunction)__pyx_pw_4ctff_17FilterMultiplexer_7handle_start, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_17FilterMultiplexer_7handle_start(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_context = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_start (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_start", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_start") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_context = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_start", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.FilterMultiplexer.handle_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_17FilterMultiplexer_6handle_start(__pyx_self, __pyx_v_self, __pyx_v_context);

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

static PyObject *__pyx_pf_4ctff_17FilterMultiplexer_6handle_start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_context) {
  PyObject *__pyx_v_handled_lhs = NULL;
  PyObject *__pyx_v_handled_rhs = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("handle_start", 0);

  /* "ctff.pyx":724
 * 
 *     def handle_start(self, context):
 *         handled_lhs = self.__lhs.handle_start(context)             # <<<<<<<<<<<<<<
 *         handled_rhs = self.__rhs.handle_start(context)
 *         return handled_lhs and handled_rhs
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FilterMultiplexer__lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_context);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_context);
  __Pyx_GIVEREF(__pyx_v_context);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_handled_lhs = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ctff.pyx":725
 *     def handle_start(self, context):
 *         handled_lhs = self.__lhs.handle_start(context)
 *         handled_rhs = self.__rhs.handle_start(context)             # <<<<<<<<<<<<<<
 *         return handled_lhs and handled_rhs
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FilterMultiplexer__rhs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_handle_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_context);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_context);
  __Pyx_GIVEREF(__pyx_v_context);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_handled_rhs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "ctff.pyx":726
 *         handled_lhs = self.__lhs.handle_start(context)
 *         handled_rhs = self.__rhs.handle_start(context)
 *         return handled_lhs and handled_rhs             # <<<<<<<<<<<<<<
 * 
 *     def handle_end(self, context):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_handled_lhs); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {
    __Pyx_INCREF(__pyx_v_handled_rhs);
    __pyx_t_2 = __pyx_v_handled_rhs;
  } else {
    __Pyx_INCREF(__pyx_v_handled_lhs);
    __pyx_t_2 = __pyx_v_handled_lhs;
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "ctff.pyx":723
 *         return self.__rhs
 * 
 *     def handle_start(self, context):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_start(context)
 *         handled_rhs = self.__rhs.handle_start(context)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("ctff.FilterMultiplexer.handle_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_handled_lhs);
  __Pyx_XDECREF(__pyx_v_handled_rhs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":728
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_end(self, context):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_end(context)
 *         handled_rhs = self.__rhs.handle_end(context)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_17FilterMultiplexer_9handle_end(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_17FilterMultiplexer_9handle_end = {__Pyx_NAMESTR("handle_end"), (PyCFunction)__pyx_pw_4ctff_17FilterMultiplexer_9handle_end, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_17FilterMultiplexer_9handle_end(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_context = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_end (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_end", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_end") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_context = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_end", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.FilterMultiplexer.handle_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_17FilterMultiplexer_8handle_end(__pyx_self, __pyx_v_self, __pyx_v_context);

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

static PyObject *__pyx_pf_4ctff_17FilterMultiplexer_8handle_end(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_context) {
  PyObject *__pyx_v_handled_lhs = NULL;
  PyObject *__pyx_v_handled_rhs = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("handle_end", 0);

  /* "ctff.pyx":729
 * 
 *     def handle_end(self, context):
 *         handled_lhs = self.__lhs.handle_end(context)             # <<<<<<<<<<<<<<
 *         handled_rhs = self.__rhs.handle_end(context)
 *         return handled_lhs and handled_rhs
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FilterMultiplexer__lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_end); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_context);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_context);
  __Pyx_GIVEREF(__pyx_v_context);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_handled_lhs = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ctff.pyx":730
 *     def handle_end(self, context):
 *         handled_lhs = self.__lhs.handle_end(context)
 *         handled_rhs = self.__rhs.handle_end(context)             # <<<<<<<<<<<<<<
 *         return handled_lhs and handled_rhs
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FilterMultiplexer__rhs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_handle_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_context);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_context);
  __Pyx_GIVEREF(__pyx_v_context);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_handled_rhs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "ctff.pyx":731
 *         handled_lhs = self.__lhs.handle_end(context)
 *         handled_rhs = self.__rhs.handle_end(context)
 *         return handled_lhs and handled_rhs             # <<<<<<<<<<<<<<
 * 
 *     def handle_flush(self, context):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_handled_lhs); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {
    __Pyx_INCREF(__pyx_v_handled_rhs);
    __pyx_t_2 = __pyx_v_handled_rhs;
  } else {
    __Pyx_INCREF(__pyx_v_handled_lhs);
    __pyx_t_2 = __pyx_v_handled_lhs;
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "ctff.pyx":728
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_end(self, context):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_end(context)
 *         handled_rhs = self.__rhs.handle_end(context)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("ctff.FilterMultiplexer.handle_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_handled_lhs);
  __Pyx_XDECREF(__pyx_v_handled_rhs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":733
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_flush(self, context):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_flush(context)
 *         handled_rhs = self.__rhs.handle_flush(context)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_17FilterMultiplexer_11handle_flush(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_17FilterMultiplexer_11handle_flush = {__Pyx_NAMESTR("handle_flush"), (PyCFunction)__pyx_pw_4ctff_17FilterMultiplexer_11handle_flush, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_17FilterMultiplexer_11handle_flush(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_context = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_flush (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_flush", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_flush") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_context = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_flush", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.FilterMultiplexer.handle_flush", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_17FilterMultiplexer_10handle_flush(__pyx_self, __pyx_v_self, __pyx_v_context);

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

static PyObject *__pyx_pf_4ctff_17FilterMultiplexer_10handle_flush(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_context) {
  PyObject *__pyx_v_handled_lhs = NULL;
  PyObject *__pyx_v_handled_rhs = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("handle_flush", 0);

  /* "ctff.pyx":734
 * 
 *     def handle_flush(self, context):
 *         handled_lhs = self.__lhs.handle_flush(context)             # <<<<<<<<<<<<<<
 *         handled_rhs = self.__rhs.handle_flush(context)
 *         return handled_lhs and handled_rhs
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FilterMultiplexer__lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_context);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_context);
  __Pyx_GIVEREF(__pyx_v_context);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_handled_lhs = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ctff.pyx":735
 *     def handle_flush(self, context):
 *         handled_lhs = self.__lhs.handle_flush(context)
 *         handled_rhs = self.__rhs.handle_flush(context)             # <<<<<<<<<<<<<<
 *         return handled_lhs and handled_rhs
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FilterMultiplexer__rhs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_handle_flush); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_context);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_context);
  __Pyx_GIVEREF(__pyx_v_context);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_handled_rhs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "ctff.pyx":736
 *         handled_lhs = self.__lhs.handle_flush(context)
 *         handled_rhs = self.__rhs.handle_flush(context)
 *         return handled_lhs and handled_rhs             # <<<<<<<<<<<<<<
 * 
 *     def handle_csi(self, context, params, intermediate, final):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_handled_lhs); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {
    __Pyx_INCREF(__pyx_v_handled_rhs);
    __pyx_t_2 = __pyx_v_handled_rhs;
  } else {
    __Pyx_INCREF(__pyx_v_handled_lhs);
    __pyx_t_2 = __pyx_v_handled_lhs;
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "ctff.pyx":733
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_flush(self, context):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_flush(context)
 *         handled_rhs = self.__rhs.handle_flush(context)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("ctff.FilterMultiplexer.handle_flush", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_handled_lhs);
  __Pyx_XDECREF(__pyx_v_handled_rhs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":738
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_csi(self, context, params, intermediate, final):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_csi(context, params,
 *                                             intermediate, final)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_17FilterMultiplexer_13handle_csi(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_17FilterMultiplexer_13handle_csi = {__Pyx_NAMESTR("handle_csi"), (PyCFunction)__pyx_pw_4ctff_17FilterMultiplexer_13handle_csi, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_17FilterMultiplexer_13handle_csi(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_context = 0;
  PyObject *__pyx_v_params = 0;
  PyObject *__pyx_v_intermediate = 0;
  PyObject *__pyx_v_final = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_csi (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,&__pyx_n_s_params,&__pyx_n_s_intermediate,&__pyx_n_s_final,0};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_csi", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_params)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_csi", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_intermediate)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_csi", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_final)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_csi", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_csi") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_self = values[0];
    __pyx_v_context = values[1];
    __pyx_v_params = values[2];
    __pyx_v_intermediate = values[3];
    __pyx_v_final = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_csi", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.FilterMultiplexer.handle_csi", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_17FilterMultiplexer_12handle_csi(__pyx_self, __pyx_v_self, __pyx_v_context, __pyx_v_params, __pyx_v_intermediate, __pyx_v_final);

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

static PyObject *__pyx_pf_4ctff_17FilterMultiplexer_12handle_csi(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_params, PyObject *__pyx_v_intermediate, PyObject *__pyx_v_final) {
  PyObject *__pyx_v_handled_lhs = NULL;
  PyObject *__pyx_v_handled_rhs = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("handle_csi", 0);

  /* "ctff.pyx":739
 * 
 *     def handle_csi(self, context, params, intermediate, final):
 *         handled_lhs = self.__lhs.handle_csi(context, params,             # <<<<<<<<<<<<<<
 *                                             intermediate, final)
 *         handled_rhs = self.__rhs.handle_csi(context, params,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FilterMultiplexer__lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_csi); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":740
 *     def handle_csi(self, context, params, intermediate, final):
 *         handled_lhs = self.__lhs.handle_csi(context, params,
 *                                             intermediate, final)             # <<<<<<<<<<<<<<
 *         handled_rhs = self.__rhs.handle_csi(context, params,
 *                                             intermediate, final)
 */
  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_context);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_context);
  __Pyx_GIVEREF(__pyx_v_context);
  __Pyx_INCREF(__pyx_v_params);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_params);
  __Pyx_GIVEREF(__pyx_v_params);
  __Pyx_INCREF(__pyx_v_intermediate);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_intermediate);
  __Pyx_GIVEREF(__pyx_v_intermediate);
  __Pyx_INCREF(__pyx_v_final);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_final);
  __Pyx_GIVEREF(__pyx_v_final);

  /* "ctff.pyx":739
 * 
 *     def handle_csi(self, context, params, intermediate, final):
 *         handled_lhs = self.__lhs.handle_csi(context, params,             # <<<<<<<<<<<<<<
 *                                             intermediate, final)
 *         handled_rhs = self.__rhs.handle_csi(context, params,
 */
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_handled_lhs = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ctff.pyx":741
 *         handled_lhs = self.__lhs.handle_csi(context, params,
 *                                             intermediate, final)
 *         handled_rhs = self.__rhs.handle_csi(context, params,             # <<<<<<<<<<<<<<
 *                                             intermediate, final)
 *         return handled_lhs and handled_rhs
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FilterMultiplexer__rhs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_handle_csi); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ctff.pyx":742
 *                                             intermediate, final)
 *         handled_rhs = self.__rhs.handle_csi(context, params,
 *                                             intermediate, final)             # <<<<<<<<<<<<<<
 *         return handled_lhs and handled_rhs
 * 
 */
  __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_context);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_context);
  __Pyx_GIVEREF(__pyx_v_context);
  __Pyx_INCREF(__pyx_v_params);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_params);
  __Pyx_GIVEREF(__pyx_v_params);
  __Pyx_INCREF(__pyx_v_intermediate);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_intermediate);
  __Pyx_GIVEREF(__pyx_v_intermediate);
  __Pyx_INCREF(__pyx_v_final);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_final);
  __Pyx_GIVEREF(__pyx_v_final);

  /* "ctff.pyx":741
 *         handled_lhs = self.__lhs.handle_csi(context, params,
 *                                             intermediate, final)
 *         handled_rhs = self.__rhs.handle_csi(context, params,             # <<<<<<<<<<<<<<
 *                                             intermediate, final)
 *         return handled_lhs and handled_rhs
 */
  __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_handled_rhs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "ctff.pyx":743
 *         handled_rhs = self.__rhs.handle_csi(context, params,
 *                                             intermediate, final)
 *         return handled_lhs and handled_rhs             # <<<<<<<<<<<<<<
 * 
 *     def handle_esc(self, context, intermediate, final):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_handled_lhs); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {
    __Pyx_INCREF(__pyx_v_handled_rhs);
    __pyx_t_2 = __pyx_v_handled_rhs;
  } else {
    __Pyx_INCREF(__pyx_v_handled_lhs);
    __pyx_t_2 = __pyx_v_handled_lhs;
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "ctff.pyx":738
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_csi(self, context, params, intermediate, final):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_csi(context, params,
 *                                             intermediate, final)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("ctff.FilterMultiplexer.handle_csi", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_handled_lhs);
  __Pyx_XDECREF(__pyx_v_handled_rhs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":745
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_esc(self, context, intermediate, final):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_esc(context, intermediate, final)
 *         handled_rhs = self.__rhs.handle_esc(context, intermediate, final)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_17FilterMultiplexer_15handle_esc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_17FilterMultiplexer_15handle_esc = {__Pyx_NAMESTR("handle_esc"), (PyCFunction)__pyx_pw_4ctff_17FilterMultiplexer_15handle_esc, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_17FilterMultiplexer_15handle_esc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_context = 0;
  PyObject *__pyx_v_intermediate = 0;
  PyObject *__pyx_v_final = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_esc (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,&__pyx_n_s_intermediate,&__pyx_n_s_final,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);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_esc", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_intermediate)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_esc", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_final)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_esc", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_esc") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_context = values[1];
    __pyx_v_intermediate = values[2];
    __pyx_v_final = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_esc", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.FilterMultiplexer.handle_esc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_17FilterMultiplexer_14handle_esc(__pyx_self, __pyx_v_self, __pyx_v_context, __pyx_v_intermediate, __pyx_v_final);

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

static PyObject *__pyx_pf_4ctff_17FilterMultiplexer_14handle_esc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_intermediate, PyObject *__pyx_v_final) {
  PyObject *__pyx_v_handled_lhs = NULL;
  PyObject *__pyx_v_handled_rhs = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("handle_esc", 0);

  /* "ctff.pyx":746
 * 
 *     def handle_esc(self, context, intermediate, final):
 *         handled_lhs = self.__lhs.handle_esc(context, intermediate, final)             # <<<<<<<<<<<<<<
 *         handled_rhs = self.__rhs.handle_esc(context, intermediate, final)
 *         return handled_lhs and handled_rhs
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FilterMultiplexer__lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_esc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_context);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_context);
  __Pyx_GIVEREF(__pyx_v_context);
  __Pyx_INCREF(__pyx_v_intermediate);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_intermediate);
  __Pyx_GIVEREF(__pyx_v_intermediate);
  __Pyx_INCREF(__pyx_v_final);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_final);
  __Pyx_GIVEREF(__pyx_v_final);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_handled_lhs = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ctff.pyx":747
 *     def handle_esc(self, context, intermediate, final):
 *         handled_lhs = self.__lhs.handle_esc(context, intermediate, final)
 *         handled_rhs = self.__rhs.handle_esc(context, intermediate, final)             # <<<<<<<<<<<<<<
 *         return handled_lhs and handled_rhs
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FilterMultiplexer__rhs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_handle_esc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_context);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_context);
  __Pyx_GIVEREF(__pyx_v_context);
  __Pyx_INCREF(__pyx_v_intermediate);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_intermediate);
  __Pyx_GIVEREF(__pyx_v_intermediate);
  __Pyx_INCREF(__pyx_v_final);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_final);
  __Pyx_GIVEREF(__pyx_v_final);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_handled_rhs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "ctff.pyx":748
 *         handled_lhs = self.__lhs.handle_esc(context, intermediate, final)
 *         handled_rhs = self.__rhs.handle_esc(context, intermediate, final)
 *         return handled_lhs and handled_rhs             # <<<<<<<<<<<<<<
 * 
 *     def handle_ss2(self, context, final):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_handled_lhs); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {
    __Pyx_INCREF(__pyx_v_handled_rhs);
    __pyx_t_2 = __pyx_v_handled_rhs;
  } else {
    __Pyx_INCREF(__pyx_v_handled_lhs);
    __pyx_t_2 = __pyx_v_handled_lhs;
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "ctff.pyx":745
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_esc(self, context, intermediate, final):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_esc(context, intermediate, final)
 *         handled_rhs = self.__rhs.handle_esc(context, intermediate, final)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("ctff.FilterMultiplexer.handle_esc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_handled_lhs);
  __Pyx_XDECREF(__pyx_v_handled_rhs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":750
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_ss2(self, context, final):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_ss2(context, final)
 *         handled_rhs = self.__rhs.handle_ss2(context, final)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_17FilterMultiplexer_17handle_ss2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_17FilterMultiplexer_17handle_ss2 = {__Pyx_NAMESTR("handle_ss2"), (PyCFunction)__pyx_pw_4ctff_17FilterMultiplexer_17handle_ss2, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_17FilterMultiplexer_17handle_ss2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_context = 0;
  PyObject *__pyx_v_final = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_ss2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,&__pyx_n_s_final,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);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_ss2", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_final)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_ss2", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_ss2") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __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_context = values[1];
    __pyx_v_final = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_ss2", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.FilterMultiplexer.handle_ss2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_17FilterMultiplexer_16handle_ss2(__pyx_self, __pyx_v_self, __pyx_v_context, __pyx_v_final);

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

static PyObject *__pyx_pf_4ctff_17FilterMultiplexer_16handle_ss2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_final) {
  PyObject *__pyx_v_handled_lhs = NULL;
  PyObject *__pyx_v_handled_rhs = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("handle_ss2", 0);

  /* "ctff.pyx":751
 * 
 *     def handle_ss2(self, context, final):
 *         handled_lhs = self.__lhs.handle_ss2(context, final)             # <<<<<<<<<<<<<<
 *         handled_rhs = self.__rhs.handle_ss2(context, final)
 *         return handled_lhs and handled_rhs
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FilterMultiplexer__lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_ss2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_context);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_context);
  __Pyx_GIVEREF(__pyx_v_context);
  __Pyx_INCREF(__pyx_v_final);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_final);
  __Pyx_GIVEREF(__pyx_v_final);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_handled_lhs = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ctff.pyx":752
 *     def handle_ss2(self, context, final):
 *         handled_lhs = self.__lhs.handle_ss2(context, final)
 *         handled_rhs = self.__rhs.handle_ss2(context, final)             # <<<<<<<<<<<<<<
 *         return handled_lhs and handled_rhs
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FilterMultiplexer__rhs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_handle_ss2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_context);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_context);
  __Pyx_GIVEREF(__pyx_v_context);
  __Pyx_INCREF(__pyx_v_final);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_final);
  __Pyx_GIVEREF(__pyx_v_final);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_handled_rhs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "ctff.pyx":753
 *         handled_lhs = self.__lhs.handle_ss2(context, final)
 *         handled_rhs = self.__rhs.handle_ss2(context, final)
 *         return handled_lhs and handled_rhs             # <<<<<<<<<<<<<<
 * 
 *     def handle_ss3(self, context, final):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_handled_lhs); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {
    __Pyx_INCREF(__pyx_v_handled_rhs);
    __pyx_t_2 = __pyx_v_handled_rhs;
  } else {
    __Pyx_INCREF(__pyx_v_handled_lhs);
    __pyx_t_2 = __pyx_v_handled_lhs;
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "ctff.pyx":750
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_ss2(self, context, final):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_ss2(context, final)
 *         handled_rhs = self.__rhs.handle_ss2(context, final)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("ctff.FilterMultiplexer.handle_ss2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_handled_lhs);
  __Pyx_XDECREF(__pyx_v_handled_rhs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":755
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_ss3(self, context, final):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_ss3(context, final)
 *         handled_rhs = self.__rhs.handle_ss3(context, final)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_17FilterMultiplexer_19handle_ss3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_17FilterMultiplexer_19handle_ss3 = {__Pyx_NAMESTR("handle_ss3"), (PyCFunction)__pyx_pw_4ctff_17FilterMultiplexer_19handle_ss3, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_17FilterMultiplexer_19handle_ss3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_context = 0;
  PyObject *__pyx_v_final = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_ss3 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,&__pyx_n_s_final,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);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_ss3", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_final)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_ss3", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_ss3") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __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_context = values[1];
    __pyx_v_final = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_ss3", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.FilterMultiplexer.handle_ss3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_17FilterMultiplexer_18handle_ss3(__pyx_self, __pyx_v_self, __pyx_v_context, __pyx_v_final);

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

static PyObject *__pyx_pf_4ctff_17FilterMultiplexer_18handle_ss3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_final) {
  PyObject *__pyx_v_handled_lhs = NULL;
  PyObject *__pyx_v_handled_rhs = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("handle_ss3", 0);

  /* "ctff.pyx":756
 * 
 *     def handle_ss3(self, context, final):
 *         handled_lhs = self.__lhs.handle_ss3(context, final)             # <<<<<<<<<<<<<<
 *         handled_rhs = self.__rhs.handle_ss3(context, final)
 *         return handled_lhs and handled_rhs
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FilterMultiplexer__lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_ss3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_context);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_context);
  __Pyx_GIVEREF(__pyx_v_context);
  __Pyx_INCREF(__pyx_v_final);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_final);
  __Pyx_GIVEREF(__pyx_v_final);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_handled_lhs = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ctff.pyx":757
 *     def handle_ss3(self, context, final):
 *         handled_lhs = self.__lhs.handle_ss3(context, final)
 *         handled_rhs = self.__rhs.handle_ss3(context, final)             # <<<<<<<<<<<<<<
 *         return handled_lhs and handled_rhs
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FilterMultiplexer__rhs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_handle_ss3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_context);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_context);
  __Pyx_GIVEREF(__pyx_v_context);
  __Pyx_INCREF(__pyx_v_final);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_final);
  __Pyx_GIVEREF(__pyx_v_final);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_handled_rhs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "ctff.pyx":758
 *         handled_lhs = self.__lhs.handle_ss3(context, final)
 *         handled_rhs = self.__rhs.handle_ss3(context, final)
 *         return handled_lhs and handled_rhs             # <<<<<<<<<<<<<<
 * 
 *     def handle_control_string(self, context, prefix, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_handled_lhs); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {
    __Pyx_INCREF(__pyx_v_handled_rhs);
    __pyx_t_2 = __pyx_v_handled_rhs;
  } else {
    __Pyx_INCREF(__pyx_v_handled_lhs);
    __pyx_t_2 = __pyx_v_handled_lhs;
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "ctff.pyx":755
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_ss3(self, context, final):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_ss3(context, final)
 *         handled_rhs = self.__rhs.handle_ss3(context, final)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("ctff.FilterMultiplexer.handle_ss3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_handled_lhs);
  __Pyx_XDECREF(__pyx_v_handled_rhs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":760
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_control_string(self, context, prefix, value):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_control_string(context, prefix, value)
 *         handled_rhs = self.__rhs.handle_control_string(context, prefix, value)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_17FilterMultiplexer_21handle_control_string(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_17FilterMultiplexer_21handle_control_string = {__Pyx_NAMESTR("handle_control_string"), (PyCFunction)__pyx_pw_4ctff_17FilterMultiplexer_21handle_control_string, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_17FilterMultiplexer_21handle_control_string(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_context = 0;
  PyObject *__pyx_v_prefix = 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("handle_control_string (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,&__pyx_n_s_prefix,&__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);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_control_string", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_control_string", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_control_string", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_control_string") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_context = values[1];
    __pyx_v_prefix = values[2];
    __pyx_v_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_control_string", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.FilterMultiplexer.handle_control_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_17FilterMultiplexer_20handle_control_string(__pyx_self, __pyx_v_self, __pyx_v_context, __pyx_v_prefix, __pyx_v_value);

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

static PyObject *__pyx_pf_4ctff_17FilterMultiplexer_20handle_control_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_prefix, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_handled_lhs = NULL;
  PyObject *__pyx_v_handled_rhs = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("handle_control_string", 0);

  /* "ctff.pyx":761
 * 
 *     def handle_control_string(self, context, prefix, value):
 *         handled_lhs = self.__lhs.handle_control_string(context, prefix, value)             # <<<<<<<<<<<<<<
 *         handled_rhs = self.__rhs.handle_control_string(context, prefix, value)
 *         return handled_lhs and handled_rhs
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FilterMultiplexer__lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_control_string); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_context);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_context);
  __Pyx_GIVEREF(__pyx_v_context);
  __Pyx_INCREF(__pyx_v_prefix);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_prefix);
  __Pyx_GIVEREF(__pyx_v_prefix);
  __Pyx_INCREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_handled_lhs = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ctff.pyx":762
 *     def handle_control_string(self, context, prefix, value):
 *         handled_lhs = self.__lhs.handle_control_string(context, prefix, value)
 *         handled_rhs = self.__rhs.handle_control_string(context, prefix, value)             # <<<<<<<<<<<<<<
 *         return handled_lhs and handled_rhs
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FilterMultiplexer__rhs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_handle_control_string); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_context);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_context);
  __Pyx_GIVEREF(__pyx_v_context);
  __Pyx_INCREF(__pyx_v_prefix);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_prefix);
  __Pyx_GIVEREF(__pyx_v_prefix);
  __Pyx_INCREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_handled_rhs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "ctff.pyx":763
 *         handled_lhs = self.__lhs.handle_control_string(context, prefix, value)
 *         handled_rhs = self.__rhs.handle_control_string(context, prefix, value)
 *         return handled_lhs and handled_rhs             # <<<<<<<<<<<<<<
 * 
 *     def handle_char(self, context, c):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_handled_lhs); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {
    __Pyx_INCREF(__pyx_v_handled_rhs);
    __pyx_t_2 = __pyx_v_handled_rhs;
  } else {
    __Pyx_INCREF(__pyx_v_handled_lhs);
    __pyx_t_2 = __pyx_v_handled_lhs;
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "ctff.pyx":760
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_control_string(self, context, prefix, value):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_control_string(context, prefix, value)
 *         handled_rhs = self.__rhs.handle_control_string(context, prefix, value)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("ctff.FilterMultiplexer.handle_control_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_handled_lhs);
  __Pyx_XDECREF(__pyx_v_handled_rhs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":765
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_char(self, context, c):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_char(context, c)
 *         handled_rhs = self.__rhs.handle_char(context, c)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_17FilterMultiplexer_23handle_char(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_17FilterMultiplexer_23handle_char = {__Pyx_NAMESTR("handle_char"), (PyCFunction)__pyx_pw_4ctff_17FilterMultiplexer_23handle_char, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_17FilterMultiplexer_23handle_char(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_context = 0;
  PyObject *__pyx_v_c = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_char (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,&__pyx_n_s_c,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);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_char", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_c)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_char", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_char") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __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_context = values[1];
    __pyx_v_c = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_char", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.FilterMultiplexer.handle_char", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_17FilterMultiplexer_22handle_char(__pyx_self, __pyx_v_self, __pyx_v_context, __pyx_v_c);

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

static PyObject *__pyx_pf_4ctff_17FilterMultiplexer_22handle_char(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_c) {
  PyObject *__pyx_v_handled_lhs = NULL;
  PyObject *__pyx_v_handled_rhs = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("handle_char", 0);

  /* "ctff.pyx":766
 * 
 *     def handle_char(self, context, c):
 *         handled_lhs = self.__lhs.handle_char(context, c)             # <<<<<<<<<<<<<<
 *         handled_rhs = self.__rhs.handle_char(context, c)
 *         return handled_lhs and handled_rhs
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FilterMultiplexer__lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_char); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_context);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_context);
  __Pyx_GIVEREF(__pyx_v_context);
  __Pyx_INCREF(__pyx_v_c);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_c);
  __Pyx_GIVEREF(__pyx_v_c);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_handled_lhs = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ctff.pyx":767
 *     def handle_char(self, context, c):
 *         handled_lhs = self.__lhs.handle_char(context, c)
 *         handled_rhs = self.__rhs.handle_char(context, c)             # <<<<<<<<<<<<<<
 *         return handled_lhs and handled_rhs
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FilterMultiplexer__rhs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_handle_char); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_context);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_context);
  __Pyx_GIVEREF(__pyx_v_context);
  __Pyx_INCREF(__pyx_v_c);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_c);
  __Pyx_GIVEREF(__pyx_v_c);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_handled_rhs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "ctff.pyx":768
 *         handled_lhs = self.__lhs.handle_char(context, c)
 *         handled_rhs = self.__rhs.handle_char(context, c)
 *         return handled_lhs and handled_rhs             # <<<<<<<<<<<<<<
 * 
 *     def handle_invalid(self, context, seq):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_handled_lhs); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {
    __Pyx_INCREF(__pyx_v_handled_rhs);
    __pyx_t_2 = __pyx_v_handled_rhs;
  } else {
    __Pyx_INCREF(__pyx_v_handled_lhs);
    __pyx_t_2 = __pyx_v_handled_lhs;
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "ctff.pyx":765
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_char(self, context, c):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_char(context, c)
 *         handled_rhs = self.__rhs.handle_char(context, c)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("ctff.FilterMultiplexer.handle_char", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_handled_lhs);
  __Pyx_XDECREF(__pyx_v_handled_rhs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":770
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_invalid(self, context, seq):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_invalid(context, seq)
 *         handled_rhs = self.__rhs.handle_invalid(context, seq)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_17FilterMultiplexer_25handle_invalid(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_17FilterMultiplexer_25handle_invalid = {__Pyx_NAMESTR("handle_invalid"), (PyCFunction)__pyx_pw_4ctff_17FilterMultiplexer_25handle_invalid, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_17FilterMultiplexer_25handle_invalid(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_context = 0;
  PyObject *__pyx_v_seq = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_invalid (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,&__pyx_n_s_seq,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);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_invalid", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_invalid", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_invalid") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __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_context = values[1];
    __pyx_v_seq = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_invalid", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.FilterMultiplexer.handle_invalid", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_17FilterMultiplexer_24handle_invalid(__pyx_self, __pyx_v_self, __pyx_v_context, __pyx_v_seq);

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

static PyObject *__pyx_pf_4ctff_17FilterMultiplexer_24handle_invalid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_seq) {
  PyObject *__pyx_v_handled_lhs = NULL;
  PyObject *__pyx_v_handled_rhs = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("handle_invalid", 0);

  /* "ctff.pyx":771
 * 
 *     def handle_invalid(self, context, seq):
 *         handled_lhs = self.__lhs.handle_invalid(context, seq)             # <<<<<<<<<<<<<<
 *         handled_rhs = self.__rhs.handle_invalid(context, seq)
 *         return handled_lhs and handled_rhs
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FilterMultiplexer__lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_invalid); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_context);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_context);
  __Pyx_GIVEREF(__pyx_v_context);
  __Pyx_INCREF(__pyx_v_seq);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_seq);
  __Pyx_GIVEREF(__pyx_v_seq);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_handled_lhs = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ctff.pyx":772
 *     def handle_invalid(self, context, seq):
 *         handled_lhs = self.__lhs.handle_invalid(context, seq)
 *         handled_rhs = self.__rhs.handle_invalid(context, seq)             # <<<<<<<<<<<<<<
 *         return handled_lhs and handled_rhs
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FilterMultiplexer__rhs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_handle_invalid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_context);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_context);
  __Pyx_GIVEREF(__pyx_v_context);
  __Pyx_INCREF(__pyx_v_seq);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_seq);
  __Pyx_GIVEREF(__pyx_v_seq);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_handled_rhs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "ctff.pyx":773
 *         handled_lhs = self.__lhs.handle_invalid(context, seq)
 *         handled_rhs = self.__rhs.handle_invalid(context, seq)
 *         return handled_lhs and handled_rhs             # <<<<<<<<<<<<<<
 * 
 *     def handle_draw(self, context):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_handled_lhs); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {
    __Pyx_INCREF(__pyx_v_handled_rhs);
    __pyx_t_2 = __pyx_v_handled_rhs;
  } else {
    __Pyx_INCREF(__pyx_v_handled_lhs);
    __pyx_t_2 = __pyx_v_handled_lhs;
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "ctff.pyx":770
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_invalid(self, context, seq):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_invalid(context, seq)
 *         handled_rhs = self.__rhs.handle_invalid(context, seq)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("ctff.FilterMultiplexer.handle_invalid", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_handled_lhs);
  __Pyx_XDECREF(__pyx_v_handled_rhs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":775
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_draw(self, context):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_draw(context)
 *         handled_rhs = self.__rhs.handle_draw(context)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_17FilterMultiplexer_27handle_draw(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_17FilterMultiplexer_27handle_draw = {__Pyx_NAMESTR("handle_draw"), (PyCFunction)__pyx_pw_4ctff_17FilterMultiplexer_27handle_draw, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_17FilterMultiplexer_27handle_draw(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_context = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_draw (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_draw", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_draw") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_context = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_draw", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.FilterMultiplexer.handle_draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_17FilterMultiplexer_26handle_draw(__pyx_self, __pyx_v_self, __pyx_v_context);

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

static PyObject *__pyx_pf_4ctff_17FilterMultiplexer_26handle_draw(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_context) {
  PyObject *__pyx_v_handled_lhs = NULL;
  PyObject *__pyx_v_handled_rhs = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("handle_draw", 0);

  /* "ctff.pyx":776
 * 
 *     def handle_draw(self, context):
 *         handled_lhs = self.__lhs.handle_draw(context)             # <<<<<<<<<<<<<<
 *         handled_rhs = self.__rhs.handle_draw(context)
 *         return handled_lhs and handled_rhs
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FilterMultiplexer__lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_context);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_context);
  __Pyx_GIVEREF(__pyx_v_context);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_handled_lhs = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ctff.pyx":777
 *     def handle_draw(self, context):
 *         handled_lhs = self.__lhs.handle_draw(context)
 *         handled_rhs = self.__rhs.handle_draw(context)             # <<<<<<<<<<<<<<
 *         return handled_lhs and handled_rhs
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FilterMultiplexer__rhs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_handle_draw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_context);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_context);
  __Pyx_GIVEREF(__pyx_v_context);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_handled_rhs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "ctff.pyx":778
 *         handled_lhs = self.__lhs.handle_draw(context)
 *         handled_rhs = self.__rhs.handle_draw(context)
 *         return handled_lhs and handled_rhs             # <<<<<<<<<<<<<<
 * 
 *     def handle_resize(self, context, row, col):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_handled_lhs); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {
    __Pyx_INCREF(__pyx_v_handled_rhs);
    __pyx_t_2 = __pyx_v_handled_rhs;
  } else {
    __Pyx_INCREF(__pyx_v_handled_lhs);
    __pyx_t_2 = __pyx_v_handled_lhs;
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "ctff.pyx":775
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_draw(self, context):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_draw(context)
 *         handled_rhs = self.__rhs.handle_draw(context)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("ctff.FilterMultiplexer.handle_draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_handled_lhs);
  __Pyx_XDECREF(__pyx_v_handled_rhs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":780
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_resize(self, context, row, col):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_resize(context, row, col)
 *         handled_rhs = self.__rhs.handle_resize(context, row, col)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_17FilterMultiplexer_29handle_resize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_17FilterMultiplexer_29handle_resize = {__Pyx_NAMESTR("handle_resize"), (PyCFunction)__pyx_pw_4ctff_17FilterMultiplexer_29handle_resize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_17FilterMultiplexer_29handle_resize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_context = 0;
  PyObject *__pyx_v_row = 0;
  PyObject *__pyx_v_col = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_resize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_context,&__pyx_n_s_row,&__pyx_n_s_col,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);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_resize", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_resize", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_col)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_resize", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_resize") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_context = values[1];
    __pyx_v_row = values[2];
    __pyx_v_col = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_resize", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.FilterMultiplexer.handle_resize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_17FilterMultiplexer_28handle_resize(__pyx_self, __pyx_v_self, __pyx_v_context, __pyx_v_row, __pyx_v_col);

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

static PyObject *__pyx_pf_4ctff_17FilterMultiplexer_28handle_resize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_row, PyObject *__pyx_v_col) {
  PyObject *__pyx_v_handled_lhs = NULL;
  PyObject *__pyx_v_handled_rhs = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("handle_resize", 0);

  /* "ctff.pyx":781
 * 
 *     def handle_resize(self, context, row, col):
 *         handled_lhs = self.__lhs.handle_resize(context, row, col)             # <<<<<<<<<<<<<<
 *         handled_rhs = self.__rhs.handle_resize(context, row, col)
 *         return handled_lhs and handled_rhs
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FilterMultiplexer__lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_resize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_context);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_context);
  __Pyx_GIVEREF(__pyx_v_context);
  __Pyx_INCREF(__pyx_v_row);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_row);
  __Pyx_GIVEREF(__pyx_v_row);
  __Pyx_INCREF(__pyx_v_col);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_col);
  __Pyx_GIVEREF(__pyx_v_col);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_handled_lhs = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ctff.pyx":782
 *     def handle_resize(self, context, row, col):
 *         handled_lhs = self.__lhs.handle_resize(context, row, col)
 *         handled_rhs = self.__rhs.handle_resize(context, row, col)             # <<<<<<<<<<<<<<
 *         return handled_lhs and handled_rhs
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FilterMultiplexer__rhs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_handle_resize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_context);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_context);
  __Pyx_GIVEREF(__pyx_v_context);
  __Pyx_INCREF(__pyx_v_row);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_row);
  __Pyx_GIVEREF(__pyx_v_row);
  __Pyx_INCREF(__pyx_v_col);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_col);
  __Pyx_GIVEREF(__pyx_v_col);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_handled_rhs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "ctff.pyx":783
 *         handled_lhs = self.__lhs.handle_resize(context, row, col)
 *         handled_rhs = self.__rhs.handle_resize(context, row, col)
 *         return handled_lhs and handled_rhs             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_handled_lhs); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {
    __Pyx_INCREF(__pyx_v_handled_rhs);
    __pyx_t_2 = __pyx_v_handled_rhs;
  } else {
    __Pyx_INCREF(__pyx_v_handled_lhs);
    __pyx_t_2 = __pyx_v_handled_lhs;
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "ctff.pyx":780
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_resize(self, context, row, col):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_resize(context, row, col)
 *         handled_rhs = self.__rhs.handle_resize(context, row, col)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("ctff.FilterMultiplexer.handle_resize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_handled_lhs);
  __Pyx_XDECREF(__pyx_v_handled_rhs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":792
 * class ParseContext(OutputStream, EventDispatcher):
 * 
 *     def __init__(self,             # <<<<<<<<<<<<<<
 *                  output,
 *                  termenc='UTF-8',
 */

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

  /* "ctff.pyx":797
 *                  scanner=DefaultScanner(),
 *                  handler=DefaultHandler(),
 *                  buffering=False):             # <<<<<<<<<<<<<<
 *         self.__termenc = termenc
 *         self.__scanner = scanner
 */
  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject*)__pyx_kp_s_UTF_8));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject*)__pyx_kp_s_UTF_8));
  __Pyx_GIVEREF(((PyObject*)__pyx_kp_s_UTF_8));
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_scanner);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_scanner);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_scanner);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_handler);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_handler);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_handler);
  __Pyx_INCREF(((PyObject *)Py_False));
  PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));

  /* "ctff.pyx":792
 * class ParseContext(OutputStream, EventDispatcher):
 * 
 *     def __init__(self,             # <<<<<<<<<<<<<<
 *                  output,
 *                  termenc='UTF-8',
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_12ParseContext_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_12ParseContext_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_4ctff_12ParseContext_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_12ParseContext_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_output = 0;
  PyObject *__pyx_v_termenc = 0;
  PyObject *__pyx_v_scanner = 0;
  PyObject *__pyx_v_handler = 0;
  PyObject *__pyx_v_buffering = 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_output,&__pyx_n_s_termenc,&__pyx_n_s_scanner,&__pyx_n_s_handler,&__pyx_n_s_buffering,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
    values[2] = ((PyObject *)((PyObject*)__pyx_kp_s_UTF_8));
    values[3] = __pyx_dynamic_args->__pyx_arg_scanner;
    values[4] = __pyx_dynamic_args->__pyx_arg_handler;
    values[5] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_output)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_termenc);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_scanner);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_handler);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buffering);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_output = values[1];
    __pyx_v_termenc = values[2];
    __pyx_v_scanner = values[3];
    __pyx_v_handler = values[4];
    __pyx_v_buffering = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.ParseContext.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_12ParseContext___init__(__pyx_self, __pyx_v_self, __pyx_v_output, __pyx_v_termenc, __pyx_v_scanner, __pyx_v_handler, __pyx_v_buffering);

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

static PyObject *__pyx_pf_4ctff_12ParseContext___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_output, PyObject *__pyx_v_termenc, PyObject *__pyx_v_scanner, PyObject *__pyx_v_handler, PyObject *__pyx_v_buffering) {
  PyObject *__pyx_v_StringIO = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "ctff.pyx":798
 *                  handler=DefaultHandler(),
 *                  buffering=False):
 *         self.__termenc = termenc             # <<<<<<<<<<<<<<
 *         self.__scanner = scanner
 *         self.__handler = handler
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ParseContext__termenc, __pyx_v_termenc) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":799
 *                  buffering=False):
 *         self.__termenc = termenc
 *         self.__scanner = scanner             # <<<<<<<<<<<<<<
 *         self.__handler = handler
 *         self._c1 = 0
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ParseContext__scanner, __pyx_v_scanner) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":800
 *         self.__termenc = termenc
 *         self.__scanner = scanner
 *         self.__handler = handler             # <<<<<<<<<<<<<<
 *         self._c1 = 0
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ParseContext__handler, __pyx_v_handler) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":801
 *         self.__scanner = scanner
 *         self.__handler = handler
 *         self._c1 = 0             # <<<<<<<<<<<<<<
 * 
 *         if buffering:
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_c1, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":803
 *         self._c1 = 0
 * 
 *         if buffering:             # <<<<<<<<<<<<<<
 *             try:
 *                 from cStringIO import StringIO
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_buffering); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "ctff.pyx":804
 * 
 *         if buffering:
 *             try:             # <<<<<<<<<<<<<<
 *                 from cStringIO import StringIO
 *                 self._output = codecs.getwriter(termenc)(StringIO())
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      /*try:*/ {

        /* "ctff.pyx":805
 *         if buffering:
 *             try:
 *                 from cStringIO import StringIO             # <<<<<<<<<<<<<<
 *                 self._output = codecs.getwriter(termenc)(StringIO())
 *             except ImportError:
 */
        __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_n_s_StringIO);
        PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_StringIO);
        __Pyx_GIVEREF(__pyx_n_s_StringIO);
        __pyx_t_6 = __Pyx_Import(__pyx_n_s_cStringIO, __pyx_t_5, -1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_6, __pyx_n_s_StringIO); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_5);
        __pyx_v_StringIO = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "ctff.pyx":806
 *             try:
 *                 from cStringIO import StringIO
 *                 self._output = codecs.getwriter(termenc)(StringIO())             # <<<<<<<<<<<<<<
 *             except ImportError:
 *                 try:
 */
        __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_codecs); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getwriter); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_v_termenc);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_termenc);
        __Pyx_GIVEREF(__pyx_v_termenc);
        __pyx_t_7 = PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyObject_Call(__pyx_v_StringIO, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_6 = PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_output_2, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L11_try_end;
      __pyx_L4_error:;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "ctff.pyx":807
 *                 from cStringIO import StringIO
 *                 self._output = codecs.getwriter(termenc)(StringIO())
 *             except ImportError:             # <<<<<<<<<<<<<<
 *                 try:
 *                     from StringIO import StringIO
 */
      __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_ImportError);
      if (__pyx_t_8) {
        __Pyx_AddTraceback("ctff.ParseContext.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_7);

        /* "ctff.pyx":808
 *                 self._output = codecs.getwriter(termenc)(StringIO())
 *             except ImportError:
 *                 try:             # <<<<<<<<<<<<<<
 *                     from StringIO import StringIO
 *                     self._output = codecs.getwriter(termenc)(StringIO())
 */
        {
          __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_11);
          /*try:*/ {

            /* "ctff.pyx":809
 *             except ImportError:
 *                 try:
 *                     from StringIO import StringIO             # <<<<<<<<<<<<<<
 *                     self._output = codecs.getwriter(termenc)(StringIO())
 *                 except ImportError:
 */
            __pyx_t_12 = PyList_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_INCREF(__pyx_n_s_StringIO);
            PyList_SET_ITEM(__pyx_t_12, 0, __pyx_n_s_StringIO);
            __Pyx_GIVEREF(__pyx_n_s_StringIO);
            __pyx_t_13 = __Pyx_Import(__pyx_n_s_StringIO, __pyx_t_12, -1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_12 = __Pyx_ImportFrom(__pyx_t_13, __pyx_n_s_StringIO); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_XDECREF_SET(__pyx_v_StringIO, __pyx_t_12);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

            /* "ctff.pyx":810
 *                 try:
 *                     from StringIO import StringIO
 *                     self._output = codecs.getwriter(termenc)(StringIO())             # <<<<<<<<<<<<<<
 *                 except ImportError:
 *                     from io import StringIO
 */
            __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_codecs); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_getwriter); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_INCREF(__pyx_v_termenc);
            PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_termenc);
            __Pyx_GIVEREF(__pyx_v_termenc);
            __pyx_t_14 = PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __pyx_t_13 = PyObject_Call(__pyx_v_StringIO, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
            __Pyx_GOTREF(__pyx_t_12);
            PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_13);
            __Pyx_GIVEREF(__pyx_t_13);
            __pyx_t_13 = 0;
            __pyx_t_13 = PyObject_Call(__pyx_t_14, __pyx_t_12, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_output_2, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          }
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L21_try_end;
          __pyx_L14_error:;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;

          /* "ctff.pyx":811
 *                     from StringIO import StringIO
 *                     self._output = codecs.getwriter(termenc)(StringIO())
 *                 except ImportError:             # <<<<<<<<<<<<<<
 *                     from io import StringIO
 *                     self._output = codecs.getwriter(termenc)(StringIO())
 */
          __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_ImportError);
          if (__pyx_t_8) {
            __Pyx_AddTraceback("ctff.ParseContext.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_12, &__pyx_t_14) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_GOTREF(__pyx_t_14);

            /* "ctff.pyx":812
 *                     self._output = codecs.getwriter(termenc)(StringIO())
 *                 except ImportError:
 *                     from io import StringIO             # <<<<<<<<<<<<<<
 *                     self._output = codecs.getwriter(termenc)(StringIO())
 *         else:
 */
            __pyx_t_15 = PyList_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
            __Pyx_GOTREF(__pyx_t_15);
            __Pyx_INCREF(__pyx_n_s_StringIO);
            PyList_SET_ITEM(__pyx_t_15, 0, __pyx_n_s_StringIO);
            __Pyx_GIVEREF(__pyx_n_s_StringIO);
            __pyx_t_16 = __Pyx_Import(__pyx_n_s_io, __pyx_t_15, -1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
            __Pyx_GOTREF(__pyx_t_16);
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            __pyx_t_15 = __Pyx_ImportFrom(__pyx_t_16, __pyx_n_s_StringIO); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
            __Pyx_GOTREF(__pyx_t_15);
            __Pyx_INCREF(__pyx_t_15);
            __Pyx_XDECREF_SET(__pyx_v_StringIO, __pyx_t_15);
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

            /* "ctff.pyx":813
 *                 except ImportError:
 *                     from io import StringIO
 *                     self._output = codecs.getwriter(termenc)(StringIO())             # <<<<<<<<<<<<<<
 *         else:
 *             self._output = codecs.getwriter(termenc)(output)
 */
            __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_codecs); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
            __Pyx_GOTREF(__pyx_t_16);
            __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_getwriter); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
            __Pyx_GOTREF(__pyx_t_15);
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
            __Pyx_GOTREF(__pyx_t_16);
            __Pyx_INCREF(__pyx_v_termenc);
            PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_v_termenc);
            __Pyx_GIVEREF(__pyx_v_termenc);
            __pyx_t_17 = PyObject_Call(__pyx_t_15, __pyx_t_16, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            __pyx_t_16 = PyObject_Call(__pyx_v_StringIO, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
            __Pyx_GOTREF(__pyx_t_16);
            __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
            __Pyx_GOTREF(__pyx_t_15);
            PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_16);
            __Pyx_GIVEREF(__pyx_t_16);
            __pyx_t_16 = 0;
            __pyx_t_16 = PyObject_Call(__pyx_t_17, __pyx_t_15, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
            __Pyx_GOTREF(__pyx_t_16);
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_output_2, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            goto __pyx_L15_exception_handled;
          }
          goto __pyx_L16_except_error;
          __pyx_L16_except_error:;
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
          goto __pyx_L6_except_error;
          __pyx_L15_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
          __pyx_L21_try_end:;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L5_exception_handled;
      }
      goto __pyx_L6_except_error;
      __pyx_L6_except_error:;
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      goto __pyx_L1_error;
      __pyx_L5_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      __pyx_L11_try_end:;
    }
    goto __pyx_L3;
  }
  /*else*/ {

    /* "ctff.pyx":815
 *                     self._output = codecs.getwriter(termenc)(StringIO())
 *         else:
 *             self._output = codecs.getwriter(termenc)(output)             # <<<<<<<<<<<<<<
 *         self._target_output = output
 *         self._buffering = buffering
 */
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_codecs); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_getwriter); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_termenc);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_termenc);
    __Pyx_GIVEREF(__pyx_v_termenc);
    __pyx_t_6 = PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_output);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_output);
    __Pyx_GIVEREF(__pyx_v_output);
    __pyx_t_5 = PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_output_2, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_L3:;

  /* "ctff.pyx":816
 *         else:
 *             self._output = codecs.getwriter(termenc)(output)
 *         self._target_output = output             # <<<<<<<<<<<<<<
 *         self._buffering = buffering
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_target_output, __pyx_v_output) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":817
 *             self._output = codecs.getwriter(termenc)(output)
 *         self._target_output = output
 *         self._buffering = buffering             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_buffering_2, __pyx_v_buffering) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":792
 * class ParseContext(OutputStream, EventDispatcher):
 * 
 *     def __init__(self,             # <<<<<<<<<<<<<<
 *                  output,
 *                  termenc='UTF-8',
 */

  /* 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_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("ctff.ParseContext.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_StringIO);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":819
 *         self._buffering = buffering
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self.__scanner.__iter__()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_12ParseContext_3__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_12ParseContext_3__iter__ = {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pw_4ctff_12ParseContext_3__iter__, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_12ParseContext_3__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_12ParseContext_2__iter__(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "ctff.pyx":820
 * 
 *     def __iter__(self):
 *         return self.__scanner.__iter__()             # <<<<<<<<<<<<<<
 * 
 *     def assign(self, data):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ParseContext__scanner); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_iter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __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;

  /* "ctff.pyx":819
 *         self._buffering = buffering
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self.__scanner.__iter__()
 * 
 */

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

/* "ctff.pyx":822
 *         return self.__scanner.__iter__()
 * 
 *     def assign(self, data):             # <<<<<<<<<<<<<<
 *         self.__scanner.assign(data, self.__termenc)
 *         if self._buffering:
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_12ParseContext_5assign(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_12ParseContext_5assign = {__Pyx_NAMESTR("assign"), (PyCFunction)__pyx_pw_4ctff_12ParseContext_5assign, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_12ParseContext_5assign(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_data = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assign (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("assign", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "assign") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_data = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("assign", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.ParseContext.assign", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_12ParseContext_4assign(__pyx_self, __pyx_v_self, __pyx_v_data);

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

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

  /* "ctff.pyx":823
 * 
 *     def assign(self, data):
 *         self.__scanner.assign(data, self.__termenc)             # <<<<<<<<<<<<<<
 *         if self._buffering:
 *             self._output.truncate(0)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ParseContext__scanner); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_assign); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ParseContext__termenc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_data);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_data);
  __Pyx_GIVEREF(__pyx_v_data);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":824
 *     def assign(self, data):
 *         self.__scanner.assign(data, self.__termenc)
 *         if self._buffering:             # <<<<<<<<<<<<<<
 *             self._output.truncate(0)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_buffering_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "ctff.pyx":825
 *         self.__scanner.assign(data, self.__termenc)
 *         if self._buffering:
 *             self._output.truncate(0)             # <<<<<<<<<<<<<<
 * 
 *     def sethandler(self, handler):
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_truncate); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __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;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "ctff.pyx":822
 *         return self.__scanner.__iter__()
 * 
 *     def assign(self, data):             # <<<<<<<<<<<<<<
 *         self.__scanner.assign(data, self.__termenc)
 *         if self._buffering:
 */

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

/* "ctff.pyx":827
 *             self._output.truncate(0)
 * 
 *     def sethandler(self, handler):             # <<<<<<<<<<<<<<
 *         self.__handler = handler
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_12ParseContext_7sethandler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_12ParseContext_7sethandler = {__Pyx_NAMESTR("sethandler"), (PyCFunction)__pyx_pw_4ctff_12ParseContext_7sethandler, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_12ParseContext_7sethandler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_handler = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sethandler (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_handler,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_handler)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sethandler", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sethandler") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_handler = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sethandler", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.ParseContext.sethandler", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_12ParseContext_6sethandler(__pyx_self, __pyx_v_self, __pyx_v_handler);

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

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

  /* "ctff.pyx":828
 * 
 *     def sethandler(self, handler):
 *         self.__handler = handler             # <<<<<<<<<<<<<<
 * 
 *     def putu(self, data):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ParseContext__handler, __pyx_v_handler) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":827
 *             self._output.truncate(0)
 * 
 *     def sethandler(self, handler):             # <<<<<<<<<<<<<<
 *         self.__handler = handler
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("ctff.ParseContext.sethandler", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":830
 *         self.__handler = handler
 * 
 *     def putu(self, data):             # <<<<<<<<<<<<<<
 *         self._output.write(data)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_12ParseContext_9putu(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_12ParseContext_9putu = {__Pyx_NAMESTR("putu"), (PyCFunction)__pyx_pw_4ctff_12ParseContext_9putu, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_12ParseContext_9putu(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_data = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("putu (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("putu", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "putu") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_data = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("putu", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.ParseContext.putu", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_12ParseContext_8putu(__pyx_self, __pyx_v_self, __pyx_v_data);

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

static PyObject *__pyx_pf_4ctff_12ParseContext_8putu(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  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("putu", 0);

  /* "ctff.pyx":831
 * 
 *     def putu(self, data):
 *         self._output.write(data)             # <<<<<<<<<<<<<<
 * 
 *     def puts(self, data):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_data);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_data);
  __Pyx_GIVEREF(__pyx_v_data);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ctff.pyx":830
 *         self.__handler = handler
 * 
 *     def putu(self, data):             # <<<<<<<<<<<<<<
 *         self._output.write(data)
 * 
 */

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

/* "ctff.pyx":833
 *         self._output.write(data)
 * 
 *     def puts(self, data):             # <<<<<<<<<<<<<<
 *         self._target_output.write(data)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_12ParseContext_11puts(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_12ParseContext_11puts = {__Pyx_NAMESTR("puts"), (PyCFunction)__pyx_pw_4ctff_12ParseContext_11puts, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_12ParseContext_11puts(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_data = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("puts (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("puts", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "puts") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_data = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("puts", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.ParseContext.puts", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_12ParseContext_10puts(__pyx_self, __pyx_v_self, __pyx_v_data);

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

static PyObject *__pyx_pf_4ctff_12ParseContext_10puts(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  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("puts", 0);

  /* "ctff.pyx":834
 * 
 *     def puts(self, data):
 *         self._target_output.write(data)             # <<<<<<<<<<<<<<
 * 
 *     def put(self, c):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_target_output); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_data);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_data);
  __Pyx_GIVEREF(__pyx_v_data);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ctff.pyx":833
 *         self._output.write(data)
 * 
 *     def puts(self, data):             # <<<<<<<<<<<<<<
 *         self._target_output.write(data)
 * 
 */

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

/* "ctff.pyx":836
 *         self._target_output.write(data)
 * 
 *     def put(self, c):             # <<<<<<<<<<<<<<
 *         if c < 0x80:
 *             self._output.write(chr(c))
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_12ParseContext_13put(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_12ParseContext_13put = {__Pyx_NAMESTR("put"), (PyCFunction)__pyx_pw_4ctff_12ParseContext_13put, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_12ParseContext_13put(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_c = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("put (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_c,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_c)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("put", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_c = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("put", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.ParseContext.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_12ParseContext_12put(__pyx_self, __pyx_v_self, __pyx_v_c);

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

static PyObject *__pyx_pf_4ctff_12ParseContext_12put(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_c) {
  PyObject *__pyx_v_c1 = NULL;
  PyObject *__pyx_v_c2 = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("put", 0);
  __Pyx_INCREF(__pyx_v_c);

  /* "ctff.pyx":837
 * 
 *     def put(self, c):
 *         if c < 0x80:             # <<<<<<<<<<<<<<
 *             self._output.write(chr(c))
 *         elif c < 0xd800:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_c, __pyx_int_128, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "ctff.pyx":838
 *     def put(self, c):
 *         if c < 0x80:
 *             self._output.write(chr(c))             # <<<<<<<<<<<<<<
 *         elif c < 0xd800:
 *             self._output.write(unichr(c))
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_c);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_c);
    __Pyx_GIVEREF(__pyx_v_c);
    __pyx_t_4 = PyObject_Call(__pyx_builtin_chr, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L3;
  }

  /* "ctff.pyx":839
 *         if c < 0x80:
 *             self._output.write(chr(c))
 *         elif c < 0xd800:             # <<<<<<<<<<<<<<
 *             self._output.write(unichr(c))
 *         elif c < 0xdc00:
 */
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_c, __pyx_int_55296, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_2) {

    /* "ctff.pyx":840
 *             self._output.write(chr(c))
 *         elif c < 0xd800:
 *             self._output.write(unichr(c))             # <<<<<<<<<<<<<<
 *         elif c < 0xdc00:
 *             self._c1 = c
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_c);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_c);
    __Pyx_GIVEREF(__pyx_v_c);
    __pyx_t_3 = PyObject_Call(__pyx_builtin_unichr, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3;
  }

  /* "ctff.pyx":841
 *         elif c < 0xd800:
 *             self._output.write(unichr(c))
 *         elif c < 0xdc00:             # <<<<<<<<<<<<<<
 *             self._c1 = c
 *         elif c < 0xe000:
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_c, __pyx_int_56320, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "ctff.pyx":842
 *             self._output.write(unichr(c))
 *         elif c < 0xdc00:
 *             self._c1 = c             # <<<<<<<<<<<<<<
 *         elif c < 0xe000:
 *             self._output.write(unichr(self._c1) + unichr(c))
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_c1, __pyx_v_c) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }

  /* "ctff.pyx":843
 *         elif c < 0xdc00:
 *             self._c1 = c
 *         elif c < 0xe000:             # <<<<<<<<<<<<<<
 *             self._output.write(unichr(self._c1) + unichr(c))
 *         elif c < 0x10000:
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_c, __pyx_int_57344, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "ctff.pyx":844
 *             self._c1 = c
 *         elif c < 0xe000:
 *             self._output.write(unichr(self._c1) + unichr(c))             # <<<<<<<<<<<<<<
 *         elif c < 0x10000:
 *             self._output.write(unichr(c))
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_c1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_builtin_unichr, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_c);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_c);
    __Pyx_GIVEREF(__pyx_v_c);
    __pyx_t_5 = PyObject_Call(__pyx_builtin_unichr, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L3;
  }

  /* "ctff.pyx":845
 *         elif c < 0xe000:
 *             self._output.write(unichr(self._c1) + unichr(c))
 *         elif c < 0x10000:             # <<<<<<<<<<<<<<
 *             self._output.write(unichr(c))
 *         else:  # c > 0x10000
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_c, __pyx_int_65536, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "ctff.pyx":846
 *             self._output.write(unichr(self._c1) + unichr(c))
 *         elif c < 0x10000:
 *             self._output.write(unichr(c))             # <<<<<<<<<<<<<<
 *         else:  # c > 0x10000
 *             c -= 0x10000
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_c);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_c);
    __Pyx_GIVEREF(__pyx_v_c);
    __pyx_t_4 = PyObject_Call(__pyx_builtin_unichr, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "ctff.pyx":848
 *             self._output.write(unichr(c))
 *         else:  # c > 0x10000
 *             c -= 0x10000             # <<<<<<<<<<<<<<
 *             c1 = (c >> 10) + 0xd800
 *             c2 = (c & 0x3ff) + 0xdc00
 */
    __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_v_c, __pyx_int_65536); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_c, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "ctff.pyx":849
 *         else:  # c > 0x10000
 *             c -= 0x10000
 *             c1 = (c >> 10) + 0xd800             # <<<<<<<<<<<<<<
 *             c2 = (c & 0x3ff) + 0xdc00
 *             self._output.write(unichr(c1) + unichr(c2))
 */
    __pyx_t_4 = PyNumber_Rshift(__pyx_v_c, __pyx_int_10); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_int_55296); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_c1 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "ctff.pyx":850
 *             c -= 0x10000
 *             c1 = (c >> 10) + 0xd800
 *             c2 = (c & 0x3ff) + 0xdc00             # <<<<<<<<<<<<<<
 *             self._output.write(unichr(c1) + unichr(c2))
 * 
 */
    __pyx_t_1 = PyNumber_And(__pyx_v_c, __pyx_int_1023); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_int_56320); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "ctff.pyx":851
 *             c1 = (c >> 10) + 0xd800
 *             c2 = (c & 0x3ff) + 0xdc00
 *             self._output.write(unichr(c1) + unichr(c2))             # <<<<<<<<<<<<<<
 * 
 *     # obsoluted!!
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_c1);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_c1);
    __Pyx_GIVEREF(__pyx_v_c1);
    __pyx_t_5 = PyObject_Call(__pyx_builtin_unichr, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_c2);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_c2);
    __Pyx_GIVEREF(__pyx_v_c2);
    __pyx_t_3 = PyObject_Call(__pyx_builtin_unichr, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "ctff.pyx":836
 *         self._target_output.write(data)
 * 
 *     def put(self, c):             # <<<<<<<<<<<<<<
 *         if c < 0x80:
 *             self._output.write(chr(c))
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("ctff.ParseContext.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_c1);
  __Pyx_XDECREF(__pyx_v_c2);
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":854
 * 
 *     # obsoluted!!
 *     def writestring(self, data):             # <<<<<<<<<<<<<<
 *         try:
 *             self._target_output.write(data)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_12ParseContext_15writestring(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_12ParseContext_15writestring = {__Pyx_NAMESTR("writestring"), (PyCFunction)__pyx_pw_4ctff_12ParseContext_15writestring, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_12ParseContext_15writestring(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_data = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("writestring (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("writestring", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "writestring") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_data = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("writestring", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.ParseContext.writestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_12ParseContext_14writestring(__pyx_self, __pyx_v_self, __pyx_v_data);

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

static PyObject *__pyx_pf_4ctff_12ParseContext_14writestring(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("writestring", 0);

  /* "ctff.pyx":855
 *     # obsoluted!!
 *     def writestring(self, data):
 *         try:             # <<<<<<<<<<<<<<
 *             self._target_output.write(data)
 *         except Exception:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ctff.pyx":856
 *     def writestring(self, data):
 *         try:
 *             self._target_output.write(data)             # <<<<<<<<<<<<<<
 *         except Exception:
 *             self._output.write(data)
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_target_output); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_data);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_data);
      __Pyx_GIVEREF(__pyx_v_data);
      __pyx_t_6 = PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L10_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "ctff.pyx":857
 *         try:
 *             self._target_output.write(data)
 *         except Exception:             # <<<<<<<<<<<<<<
 *             self._output.write(data)
 * 
 */
    __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("ctff.ParseContext.writestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);

      /* "ctff.pyx":858
 *             self._target_output.write(data)
 *         except Exception:
 *             self._output.write(data)             # <<<<<<<<<<<<<<
 * 
 * # OutputStream
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_write); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_v_data);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_data);
      __Pyx_GIVEREF(__pyx_v_data);
      __pyx_t_10 = PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L10_try_end:;
  }

  /* "ctff.pyx":854
 * 
 *     # obsoluted!!
 *     def writestring(self, data):             # <<<<<<<<<<<<<<
 *         try:
 *             self._target_output.write(data)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("ctff.ParseContext.writestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":862
 * # OutputStream
 *     # obsoluted!!
 *     def write(self, c):             # <<<<<<<<<<<<<<
 *         self.put(c)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_12ParseContext_17write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_12ParseContext_17write = {__Pyx_NAMESTR("write"), (PyCFunction)__pyx_pw_4ctff_12ParseContext_17write, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_12ParseContext_17write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_c = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_c,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_c)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("write", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_c = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.ParseContext.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_12ParseContext_16write(__pyx_self, __pyx_v_self, __pyx_v_c);

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

static PyObject *__pyx_pf_4ctff_12ParseContext_16write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_c) {
  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("write", 0);

  /* "ctff.pyx":863
 *     # obsoluted!!
 *     def write(self, c):
 *         self.put(c)             # <<<<<<<<<<<<<<
 * 
 *     def flush(self):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_put); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_c);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_c);
  __Pyx_GIVEREF(__pyx_v_c);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ctff.pyx":862
 * # OutputStream
 *     # obsoluted!!
 *     def write(self, c):             # <<<<<<<<<<<<<<
 *         self.put(c)
 * 
 */

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

/* "ctff.pyx":865
 *         self.put(c)
 * 
 *     def flush(self):             # <<<<<<<<<<<<<<
 *         if self._buffering:
 *             self._target_output.write(self._output)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_12ParseContext_19flush(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_12ParseContext_19flush = {__Pyx_NAMESTR("flush"), (PyCFunction)__pyx_pw_4ctff_12ParseContext_19flush, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_12ParseContext_19flush(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flush (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_12ParseContext_18flush(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "ctff.pyx":866
 * 
 *     def flush(self):
 *         if self._buffering:             # <<<<<<<<<<<<<<
 *             self._target_output.write(self._output)
 *         try:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_buffering_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "ctff.pyx":867
 *     def flush(self):
 *         if self._buffering:
 *             self._target_output.write(self._output)             # <<<<<<<<<<<<<<
 *         try:
 *             self._target_output.flush()
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_target_output); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "ctff.pyx":868
 *         if self._buffering:
 *             self._target_output.write(self._output)
 *         try:             # <<<<<<<<<<<<<<
 *             self._target_output.flush()
 *         except IOError:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    /*try:*/ {

      /* "ctff.pyx":869
 *             self._target_output.write(self._output)
 *         try:
 *             self._target_output.flush()             # <<<<<<<<<<<<<<
 *         except IOError:
 *             pass
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_target_output); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_flush); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L11_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "ctff.pyx":870
 *         try:
 *             self._target_output.flush()
 *         except IOError:             # <<<<<<<<<<<<<<
 *             pass
 * 
 */
    __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_IOError);
    if (__pyx_t_8) {
      PyErr_Restore(0,0,0);
      goto __pyx_L5_exception_handled;
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L1_error;
    __pyx_L5_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    __pyx_L11_try_end:;
  }

  /* "ctff.pyx":865
 *         self.put(c)
 * 
 *     def flush(self):             # <<<<<<<<<<<<<<
 *         if self._buffering:
 *             self._target_output.write(self._output)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("ctff.ParseContext.flush", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":874
 * 
 * # EventDispatcher
 *     def dispatch_esc(self, intermediate, final):             # <<<<<<<<<<<<<<
 *         if not self.__handler.handle_esc(self, intermediate, final):
 *             self.put(0x1b)  # ESC
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_12ParseContext_21dispatch_esc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_12ParseContext_21dispatch_esc = {__Pyx_NAMESTR("dispatch_esc"), (PyCFunction)__pyx_pw_4ctff_12ParseContext_21dispatch_esc, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_12ParseContext_21dispatch_esc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_intermediate = 0;
  PyObject *__pyx_v_final = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dispatch_esc (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_intermediate,&__pyx_n_s_final,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);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_intermediate)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dispatch_esc", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_final)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dispatch_esc", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dispatch_esc") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __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_intermediate = values[1];
    __pyx_v_final = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dispatch_esc", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.ParseContext.dispatch_esc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_12ParseContext_20dispatch_esc(__pyx_self, __pyx_v_self, __pyx_v_intermediate, __pyx_v_final);

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

static PyObject *__pyx_pf_4ctff_12ParseContext_20dispatch_esc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_intermediate, PyObject *__pyx_v_final) {
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dispatch_esc", 0);

  /* "ctff.pyx":875
 * # EventDispatcher
 *     def dispatch_esc(self, intermediate, final):
 *         if not self.__handler.handle_esc(self, intermediate, final):             # <<<<<<<<<<<<<<
 *             self.put(0x1b)  # ESC
 *             for c in intermediate:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ParseContext__handler); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_esc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  __Pyx_INCREF(__pyx_v_intermediate);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_intermediate);
  __Pyx_GIVEREF(__pyx_v_intermediate);
  __Pyx_INCREF(__pyx_v_final);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_final);
  __Pyx_GIVEREF(__pyx_v_final);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (__pyx_t_5) {

    /* "ctff.pyx":876
 *     def dispatch_esc(self, intermediate, final):
 *         if not self.__handler.handle_esc(self, intermediate, final):
 *             self.put(0x1b)  # ESC             # <<<<<<<<<<<<<<
 *             for c in intermediate:
 *                 self.put(c)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_put); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __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;

    /* "ctff.pyx":877
 *         if not self.__handler.handle_esc(self, intermediate, final):
 *             self.put(0x1b)  # ESC
 *             for c in intermediate:             # <<<<<<<<<<<<<<
 *                 self.put(c)
 *             self.put(final)
 */
    if (PyList_CheckExact(__pyx_v_intermediate) || PyTuple_CheckExact(__pyx_v_intermediate)) {
      __pyx_t_1 = __pyx_v_intermediate; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_intermediate); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_1)) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_1)) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_3 = __pyx_t_7(__pyx_t_1);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "ctff.pyx":878
 *             self.put(0x1b)  # ESC
 *             for c in intermediate:
 *                 self.put(c)             # <<<<<<<<<<<<<<
 *             self.put(final)
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_put); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_c);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_c);
      __Pyx_GIVEREF(__pyx_v_c);
      __pyx_t_8 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "ctff.pyx":879
 *             for c in intermediate:
 *                 self.put(c)
 *             self.put(final)             # <<<<<<<<<<<<<<
 * 
 *     def dispatch_csi(self, parameter, intermediate, final):
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_put); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_v_final);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_final);
    __Pyx_GIVEREF(__pyx_v_final);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "ctff.pyx":874
 * 
 * # EventDispatcher
 *     def dispatch_esc(self, intermediate, final):             # <<<<<<<<<<<<<<
 *         if not self.__handler.handle_esc(self, intermediate, final):
 *             self.put(0x1b)  # ESC
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("ctff.ParseContext.dispatch_esc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":881
 *             self.put(final)
 * 
 *     def dispatch_csi(self, parameter, intermediate, final):             # <<<<<<<<<<<<<<
 *         if not self.__handler.handle_csi(self, parameter, intermediate, final):
 *             self.put(0x1b)  # ESC
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_12ParseContext_23dispatch_csi(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_12ParseContext_23dispatch_csi = {__Pyx_NAMESTR("dispatch_csi"), (PyCFunction)__pyx_pw_4ctff_12ParseContext_23dispatch_csi, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_12ParseContext_23dispatch_csi(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_parameter = 0;
  PyObject *__pyx_v_intermediate = 0;
  PyObject *__pyx_v_final = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dispatch_csi (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_parameter,&__pyx_n_s_intermediate,&__pyx_n_s_final,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);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parameter)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dispatch_csi", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_intermediate)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dispatch_csi", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_final)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dispatch_csi", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dispatch_csi") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_parameter = values[1];
    __pyx_v_intermediate = values[2];
    __pyx_v_final = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dispatch_csi", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.ParseContext.dispatch_csi", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_12ParseContext_22dispatch_csi(__pyx_self, __pyx_v_self, __pyx_v_parameter, __pyx_v_intermediate, __pyx_v_final);

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

static PyObject *__pyx_pf_4ctff_12ParseContext_22dispatch_csi(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_parameter, PyObject *__pyx_v_intermediate, PyObject *__pyx_v_final) {
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dispatch_csi", 0);

  /* "ctff.pyx":882
 * 
 *     def dispatch_csi(self, parameter, intermediate, final):
 *         if not self.__handler.handle_csi(self, parameter, intermediate, final):             # <<<<<<<<<<<<<<
 *             self.put(0x1b)  # ESC
 *             self.put(0x5b)  # [
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ParseContext__handler); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_csi); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  __Pyx_INCREF(__pyx_v_parameter);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_parameter);
  __Pyx_GIVEREF(__pyx_v_parameter);
  __Pyx_INCREF(__pyx_v_intermediate);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_intermediate);
  __Pyx_GIVEREF(__pyx_v_intermediate);
  __Pyx_INCREF(__pyx_v_final);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_final);
  __Pyx_GIVEREF(__pyx_v_final);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (__pyx_t_5) {

    /* "ctff.pyx":883
 *     def dispatch_csi(self, parameter, intermediate, final):
 *         if not self.__handler.handle_csi(self, parameter, intermediate, final):
 *             self.put(0x1b)  # ESC             # <<<<<<<<<<<<<<
 *             self.put(0x5b)  # [
 *             for c in parameter:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_put); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __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;

    /* "ctff.pyx":884
 *         if not self.__handler.handle_csi(self, parameter, intermediate, final):
 *             self.put(0x1b)  # ESC
 *             self.put(0x5b)  # [             # <<<<<<<<<<<<<<
 *             for c in parameter:
 *                 self.put(c)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_put); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "ctff.pyx":885
 *             self.put(0x1b)  # ESC
 *             self.put(0x5b)  # [
 *             for c in parameter:             # <<<<<<<<<<<<<<
 *                 self.put(c)
 *             for c in intermediate:
 */
    if (PyList_CheckExact(__pyx_v_parameter) || PyTuple_CheckExact(__pyx_v_parameter)) {
      __pyx_t_3 = __pyx_v_parameter; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_parameter); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_3)) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_3)) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_1 = __pyx_t_7(__pyx_t_3);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "ctff.pyx":886
 *             self.put(0x5b)  # [
 *             for c in parameter:
 *                 self.put(c)             # <<<<<<<<<<<<<<
 *             for c in intermediate:
 *                 self.put(c)
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_put); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_c);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_c);
      __Pyx_GIVEREF(__pyx_v_c);
      __pyx_t_8 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "ctff.pyx":887
 *             for c in parameter:
 *                 self.put(c)
 *             for c in intermediate:             # <<<<<<<<<<<<<<
 *                 self.put(c)
 *             self.put(final)
 */
    if (PyList_CheckExact(__pyx_v_intermediate) || PyTuple_CheckExact(__pyx_v_intermediate)) {
      __pyx_t_3 = __pyx_v_intermediate; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_intermediate); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_3)) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_3)) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_8 = __pyx_t_7(__pyx_t_3);
        if (unlikely(!__pyx_t_8)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "ctff.pyx":888
 *                 self.put(c)
 *             for c in intermediate:
 *                 self.put(c)             # <<<<<<<<<<<<<<
 *             self.put(final)
 * 
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_put); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_c);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_c);
      __Pyx_GIVEREF(__pyx_v_c);
      __pyx_t_1 = PyObject_Call(__pyx_t_8, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "ctff.pyx":889
 *             for c in intermediate:
 *                 self.put(c)
 *             self.put(final)             # <<<<<<<<<<<<<<
 * 
 *     def dispatch_ss2(self, final):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_put); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_final);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_final);
    __Pyx_GIVEREF(__pyx_v_final);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "ctff.pyx":881
 *             self.put(final)
 * 
 *     def dispatch_csi(self, parameter, intermediate, final):             # <<<<<<<<<<<<<<
 *         if not self.__handler.handle_csi(self, parameter, intermediate, final):
 *             self.put(0x1b)  # ESC
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("ctff.ParseContext.dispatch_csi", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":891
 *             self.put(final)
 * 
 *     def dispatch_ss2(self, final):             # <<<<<<<<<<<<<<
 *         if not self.__handler.handle_ss2(self, final):
 *             self.put(0x1b)  # ESC
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_12ParseContext_25dispatch_ss2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_12ParseContext_25dispatch_ss2 = {__Pyx_NAMESTR("dispatch_ss2"), (PyCFunction)__pyx_pw_4ctff_12ParseContext_25dispatch_ss2, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_12ParseContext_25dispatch_ss2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_final = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dispatch_ss2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_final,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_final)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dispatch_ss2", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dispatch_ss2") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_final = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dispatch_ss2", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.ParseContext.dispatch_ss2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_12ParseContext_24dispatch_ss2(__pyx_self, __pyx_v_self, __pyx_v_final);

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

static PyObject *__pyx_pf_4ctff_12ParseContext_24dispatch_ss2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_final) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dispatch_ss2", 0);

  /* "ctff.pyx":892
 * 
 *     def dispatch_ss2(self, final):
 *         if not self.__handler.handle_ss2(self, final):             # <<<<<<<<<<<<<<
 *             self.put(0x1b)  # ESC
 *             self.put(0x4e)  # N
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ParseContext__handler); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_ss2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  __Pyx_INCREF(__pyx_v_final);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_final);
  __Pyx_GIVEREF(__pyx_v_final);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (__pyx_t_5) {

    /* "ctff.pyx":893
 *     def dispatch_ss2(self, final):
 *         if not self.__handler.handle_ss2(self, final):
 *             self.put(0x1b)  # ESC             # <<<<<<<<<<<<<<
 *             self.put(0x4e)  # N
 *             self.put(final)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_put); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __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;

    /* "ctff.pyx":894
 *         if not self.__handler.handle_ss2(self, final):
 *             self.put(0x1b)  # ESC
 *             self.put(0x4e)  # N             # <<<<<<<<<<<<<<
 *             self.put(final)
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_put); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "ctff.pyx":895
 *             self.put(0x1b)  # ESC
 *             self.put(0x4e)  # N
 *             self.put(final)             # <<<<<<<<<<<<<<
 * 
 *     def dispatch_ss3(self, final):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_put); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_final);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_final);
    __Pyx_GIVEREF(__pyx_v_final);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "ctff.pyx":891
 *             self.put(final)
 * 
 *     def dispatch_ss2(self, final):             # <<<<<<<<<<<<<<
 *         if not self.__handler.handle_ss2(self, final):
 *             self.put(0x1b)  # ESC
 */

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

/* "ctff.pyx":897
 *             self.put(final)
 * 
 *     def dispatch_ss3(self, final):             # <<<<<<<<<<<<<<
 *         if not self.__handler.handle_ss3(self, final):
 *             self.put(0x1b)  # ESC
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_12ParseContext_27dispatch_ss3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_12ParseContext_27dispatch_ss3 = {__Pyx_NAMESTR("dispatch_ss3"), (PyCFunction)__pyx_pw_4ctff_12ParseContext_27dispatch_ss3, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_12ParseContext_27dispatch_ss3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_final = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dispatch_ss3 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_final,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_final)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dispatch_ss3", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dispatch_ss3") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_final = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dispatch_ss3", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.ParseContext.dispatch_ss3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_12ParseContext_26dispatch_ss3(__pyx_self, __pyx_v_self, __pyx_v_final);

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

static PyObject *__pyx_pf_4ctff_12ParseContext_26dispatch_ss3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_final) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dispatch_ss3", 0);

  /* "ctff.pyx":898
 * 
 *     def dispatch_ss3(self, final):
 *         if not self.__handler.handle_ss3(self, final):             # <<<<<<<<<<<<<<
 *             self.put(0x1b)  # ESC
 *             self.put(0x4f)  # O
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ParseContext__handler); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_ss3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  __Pyx_INCREF(__pyx_v_final);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_final);
  __Pyx_GIVEREF(__pyx_v_final);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (__pyx_t_5) {

    /* "ctff.pyx":899
 *     def dispatch_ss3(self, final):
 *         if not self.__handler.handle_ss3(self, final):
 *             self.put(0x1b)  # ESC             # <<<<<<<<<<<<<<
 *             self.put(0x4f)  # O
 *             self.put(final)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_put); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __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;

    /* "ctff.pyx":900
 *         if not self.__handler.handle_ss3(self, final):
 *             self.put(0x1b)  # ESC
 *             self.put(0x4f)  # O             # <<<<<<<<<<<<<<
 *             self.put(final)
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_put); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "ctff.pyx":901
 *             self.put(0x1b)  # ESC
 *             self.put(0x4f)  # O
 *             self.put(final)             # <<<<<<<<<<<<<<
 * 
 *     def dispatch_control_string(self, prefix, value):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_put); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_final);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_final);
    __Pyx_GIVEREF(__pyx_v_final);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "ctff.pyx":897
 *             self.put(final)
 * 
 *     def dispatch_ss3(self, final):             # <<<<<<<<<<<<<<
 *         if not self.__handler.handle_ss3(self, final):
 *             self.put(0x1b)  # ESC
 */

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

/* "ctff.pyx":903
 *             self.put(final)
 * 
 *     def dispatch_control_string(self, prefix, value):             # <<<<<<<<<<<<<<
 *         if not self.__handler.handle_control_string(self, prefix, value):
 *             self.put(0x1b)  # ESC
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_12ParseContext_29dispatch_control_string(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_12ParseContext_29dispatch_control_string = {__Pyx_NAMESTR("dispatch_control_string"), (PyCFunction)__pyx_pw_4ctff_12ParseContext_29dispatch_control_string, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_12ParseContext_29dispatch_control_string(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_prefix = 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("dispatch_control_string (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_prefix,&__pyx_n_s_value,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dispatch_control_string", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dispatch_control_string", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dispatch_control_string") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __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_prefix = values[1];
    __pyx_v_value = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dispatch_control_string", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.ParseContext.dispatch_control_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_12ParseContext_28dispatch_control_string(__pyx_self, __pyx_v_self, __pyx_v_prefix, __pyx_v_value);

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

static PyObject *__pyx_pf_4ctff_12ParseContext_28dispatch_control_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_prefix, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dispatch_control_string", 0);

  /* "ctff.pyx":904
 * 
 *     def dispatch_control_string(self, prefix, value):
 *         if not self.__handler.handle_control_string(self, prefix, value):             # <<<<<<<<<<<<<<
 *             self.put(0x1b)  # ESC
 *             self.put(prefix)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ParseContext__handler); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_control_string); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  __Pyx_INCREF(__pyx_v_prefix);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_prefix);
  __Pyx_GIVEREF(__pyx_v_prefix);
  __Pyx_INCREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (__pyx_t_5) {

    /* "ctff.pyx":905
 *     def dispatch_control_string(self, prefix, value):
 *         if not self.__handler.handle_control_string(self, prefix, value):
 *             self.put(0x1b)  # ESC             # <<<<<<<<<<<<<<
 *             self.put(prefix)
 *             for c in value:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_put); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __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;

    /* "ctff.pyx":906
 *         if not self.__handler.handle_control_string(self, prefix, value):
 *             self.put(0x1b)  # ESC
 *             self.put(prefix)             # <<<<<<<<<<<<<<
 *             for c in value:
 *                 self.put(c)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_put); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_prefix);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_prefix);
    __Pyx_GIVEREF(__pyx_v_prefix);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "ctff.pyx":907
 *             self.put(0x1b)  # ESC
 *             self.put(prefix)
 *             for c in value:             # <<<<<<<<<<<<<<
 *                 self.put(c)
 *             self.put(0x1b)  # ESC
 */
    if (PyList_CheckExact(__pyx_v_value) || PyTuple_CheckExact(__pyx_v_value)) {
      __pyx_t_2 = __pyx_v_value; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_2)) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_2)) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_3 = __pyx_t_7(__pyx_t_2);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "ctff.pyx":908
 *             self.put(prefix)
 *             for c in value:
 *                 self.put(c)             # <<<<<<<<<<<<<<
 *             self.put(0x1b)  # ESC
 *             self.put(0x5c)  # \
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_put); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_c);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_c);
      __Pyx_GIVEREF(__pyx_v_c);
      __pyx_t_8 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "ctff.pyx":909
 *             for c in value:
 *                 self.put(c)
 *             self.put(0x1b)  # ESC             # <<<<<<<<<<<<<<
 *             self.put(0x5c)  # \
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_put); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = PyObject_Call(__pyx_t_2, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "ctff.pyx":910
 *                 self.put(c)
 *             self.put(0x1b)  # ESC
 *             self.put(0x5c)  # \             # <<<<<<<<<<<<<<
 * 
 *     def dispatch_char(self, c):
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_put); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_2 = PyObject_Call(__pyx_t_8, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "ctff.pyx":903
 *             self.put(final)
 * 
 *     def dispatch_control_string(self, prefix, value):             # <<<<<<<<<<<<<<
 *         if not self.__handler.handle_control_string(self, prefix, value):
 *             self.put(0x1b)  # ESC
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("ctff.ParseContext.dispatch_control_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":912
 *             self.put(0x5c)  # \
 * 
 *     def dispatch_char(self, c):             # <<<<<<<<<<<<<<
 *         if not self.__handler.handle_char(self, c):
 *             self.put(c)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_12ParseContext_31dispatch_char(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_12ParseContext_31dispatch_char = {__Pyx_NAMESTR("dispatch_char"), (PyCFunction)__pyx_pw_4ctff_12ParseContext_31dispatch_char, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_12ParseContext_31dispatch_char(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_c = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dispatch_char (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_c,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_c)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dispatch_char", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dispatch_char") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_c = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dispatch_char", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.ParseContext.dispatch_char", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_12ParseContext_30dispatch_char(__pyx_self, __pyx_v_self, __pyx_v_c);

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

static PyObject *__pyx_pf_4ctff_12ParseContext_30dispatch_char(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_c) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dispatch_char", 0);

  /* "ctff.pyx":913
 * 
 *     def dispatch_char(self, c):
 *         if not self.__handler.handle_char(self, c):             # <<<<<<<<<<<<<<
 *             self.put(c)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ParseContext__handler); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_char); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  __Pyx_INCREF(__pyx_v_c);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_c);
  __Pyx_GIVEREF(__pyx_v_c);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (__pyx_t_5) {

    /* "ctff.pyx":914
 *     def dispatch_char(self, c):
 *         if not self.__handler.handle_char(self, c):
 *             self.put(c)             # <<<<<<<<<<<<<<
 * 
 *     def dispatch_invalid(self, seq):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_put); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_c);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_c);
    __Pyx_GIVEREF(__pyx_v_c);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "ctff.pyx":912
 *             self.put(0x5c)  # \
 * 
 *     def dispatch_char(self, c):             # <<<<<<<<<<<<<<
 *         if not self.__handler.handle_char(self, c):
 *             self.put(c)
 */

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

/* "ctff.pyx":916
 *             self.put(c)
 * 
 *     def dispatch_invalid(self, seq):             # <<<<<<<<<<<<<<
 *         if not self.__handler.handle_invalid(self, seq):
 *             for c in seq:
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_12ParseContext_33dispatch_invalid(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_12ParseContext_33dispatch_invalid = {__Pyx_NAMESTR("dispatch_invalid"), (PyCFunction)__pyx_pw_4ctff_12ParseContext_33dispatch_invalid, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_12ParseContext_33dispatch_invalid(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_seq = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dispatch_invalid (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_seq,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dispatch_invalid", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dispatch_invalid") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_seq = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dispatch_invalid", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.ParseContext.dispatch_invalid", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_12ParseContext_32dispatch_invalid(__pyx_self, __pyx_v_self, __pyx_v_seq);

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

static PyObject *__pyx_pf_4ctff_12ParseContext_32dispatch_invalid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_seq) {
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dispatch_invalid", 0);

  /* "ctff.pyx":917
 * 
 *     def dispatch_invalid(self, seq):
 *         if not self.__handler.handle_invalid(self, seq):             # <<<<<<<<<<<<<<
 *             for c in seq:
 *                 self.put(c)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ParseContext__handler); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_invalid); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  __Pyx_INCREF(__pyx_v_seq);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_seq);
  __Pyx_GIVEREF(__pyx_v_seq);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (__pyx_t_5) {

    /* "ctff.pyx":918
 *     def dispatch_invalid(self, seq):
 *         if not self.__handler.handle_invalid(self, seq):
 *             for c in seq:             # <<<<<<<<<<<<<<
 *                 self.put(c)
 * 
 */
    if (PyList_CheckExact(__pyx_v_seq) || PyTuple_CheckExact(__pyx_v_seq)) {
      __pyx_t_3 = __pyx_v_seq; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_3)) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_3)) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_1 = __pyx_t_7(__pyx_t_3);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "ctff.pyx":919
 *         if not self.__handler.handle_invalid(self, seq):
 *             for c in seq:
 *                 self.put(c)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_put); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_c);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_c);
      __Pyx_GIVEREF(__pyx_v_c);
      __pyx_t_8 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "ctff.pyx":916
 *             self.put(c)
 * 
 *     def dispatch_invalid(self, seq):             # <<<<<<<<<<<<<<
 *         if not self.__handler.handle_invalid(self, seq):
 *             for c in seq:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("ctff.ParseContext.dispatch_invalid", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":928
 * class DefaultPTY(PTY):
 * 
 *     def __init__(self, term, lang, command, stdin, row=None, col=None):             # <<<<<<<<<<<<<<
 *         self._stdin_fileno = stdin.fileno()
 *         backup = termios.tcgetattr(self._stdin_fileno)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_10DefaultPTY_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_10DefaultPTY_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_4ctff_10DefaultPTY_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_10DefaultPTY_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_term = 0;
  PyObject *__pyx_v_lang = 0;
  PyObject *__pyx_v_command = 0;
  PyObject *__pyx_v_stdin = 0;
  PyObject *__pyx_v_row = 0;
  PyObject *__pyx_v_col = 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_term,&__pyx_n_s_lang,&__pyx_n_s_command,&__pyx_n_s_stdin,&__pyx_n_s_row,&__pyx_n_s_col,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[5] = ((PyObject *)((PyObject *)Py_None));
    values[6] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_term)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lang)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_command)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 7, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stdin)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 7, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_row);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_col);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_term = values[1];
    __pyx_v_lang = values[2];
    __pyx_v_command = values[3];
    __pyx_v_stdin = values[4];
    __pyx_v_row = values[5];
    __pyx_v_col = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.DefaultPTY.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_10DefaultPTY___init__(__pyx_self, __pyx_v_self, __pyx_v_term, __pyx_v_lang, __pyx_v_command, __pyx_v_stdin, __pyx_v_row, __pyx_v_col);

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

static PyObject *__pyx_pf_4ctff_10DefaultPTY___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_term, PyObject *__pyx_v_lang, PyObject *__pyx_v_command, PyObject *__pyx_v_stdin, PyObject *__pyx_v_row, PyObject *__pyx_v_col) {
  PyObject *__pyx_v_backup = NULL;
  PyObject *__pyx_v_pid = NULL;
  PyObject *__pyx_v_master = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "ctff.pyx":929
 * 
 *     def __init__(self, term, lang, command, stdin, row=None, col=None):
 *         self._stdin_fileno = stdin.fileno()             # <<<<<<<<<<<<<<
 *         backup = termios.tcgetattr(self._stdin_fileno)
 *         self._backup_termios = backup
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_stdin, __pyx_n_s_fileno); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_stdin_fileno, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":930
 *     def __init__(self, term, lang, command, stdin, row=None, col=None):
 *         self._stdin_fileno = stdin.fileno()
 *         backup = termios.tcgetattr(self._stdin_fileno)             # <<<<<<<<<<<<<<
 *         self._backup_termios = backup
 *         pid, master = pty.fork()
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_tcgetattr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_stdin_fileno); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_backup = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "ctff.pyx":931
 *         self._stdin_fileno = stdin.fileno()
 *         backup = termios.tcgetattr(self._stdin_fileno)
 *         self._backup_termios = backup             # <<<<<<<<<<<<<<
 *         pid, master = pty.fork()
 *         if not pid:
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_backup_termios, __pyx_v_backup) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":932
 *         backup = termios.tcgetattr(self._stdin_fileno)
 *         self._backup_termios = backup
 *         pid, master = pty.fork()             # <<<<<<<<<<<<<<
 *         if not pid:
 *             os.environ['TERM'] = term
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_fork); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_1);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_pid = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_master = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ctff.pyx":933
 *         self._backup_termios = backup
 *         pid, master = pty.fork()
 *         if not pid:             # <<<<<<<<<<<<<<
 *             os.environ['TERM'] = term
 *             os.environ['LANG'] = lang
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_pid); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((!__pyx_t_6) != 0);
  if (__pyx_t_7) {

    /* "ctff.pyx":934
 *         pid, master = pty.fork()
 *         if not pid:
 *             os.environ['TERM'] = term             # <<<<<<<<<<<<<<
 *             os.environ['LANG'] = lang
 *             os.execlp('/bin/sh', '/bin/sh', '-c', 'exec %s' % command)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_environ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_n_s_TERM, __pyx_v_term) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "ctff.pyx":935
 *         if not pid:
 *             os.environ['TERM'] = term
 *             os.environ['LANG'] = lang             # <<<<<<<<<<<<<<
 *             os.execlp('/bin/sh', '/bin/sh', '-c', 'exec %s' % command)
 * 
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_environ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_n_s_LANG, __pyx_v_lang) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "ctff.pyx":936
 *             os.environ['TERM'] = term
 *             os.environ['LANG'] = lang
 *             os.execlp('/bin/sh', '/bin/sh', '-c', 'exec %s' % command)             # <<<<<<<<<<<<<<
 * 
 *         self.__setupterm(self._stdin_fileno)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_execlp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_exec_s, __pyx_v_command); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_kp_s_bin_sh);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_s_bin_sh);
    __Pyx_GIVEREF(__pyx_kp_s_bin_sh);
    __Pyx_INCREF(__pyx_kp_s_bin_sh);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_s_bin_sh);
    __Pyx_GIVEREF(__pyx_kp_s_bin_sh);
    __Pyx_INCREF(__pyx_kp_s_c_2);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_s_c_2);
    __Pyx_GIVEREF(__pyx_kp_s_c_2);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "ctff.pyx":938
 *             os.execlp('/bin/sh', '/bin/sh', '-c', 'exec %s' % command)
 * 
 *         self.__setupterm(self._stdin_fileno)             # <<<<<<<<<<<<<<
 *         self.pid = pid
 *         self._master = master
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_DefaultPTY__setupterm); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_stdin_fileno); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ctff.pyx":939
 * 
 *         self.__setupterm(self._stdin_fileno)
 *         self.pid = pid             # <<<<<<<<<<<<<<
 *         self._master = master
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_pid, __pyx_v_pid) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":940
 *         self.__setupterm(self._stdin_fileno)
 *         self.pid = pid
 *         self._master = master             # <<<<<<<<<<<<<<
 * 
 *         if row and col:
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_master, __pyx_v_master) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":942
 *         self._master = master
 * 
 *         if row and col:             # <<<<<<<<<<<<<<
 *             self.resize(row, col)
 * 
 */
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_row); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_7) {
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_col); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_8 = __pyx_t_6;
  } else {
    __pyx_t_8 = __pyx_t_7;
  }
  if (__pyx_t_8) {

    /* "ctff.pyx":943
 * 
 *         if row and col:
 *             self.resize(row, col)             # <<<<<<<<<<<<<<
 * 
 *     def close(self):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_resize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_row);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_row);
    __Pyx_GIVEREF(__pyx_v_row);
    __Pyx_INCREF(__pyx_v_col);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_col);
    __Pyx_GIVEREF(__pyx_v_col);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "ctff.pyx":928
 * class DefaultPTY(PTY):
 * 
 *     def __init__(self, term, lang, command, stdin, row=None, col=None):             # <<<<<<<<<<<<<<
 *         self._stdin_fileno = stdin.fileno()
 *         backup = termios.tcgetattr(self._stdin_fileno)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("ctff.DefaultPTY.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_backup);
  __Pyx_XDECREF(__pyx_v_pid);
  __Pyx_XDECREF(__pyx_v_master);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":945
 *             self.resize(row, col)
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         #self.restore_term()
 *         try:
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_10DefaultPTY_3close(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_10DefaultPTY_3close = {__Pyx_NAMESTR("close"), (PyCFunction)__pyx_pw_4ctff_10DefaultPTY_3close, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_10DefaultPTY_3close(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_10DefaultPTY_2close(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ctff_10DefaultPTY_2close(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("close", 0);

  /* "ctff.pyx":947
 *     def close(self):
 *         #self.restore_term()
 *         try:             # <<<<<<<<<<<<<<
 *             os.close(self._master)
 *         except OSError, e:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ctff.pyx":948
 *         #self.restore_term()
 *         try:
 *             os.close(self._master)             # <<<<<<<<<<<<<<
 *         except OSError, e:
 *             logging.exception(e)
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_close); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_master); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L10_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ctff.pyx":949
 *         try:
 *             os.close(self._master)
 *         except OSError, e:             # <<<<<<<<<<<<<<
 *             logging.exception(e)
 *             logging.info("DefaultPTY.close: master=%d" % self._master)
 */
    __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_OSError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("ctff.DefaultPTY.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_e = __pyx_t_6;

      /* "ctff.pyx":950
 *             os.close(self._master)
 *         except OSError, e:
 *             logging.exception(e)             # <<<<<<<<<<<<<<
 *             logging.info("DefaultPTY.close: master=%d" % self._master)
 * 
 */
      __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_exception); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_v_e);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_e);
      __Pyx_GIVEREF(__pyx_v_e);
      __pyx_t_10 = PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "ctff.pyx":951
 *         except OSError, e:
 *             logging.exception(e)
 *             logging.info("DefaultPTY.close: master=%d" % self._master)             # <<<<<<<<<<<<<<
 * 
 *     def restore_term(self):
 */
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_info); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_master); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_DefaultPTY_close_master_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_9 = PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L10_try_end:;
  }

  /* "ctff.pyx":945
 *             self.resize(row, col)
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         #self.restore_term()
 *         try:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("ctff.DefaultPTY.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":953
 *             logging.info("DefaultPTY.close: master=%d" % self._master)
 * 
 *     def restore_term(self):             # <<<<<<<<<<<<<<
 *         termios.tcsetattr(self._stdin_fileno,
 *                           termios.TCSANOW,
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_10DefaultPTY_5restore_term(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_10DefaultPTY_5restore_term = {__Pyx_NAMESTR("restore_term"), (PyCFunction)__pyx_pw_4ctff_10DefaultPTY_5restore_term, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_10DefaultPTY_5restore_term(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("restore_term (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_10DefaultPTY_4restore_term(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "ctff.pyx":954
 * 
 *     def restore_term(self):
 *         termios.tcsetattr(self._stdin_fileno,             # <<<<<<<<<<<<<<
 *                           termios.TCSANOW,
 *                           self._backup_termios)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_tcsetattr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_stdin_fileno); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "ctff.pyx":955
 *     def restore_term(self):
 *         termios.tcsetattr(self._stdin_fileno,
 *                           termios.TCSANOW,             # <<<<<<<<<<<<<<
 *                           self._backup_termios)
 * 
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_TCSANOW); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ctff.pyx":956
 *         termios.tcsetattr(self._stdin_fileno,
 *                           termios.TCSANOW,
 *                           self._backup_termios)             # <<<<<<<<<<<<<<
 * 
 *     def __setupterm(self, fd):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_backup_termios); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);

  /* "ctff.pyx":954
 * 
 *     def restore_term(self):
 *         termios.tcsetattr(self._stdin_fileno,             # <<<<<<<<<<<<<<
 *                           termios.TCSANOW,
 *                           self._backup_termios)
 */
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ctff.pyx":953
 *             logging.info("DefaultPTY.close: master=%d" % self._master)
 * 
 *     def restore_term(self):             # <<<<<<<<<<<<<<
 *         termios.tcsetattr(self._stdin_fileno,
 *                           termios.TCSANOW,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("ctff.DefaultPTY.restore_term", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":958
 *                           self._backup_termios)
 * 
 *     def __setupterm(self, fd):             # <<<<<<<<<<<<<<
 *         term = termios.tcgetattr(fd)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_10DefaultPTY_7__setupterm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_10DefaultPTY_7__setupterm = {__Pyx_NAMESTR("__setupterm"), (PyCFunction)__pyx_pw_4ctff_10DefaultPTY_7__setupterm, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_10DefaultPTY_7__setupterm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_fd = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setupterm (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_fd,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__setupterm", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__setupterm") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_fd = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setupterm", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.DefaultPTY.__setupterm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_10DefaultPTY_6__setupterm(__pyx_self, __pyx_v_self, __pyx_v_fd);

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

static PyObject *__pyx_pf_4ctff_10DefaultPTY_6__setupterm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_fd) {
  PyObject *__pyx_v_term = NULL;
  PyObject *__pyx_v_c_cflag = NULL;
  PyObject *__pyx_v_c_lflag = NULL;
  PyObject *__pyx_v_vdisable = NULL;
  long __pyx_v_VDSUSP;
  PyObject *__pyx_v_c_cc = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setupterm", 0);

  /* "ctff.pyx":959
 * 
 *     def __setupterm(self, fd):
 *         term = termios.tcgetattr(fd)             # <<<<<<<<<<<<<<
 * 
 *         ## c_iflag
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_tcgetattr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_fd);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_fd);
  __Pyx_GIVEREF(__pyx_v_fd);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_term = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ctff.pyx":963
 *         ## c_iflag
 *         #IUTF8 = 16384
 *         term[0] &= ~(termios.IGNBRK             # <<<<<<<<<<<<<<
 *                      | termios.BRKINT
 *                      | termios.PARMRK
 */
  __pyx_t_4 = 0;
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_term, __pyx_t_4, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_IGNBRK); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":964
 *         #IUTF8 = 16384
 *         term[0] &= ~(termios.IGNBRK
 *                      | termios.BRKINT             # <<<<<<<<<<<<<<
 *                      | termios.PARMRK
 *                      | termios.ISTRIP
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_BRKINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Or(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ctff.pyx":965
 *         term[0] &= ~(termios.IGNBRK
 *                      | termios.BRKINT
 *                      | termios.PARMRK             # <<<<<<<<<<<<<<
 *                      | termios.ISTRIP
 *                      | termios.INLCR
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_PARMRK); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Or(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":966
 *                      | termios.BRKINT
 *                      | termios.PARMRK
 *                      | termios.ISTRIP             # <<<<<<<<<<<<<<
 *                      | termios.INLCR
 *                      | termios.IGNCR
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ISTRIP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Or(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":967
 *                      | termios.PARMRK
 *                      | termios.ISTRIP
 *                      | termios.INLCR             # <<<<<<<<<<<<<<
 *                      | termios.IGNCR
 *                      | termios.ICRNL
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_INLCR); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Or(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ctff.pyx":968
 *                      | termios.ISTRIP
 *                      | termios.INLCR
 *                      | termios.IGNCR             # <<<<<<<<<<<<<<
 *                      | termios.ICRNL
 *                      | termios.IXON)
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_IGNCR); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Or(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":969
 *                      | termios.INLCR
 *                      | termios.IGNCR
 *                      | termios.ICRNL             # <<<<<<<<<<<<<<
 *                      | termios.IXON)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ICRNL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Or(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":970
 *                      | termios.IGNCR
 *                      | termios.ICRNL
 *                      | termios.IXON)             # <<<<<<<<<<<<<<
 * 
 *         term[1] &= ~(termios.OPOST
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_IXON); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Or(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ctff.pyx":963
 *         ## c_iflag
 *         #IUTF8 = 16384
 *         term[0] &= ~(termios.IGNBRK             # <<<<<<<<<<<<<<
 *                      | termios.BRKINT
 *                      | termios.PARMRK
 */
  __pyx_t_5 = PyNumber_Invert(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_InPlaceAnd(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(__Pyx_SetItemInt(__pyx_v_term, __pyx_t_4, __pyx_t_1, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":972
 *                      | termios.IXON)
 * 
 *         term[1] &= ~(termios.OPOST             # <<<<<<<<<<<<<<
 *                      | termios.ONLCR)
 * 
 */
  __pyx_t_4 = 1;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_term, __pyx_t_4, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_OPOST); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ctff.pyx":973
 * 
 *         term[1] &= ~(termios.OPOST
 *                      | termios.ONLCR)             # <<<<<<<<<<<<<<
 * 
 *         # c_cflag
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ONLCR); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Or(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":972
 *                      | termios.IXON)
 * 
 *         term[1] &= ~(termios.OPOST             # <<<<<<<<<<<<<<
 *                      | termios.ONLCR)
 * 
 */
  __pyx_t_2 = PyNumber_Invert(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_InPlaceAnd(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__Pyx_SetItemInt(__pyx_v_term, __pyx_t_4, __pyx_t_5, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ctff.pyx":976
 * 
 *         # c_cflag
 *         c_cflag = term[2]             # <<<<<<<<<<<<<<
 *         c_cflag &= ~(termios.CSIZE | termios.PARENB)
 *         c_cflag |= termios.CS8
 */
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_term, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_c_cflag = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "ctff.pyx":977
 *         # c_cflag
 *         c_cflag = term[2]
 *         c_cflag &= ~(termios.CSIZE | termios.PARENB)             # <<<<<<<<<<<<<<
 *         c_cflag |= termios.CS8
 *         term[2] = c_cflag
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_CSIZE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_PARENB); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Or(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Invert(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_InPlaceAnd(__pyx_v_c_cflag, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_c_cflag, __pyx_t_5);
  __pyx_t_5 = 0;

  /* "ctff.pyx":978
 *         c_cflag = term[2]
 *         c_cflag &= ~(termios.CSIZE | termios.PARENB)
 *         c_cflag |= termios.CS8             # <<<<<<<<<<<<<<
 *         term[2] = c_cflag
 * 
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_CS8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_InPlaceOr(__pyx_v_c_cflag, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_c_cflag, __pyx_t_5);
  __pyx_t_5 = 0;

  /* "ctff.pyx":979
 *         c_cflag &= ~(termios.CSIZE | termios.PARENB)
 *         c_cflag |= termios.CS8
 *         term[2] = c_cflag             # <<<<<<<<<<<<<<
 * 
 *         ## c_lflag
 */
  if (unlikely(__Pyx_SetItemInt(__pyx_v_term, 2, __pyx_v_c_cflag, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":982
 * 
 *         ## c_lflag
 *         c_lflag = term[3]             # <<<<<<<<<<<<<<
 *         c_lflag &= ~(termios.ECHO
 *                      | termios.ECHONL
 */
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_term, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_c_lflag = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "ctff.pyx":983
 *         ## c_lflag
 *         c_lflag = term[3]
 *         c_lflag &= ~(termios.ECHO             # <<<<<<<<<<<<<<
 *                      | termios.ECHONL
 *                      | termios.ICANON
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ECHO); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ctff.pyx":984
 *         c_lflag = term[3]
 *         c_lflag &= ~(termios.ECHO
 *                      | termios.ECHONL             # <<<<<<<<<<<<<<
 *                      | termios.ICANON
 *                      | termios.ISIG
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ECHONL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Or(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":985
 *         c_lflag &= ~(termios.ECHO
 *                      | termios.ECHONL
 *                      | termios.ICANON             # <<<<<<<<<<<<<<
 *                      | termios.ISIG
 *                      | termios.IEXTEN)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ICANON); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Or(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":986
 *                      | termios.ECHONL
 *                      | termios.ICANON
 *                      | termios.ISIG             # <<<<<<<<<<<<<<
 *                      | termios.IEXTEN)
 *         term[3] = c_lflag
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ISIG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Or(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ctff.pyx":987
 *                      | termios.ICANON
 *                      | termios.ISIG
 *                      | termios.IEXTEN)             # <<<<<<<<<<<<<<
 *         term[3] = c_lflag
 * 
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_IEXTEN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Or(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":983
 *         ## c_lflag
 *         c_lflag = term[3]
 *         c_lflag &= ~(termios.ECHO             # <<<<<<<<<<<<<<
 *                      | termios.ECHONL
 *                      | termios.ICANON
 */
  __pyx_t_2 = PyNumber_Invert(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_InPlaceAnd(__pyx_v_c_lflag, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_c_lflag, __pyx_t_5);
  __pyx_t_5 = 0;

  /* "ctff.pyx":988
 *                      | termios.ISIG
 *                      | termios.IEXTEN)
 *         term[3] = c_lflag             # <<<<<<<<<<<<<<
 * 
 *         # c_cc
 */
  if (unlikely(__Pyx_SetItemInt(__pyx_v_term, 3, __pyx_v_c_lflag, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":992
 *         # c_cc
 *         # this PTY is jast a filter, so it must not fire signals
 *         vdisable = os.fpathconf(self._stdin_fileno, 'PC_VDISABLE')             # <<<<<<<<<<<<<<
 *         VDSUSP = 11
 *         c_cc = term[6]
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_fpathconf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_stdin_fileno); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_n_s_PC_VDISABLE);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_PC_VDISABLE);
  __Pyx_GIVEREF(__pyx_n_s_PC_VDISABLE);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_vdisable = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "ctff.pyx":993
 *         # this PTY is jast a filter, so it must not fire signals
 *         vdisable = os.fpathconf(self._stdin_fileno, 'PC_VDISABLE')
 *         VDSUSP = 11             # <<<<<<<<<<<<<<
 *         c_cc = term[6]
 *         c_cc[termios.VEOF] = vdisable  # Ctrl-D
 */
  __pyx_v_VDSUSP = 11;

  /* "ctff.pyx":994
 *         vdisable = os.fpathconf(self._stdin_fileno, 'PC_VDISABLE')
 *         VDSUSP = 11
 *         c_cc = term[6]             # <<<<<<<<<<<<<<
 *         c_cc[termios.VEOF] = vdisable  # Ctrl-D
 *         c_cc[termios.VINTR] = vdisable  # Ctrl-C
 */
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_term, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_c_cc = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "ctff.pyx":995
 *         VDSUSP = 11
 *         c_cc = term[6]
 *         c_cc[termios.VEOF] = vdisable  # Ctrl-D             # <<<<<<<<<<<<<<
 *         c_cc[termios.VINTR] = vdisable  # Ctrl-C
 *         c_cc[termios.VREPRINT] = vdisable  # Ctrl-R
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_VEOF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(PyObject_SetItem(__pyx_v_c_cc, __pyx_t_1, __pyx_v_vdisable) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":996
 *         c_cc = term[6]
 *         c_cc[termios.VEOF] = vdisable  # Ctrl-D
 *         c_cc[termios.VINTR] = vdisable  # Ctrl-C             # <<<<<<<<<<<<<<
 *         c_cc[termios.VREPRINT] = vdisable  # Ctrl-R
 *         c_cc[termios.VSTART] = vdisable  # Ctrl-Q
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_VINTR); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(PyObject_SetItem(__pyx_v_c_cc, __pyx_t_5, __pyx_v_vdisable) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ctff.pyx":997
 *         c_cc[termios.VEOF] = vdisable  # Ctrl-D
 *         c_cc[termios.VINTR] = vdisable  # Ctrl-C
 *         c_cc[termios.VREPRINT] = vdisable  # Ctrl-R             # <<<<<<<<<<<<<<
 *         c_cc[termios.VSTART] = vdisable  # Ctrl-Q
 *         c_cc[termios.VSTOP] = vdisable  # Ctrl-S
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_VREPRINT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(PyObject_SetItem(__pyx_v_c_cc, __pyx_t_1, __pyx_v_vdisable) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":998
 *         c_cc[termios.VINTR] = vdisable  # Ctrl-C
 *         c_cc[termios.VREPRINT] = vdisable  # Ctrl-R
 *         c_cc[termios.VSTART] = vdisable  # Ctrl-Q             # <<<<<<<<<<<<<<
 *         c_cc[termios.VSTOP] = vdisable  # Ctrl-S
 *         c_cc[termios.VLNEXT] = vdisable  # Ctrl-V
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_VSTART); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(PyObject_SetItem(__pyx_v_c_cc, __pyx_t_5, __pyx_v_vdisable) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ctff.pyx":999
 *         c_cc[termios.VREPRINT] = vdisable  # Ctrl-R
 *         c_cc[termios.VSTART] = vdisable  # Ctrl-Q
 *         c_cc[termios.VSTOP] = vdisable  # Ctrl-S             # <<<<<<<<<<<<<<
 *         c_cc[termios.VLNEXT] = vdisable  # Ctrl-V
 *         c_cc[termios.VWERASE] = vdisable  # Ctrl-W
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_VSTOP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(PyObject_SetItem(__pyx_v_c_cc, __pyx_t_1, __pyx_v_vdisable) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1000
 *         c_cc[termios.VSTART] = vdisable  # Ctrl-Q
 *         c_cc[termios.VSTOP] = vdisable  # Ctrl-S
 *         c_cc[termios.VLNEXT] = vdisable  # Ctrl-V             # <<<<<<<<<<<<<<
 *         c_cc[termios.VWERASE] = vdisable  # Ctrl-W
 *         c_cc[termios.VKILL] = vdisable  # Ctrl-X
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_VLNEXT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(PyObject_SetItem(__pyx_v_c_cc, __pyx_t_5, __pyx_v_vdisable) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ctff.pyx":1001
 *         c_cc[termios.VSTOP] = vdisable  # Ctrl-S
 *         c_cc[termios.VLNEXT] = vdisable  # Ctrl-V
 *         c_cc[termios.VWERASE] = vdisable  # Ctrl-W             # <<<<<<<<<<<<<<
 *         c_cc[termios.VKILL] = vdisable  # Ctrl-X
 *         c_cc[termios.VSUSP] = vdisable  # Ctrl-Z
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_VWERASE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(PyObject_SetItem(__pyx_v_c_cc, __pyx_t_1, __pyx_v_vdisable) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1002
 *         c_cc[termios.VLNEXT] = vdisable  # Ctrl-V
 *         c_cc[termios.VWERASE] = vdisable  # Ctrl-W
 *         c_cc[termios.VKILL] = vdisable  # Ctrl-X             # <<<<<<<<<<<<<<
 *         c_cc[termios.VSUSP] = vdisable  # Ctrl-Z
 *         c_cc[termios.VQUIT] = vdisable  # Ctrl-\
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_VKILL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(PyObject_SetItem(__pyx_v_c_cc, __pyx_t_5, __pyx_v_vdisable) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ctff.pyx":1003
 *         c_cc[termios.VWERASE] = vdisable  # Ctrl-W
 *         c_cc[termios.VKILL] = vdisable  # Ctrl-X
 *         c_cc[termios.VSUSP] = vdisable  # Ctrl-Z             # <<<<<<<<<<<<<<
 *         c_cc[termios.VQUIT] = vdisable  # Ctrl-\
 *         c_cc[VDSUSP] = vdisable  # Ctrl-Y
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_VSUSP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(PyObject_SetItem(__pyx_v_c_cc, __pyx_t_1, __pyx_v_vdisable) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1004
 *         c_cc[termios.VKILL] = vdisable  # Ctrl-X
 *         c_cc[termios.VSUSP] = vdisable  # Ctrl-Z
 *         c_cc[termios.VQUIT] = vdisable  # Ctrl-\             # <<<<<<<<<<<<<<
 *         c_cc[VDSUSP] = vdisable  # Ctrl-Y
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_VQUIT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(PyObject_SetItem(__pyx_v_c_cc, __pyx_t_5, __pyx_v_vdisable) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ctff.pyx":1005
 *         c_cc[termios.VSUSP] = vdisable  # Ctrl-Z
 *         c_cc[termios.VQUIT] = vdisable  # Ctrl-\
 *         c_cc[VDSUSP] = vdisable  # Ctrl-Y             # <<<<<<<<<<<<<<
 * 
 *         termios.tcsetattr(fd, termios.TCSANOW, term)
 */
  if (unlikely(__Pyx_SetItemInt(__pyx_v_c_cc, __pyx_v_VDSUSP, __pyx_v_vdisable, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1007
 *         c_cc[VDSUSP] = vdisable  # Ctrl-Y
 * 
 *         termios.tcsetattr(fd, termios.TCSANOW, term)             # <<<<<<<<<<<<<<
 * 
 *     def __resize_impl(self, winsize):
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_tcsetattr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_TCSANOW); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_fd);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_fd);
  __Pyx_GIVEREF(__pyx_v_fd);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_term);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_term);
  __Pyx_GIVEREF(__pyx_v_term);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":958
 *                           self._backup_termios)
 * 
 *     def __setupterm(self, fd):             # <<<<<<<<<<<<<<
 *         term = termios.tcgetattr(fd)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("ctff.DefaultPTY.__setupterm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_term);
  __Pyx_XDECREF(__pyx_v_c_cflag);
  __Pyx_XDECREF(__pyx_v_c_lflag);
  __Pyx_XDECREF(__pyx_v_vdisable);
  __Pyx_XDECREF(__pyx_v_c_cc);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":1009
 *         termios.tcsetattr(fd, termios.TCSANOW, term)
 * 
 *     def __resize_impl(self, winsize):             # <<<<<<<<<<<<<<
 *         fcntl.ioctl(self._master, termios.TIOCSWINSZ, winsize)
 *         # notify Application process that terminal size has been changed.
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_10DefaultPTY_9__resize_impl(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_10DefaultPTY_9__resize_impl = {__Pyx_NAMESTR("__resize_impl"), (PyCFunction)__pyx_pw_4ctff_10DefaultPTY_9__resize_impl, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_10DefaultPTY_9__resize_impl(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_winsize = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__resize_impl (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_winsize,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_winsize)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__resize_impl", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__resize_impl") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_winsize = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__resize_impl", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.DefaultPTY.__resize_impl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_10DefaultPTY_8__resize_impl(__pyx_self, __pyx_v_self, __pyx_v_winsize);

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

static PyObject *__pyx_pf_4ctff_10DefaultPTY_8__resize_impl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_winsize) {
  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("__resize_impl", 0);

  /* "ctff.pyx":1010
 * 
 *     def __resize_impl(self, winsize):
 *         fcntl.ioctl(self._master, termios.TIOCSWINSZ, winsize)             # <<<<<<<<<<<<<<
 *         # notify Application process that terminal size has been changed.
 *         os.kill(self.pid, signal.SIGWINCH)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_fcntl); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ioctl); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_master); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_TIOCSWINSZ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_winsize);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_winsize);
  __Pyx_GIVEREF(__pyx_v_winsize);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":1012
 *         fcntl.ioctl(self._master, termios.TIOCSWINSZ, winsize)
 *         # notify Application process that terminal size has been changed.
 *         os.kill(self.pid, signal.SIGWINCH)             # <<<<<<<<<<<<<<
 * 
 *     def fitsize(self):
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_kill); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_pid); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_signal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_SIGWINCH); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_4 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1009
 *         termios.tcsetattr(fd, termios.TCSANOW, term)
 * 
 *     def __resize_impl(self, winsize):             # <<<<<<<<<<<<<<
 *         fcntl.ioctl(self._master, termios.TIOCSWINSZ, winsize)
 *         # notify Application process that terminal size has been changed.
 */

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

/* "ctff.pyx":1014
 *         os.kill(self.pid, signal.SIGWINCH)
 * 
 *     def fitsize(self):             # <<<<<<<<<<<<<<
 *         winsize = fcntl.ioctl(self._stdin_fileno, termios.TIOCGWINSZ, 'hhhh')
 *         height, width = struct.unpack('hh', winsize)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_10DefaultPTY_11fitsize(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_10DefaultPTY_11fitsize = {__Pyx_NAMESTR("fitsize"), (PyCFunction)__pyx_pw_4ctff_10DefaultPTY_11fitsize, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_10DefaultPTY_11fitsize(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fitsize (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_10DefaultPTY_10fitsize(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ctff_10DefaultPTY_10fitsize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_winsize = NULL;
  PyObject *__pyx_v_height = NULL;
  PyObject *__pyx_v_width = 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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fitsize", 0);

  /* "ctff.pyx":1015
 * 
 *     def fitsize(self):
 *         winsize = fcntl.ioctl(self._stdin_fileno, termios.TIOCGWINSZ, 'hhhh')             # <<<<<<<<<<<<<<
 *         height, width = struct.unpack('hh', winsize)
 *         self.__resize_impl(winsize)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_fcntl); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ioctl); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_stdin_fileno); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_TIOCGWINSZ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_n_s_hhhh);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_hhhh);
  __Pyx_GIVEREF(__pyx_n_s_hhhh);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_winsize = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "ctff.pyx":1016
 *     def fitsize(self):
 *         winsize = fcntl.ioctl(self._stdin_fileno, termios.TIOCGWINSZ, 'hhhh')
 *         height, width = struct.unpack('hh', winsize)             # <<<<<<<<<<<<<<
 *         self.__resize_impl(winsize)
 *         return height, width
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_struct); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_unpack); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_n_s_hh);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_hh);
  __Pyx_GIVEREF(__pyx_n_s_hh);
  __Pyx_INCREF(__pyx_v_winsize);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_winsize);
  __Pyx_GIVEREF(__pyx_v_winsize);
  __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext;
    index = 0; __pyx_t_4 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_height = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_width = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ctff.pyx":1017
 *         winsize = fcntl.ioctl(self._stdin_fileno, termios.TIOCGWINSZ, 'hhhh')
 *         height, width = struct.unpack('hh', winsize)
 *         self.__resize_impl(winsize)             # <<<<<<<<<<<<<<
 *         return height, width
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_DefaultPTY__resize_impl); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_winsize);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_winsize);
  __Pyx_GIVEREF(__pyx_v_winsize);
  __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":1018
 *         height, width = struct.unpack('hh', winsize)
 *         self.__resize_impl(winsize)
 *         return height, width             # <<<<<<<<<<<<<<
 * 
 *     def resize(self, height, width):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_height);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_height);
  __Pyx_GIVEREF(__pyx_v_height);
  __Pyx_INCREF(__pyx_v_width);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_width);
  __Pyx_GIVEREF(__pyx_v_width);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "ctff.pyx":1014
 *         os.kill(self.pid, signal.SIGWINCH)
 * 
 *     def fitsize(self):             # <<<<<<<<<<<<<<
 *         winsize = fcntl.ioctl(self._stdin_fileno, termios.TIOCGWINSZ, 'hhhh')
 *         height, width = struct.unpack('hh', winsize)
 */

  /* 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("ctff.DefaultPTY.fitsize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_winsize);
  __Pyx_XDECREF(__pyx_v_height);
  __Pyx_XDECREF(__pyx_v_width);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":1020
 *         return height, width
 * 
 *     def resize(self, height, width):             # <<<<<<<<<<<<<<
 *         winsize = struct.pack('HHHH', height, width, 0, 0)
 *         self.__resize_impl(winsize)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_10DefaultPTY_13resize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_10DefaultPTY_13resize = {__Pyx_NAMESTR("resize"), (PyCFunction)__pyx_pw_4ctff_10DefaultPTY_13resize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_10DefaultPTY_13resize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_height = 0;
  PyObject *__pyx_v_width = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("resize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_height,&__pyx_n_s_width,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);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_height)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("resize", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("resize", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "resize") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __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_height = values[1];
    __pyx_v_width = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("resize", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.DefaultPTY.resize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_10DefaultPTY_12resize(__pyx_self, __pyx_v_self, __pyx_v_height, __pyx_v_width);

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

static PyObject *__pyx_pf_4ctff_10DefaultPTY_12resize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_height, PyObject *__pyx_v_width) {
  PyObject *__pyx_v_winsize = NULL;
  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("resize", 0);

  /* "ctff.pyx":1021
 * 
 *     def resize(self, height, width):
 *         winsize = struct.pack('HHHH', height, width, 0, 0)             # <<<<<<<<<<<<<<
 *         self.__resize_impl(winsize)
 *         return height, width
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_struct); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pack); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_HHHH);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_HHHH);
  __Pyx_GIVEREF(__pyx_n_s_HHHH);
  __Pyx_INCREF(__pyx_v_height);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_height);
  __Pyx_GIVEREF(__pyx_v_height);
  __Pyx_INCREF(__pyx_v_width);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_width);
  __Pyx_GIVEREF(__pyx_v_width);
  __Pyx_INCREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_winsize = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ctff.pyx":1022
 *     def resize(self, height, width):
 *         winsize = struct.pack('HHHH', height, width, 0, 0)
 *         self.__resize_impl(winsize)             # <<<<<<<<<<<<<<
 *         return height, width
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_DefaultPTY__resize_impl); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_winsize);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_winsize);
  __Pyx_GIVEREF(__pyx_v_winsize);
  __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":1023
 *         winsize = struct.pack('HHHH', height, width, 0, 0)
 *         self.__resize_impl(winsize)
 *         return height, width             # <<<<<<<<<<<<<<
 * 
 *     def fileno(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_height);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_height);
  __Pyx_GIVEREF(__pyx_v_height);
  __Pyx_INCREF(__pyx_v_width);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_width);
  __Pyx_GIVEREF(__pyx_v_width);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "ctff.pyx":1020
 *         return height, width
 * 
 *     def resize(self, height, width):             # <<<<<<<<<<<<<<
 *         winsize = struct.pack('HHHH', height, width, 0, 0)
 *         self.__resize_impl(winsize)
 */

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

/* "ctff.pyx":1025
 *         return height, width
 * 
 *     def fileno(self):             # <<<<<<<<<<<<<<
 *         return self._master
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_10DefaultPTY_15fileno(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_10DefaultPTY_15fileno = {__Pyx_NAMESTR("fileno"), (PyCFunction)__pyx_pw_4ctff_10DefaultPTY_15fileno, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_10DefaultPTY_15fileno(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fileno (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_10DefaultPTY_14fileno(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "ctff.pyx":1026
 * 
 *     def fileno(self):
 *         return self._master             # <<<<<<<<<<<<<<
 * 
 *     def stdin_fileno(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_master); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "ctff.pyx":1025
 *         return height, width
 * 
 *     def fileno(self):             # <<<<<<<<<<<<<<
 *         return self._master
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("ctff.DefaultPTY.fileno", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":1028
 *         return self._master
 * 
 *     def stdin_fileno(self):             # <<<<<<<<<<<<<<
 *         return self._stdin_fileno
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_10DefaultPTY_17stdin_fileno(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_10DefaultPTY_17stdin_fileno = {__Pyx_NAMESTR("stdin_fileno"), (PyCFunction)__pyx_pw_4ctff_10DefaultPTY_17stdin_fileno, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_10DefaultPTY_17stdin_fileno(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stdin_fileno (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_10DefaultPTY_16stdin_fileno(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "ctff.pyx":1029
 * 
 *     def stdin_fileno(self):
 *         return self._stdin_fileno             # <<<<<<<<<<<<<<
 * 
 *     def read(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_stdin_fileno); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "ctff.pyx":1028
 *         return self._master
 * 
 *     def stdin_fileno(self):             # <<<<<<<<<<<<<<
 *         return self._stdin_fileno
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("ctff.DefaultPTY.stdin_fileno", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":1031
 *         return self._stdin_fileno
 * 
 *     def read(self):             # <<<<<<<<<<<<<<
 *         return os.read(self._master, _BUFFER_SIZE)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_10DefaultPTY_19read(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_10DefaultPTY_19read = {__Pyx_NAMESTR("read"), (PyCFunction)__pyx_pw_4ctff_10DefaultPTY_19read, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_10DefaultPTY_19read(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_10DefaultPTY_18read(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "ctff.pyx":1032
 * 
 *     def read(self):
 *         return os.read(self._master, _BUFFER_SIZE)             # <<<<<<<<<<<<<<
 * 
 *     def write(self, data):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_master); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_BUFFER_SIZE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "ctff.pyx":1031
 *         return self._stdin_fileno
 * 
 *     def read(self):             # <<<<<<<<<<<<<<
 *         return os.read(self._master, _BUFFER_SIZE)
 * 
 */

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

/* "ctff.pyx":1034
 *         return os.read(self._master, _BUFFER_SIZE)
 * 
 *     def write(self, data):             # <<<<<<<<<<<<<<
 *         os.write(self._master, data)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_10DefaultPTY_21write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_10DefaultPTY_21write = {__Pyx_NAMESTR("write"), (PyCFunction)__pyx_pw_4ctff_10DefaultPTY_21write, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_10DefaultPTY_21write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_data = 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_self,&__pyx_n_s_data,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("write", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_data = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.DefaultPTY.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_10DefaultPTY_20write(__pyx_self, __pyx_v_self, __pyx_v_data);

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

static PyObject *__pyx_pf_4ctff_10DefaultPTY_20write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  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("write", 0);

  /* "ctff.pyx":1035
 * 
 *     def write(self, data):
 *         os.write(self._master, data)             # <<<<<<<<<<<<<<
 * 
 *     def flush(self):
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_master); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_data);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_data);
  __Pyx_GIVEREF(__pyx_v_data);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1034
 *         return os.read(self._master, _BUFFER_SIZE)
 * 
 *     def write(self, data):             # <<<<<<<<<<<<<<
 *         os.write(self._master, data)
 * 
 */

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

/* "ctff.pyx":1037
 *         os.write(self._master, data)
 * 
 *     def flush(self):             # <<<<<<<<<<<<<<
 *         pass
 *         #os.fsync(self._master)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_10DefaultPTY_23flush(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_10DefaultPTY_23flush = {__Pyx_NAMESTR("flush"), (PyCFunction)__pyx_pw_4ctff_10DefaultPTY_23flush, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_10DefaultPTY_23flush(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flush (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_10DefaultPTY_22flush(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ctff_10DefaultPTY_22flush(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flush", 0);

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

/* "ctff.pyx":1041
 *         #os.fsync(self._master)
 * 
 *     def xoff(self):             # <<<<<<<<<<<<<<
 *         #fcntl.ioctl(self._master, termios.TIOCSTOP, 0)
 *         termios.tcflow(self._master, termios.TCOOFF)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_10DefaultPTY_25xoff(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_10DefaultPTY_25xoff = {__Pyx_NAMESTR("xoff"), (PyCFunction)__pyx_pw_4ctff_10DefaultPTY_25xoff, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_10DefaultPTY_25xoff(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xoff (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_10DefaultPTY_24xoff(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "ctff.pyx":1043
 *     def xoff(self):
 *         #fcntl.ioctl(self._master, termios.TIOCSTOP, 0)
 *         termios.tcflow(self._master, termios.TCOOFF)             # <<<<<<<<<<<<<<
 * 
 *     def xon(self):
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_tcflow); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_master); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_TCOOFF); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":1041
 *         #os.fsync(self._master)
 * 
 *     def xoff(self):             # <<<<<<<<<<<<<<
 *         #fcntl.ioctl(self._master, termios.TIOCSTOP, 0)
 *         termios.tcflow(self._master, termios.TCOOFF)
 */

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

/* "ctff.pyx":1045
 *         termios.tcflow(self._master, termios.TCOOFF)
 * 
 *     def xon(self):             # <<<<<<<<<<<<<<
 *         #fcntl.ioctl(self._master, termios.TIOCSTART, 0)
 *         termios.tcflow(self._master, termios.TCOON)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_10DefaultPTY_27xon(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_10DefaultPTY_27xon = {__Pyx_NAMESTR("xon"), (PyCFunction)__pyx_pw_4ctff_10DefaultPTY_27xon, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_10DefaultPTY_27xon(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xon (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_10DefaultPTY_26xon(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "ctff.pyx":1047
 *     def xon(self):
 *         #fcntl.ioctl(self._master, termios.TIOCSTART, 0)
 *         termios.tcflow(self._master, termios.TCOON)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_tcflow); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_master); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_termios); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_TCOON); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":1045
 *         termios.tcflow(self._master, termios.TCOOFF)
 * 
 *     def xon(self):             # <<<<<<<<<<<<<<
 *         #fcntl.ioctl(self._master, termios.TIOCSTART, 0)
 *         termios.tcflow(self._master, termios.TCOON)
 */

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

/* "ctff.pyx":1052
 * class MockParseContext(ParseContext):
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         from StringIO import StringIO
 *         output = StringIO()
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_16MockParseContext_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_16MockParseContext_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_4ctff_16MockParseContext_1__init__, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_16MockParseContext_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_16MockParseContext___init__(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "ctff.pyx":1053
 * 
 *     def __init__(self):
 *         from StringIO import StringIO             # <<<<<<<<<<<<<<
 *         output = StringIO()
 *         ParseContext.__init__(self, output)
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_StringIO);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_StringIO);
  __Pyx_GIVEREF(__pyx_n_s_StringIO);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_StringIO, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_StringIO); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_StringIO = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":1054
 *     def __init__(self):
 *         from StringIO import StringIO
 *         output = StringIO()             # <<<<<<<<<<<<<<
 *         ParseContext.__init__(self, output)
 * 
 */
  __pyx_t_2 = PyObject_Call(__pyx_v_StringIO, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_output = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "ctff.pyx":1055
 *         from StringIO import StringIO
 *         output = StringIO()
 *         ParseContext.__init__(self, output)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ParseContext); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  __Pyx_INCREF(__pyx_v_output);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_output);
  __Pyx_GIVEREF(__pyx_v_output);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ctff.pyx":1052
 * class MockParseContext(ParseContext):
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         from StringIO import StringIO
 *         output = StringIO()
 */

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

/* "ctff.pyx":1067
 *     _esc_timer = None
 * 
 *     def __init__(self, tty):             # <<<<<<<<<<<<<<
 *         self._tty = tty
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Process_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Process_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_4ctff_7Process_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Process_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_tty = 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_tty,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tty)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_tty = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.Process.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_7Process___init__(__pyx_self, __pyx_v_self, __pyx_v_tty);

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

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

  /* "ctff.pyx":1068
 * 
 *     def __init__(self, tty):
 *         self._tty = tty             # <<<<<<<<<<<<<<
 * 
 *     def start(self, termenc,
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_tty_2, __pyx_v_tty) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1067
 *     _esc_timer = None
 * 
 *     def __init__(self, tty):             # <<<<<<<<<<<<<<
 *         self._tty = tty
 * 
 */

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

/* "ctff.pyx":1070
 *         self._tty = tty
 * 
 *     def start(self, termenc,             # <<<<<<<<<<<<<<
 *               inputhandler, outputhandler,
 *               inputparser, outputparser,
 */

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

  /* "ctff.pyx":1074
 *               inputparser, outputparser,
 *               inputscanner, outputscanner,
 *               buffering=False,             # <<<<<<<<<<<<<<
 *               stdout=sys.stdout):
 * 
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)Py_False));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_stdout);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_stdout);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_stdout);

  /* "ctff.pyx":1070
 *         self._tty = tty
 * 
 *     def start(self, termenc,             # <<<<<<<<<<<<<<
 *               inputhandler, outputhandler,
 *               inputparser, outputparser,
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Process_3start(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Process_3start = {__Pyx_NAMESTR("start"), (PyCFunction)__pyx_pw_4ctff_7Process_3start, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Process_3start(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_termenc = 0;
  PyObject *__pyx_v_inputhandler = 0;
  PyObject *__pyx_v_outputhandler = 0;
  PyObject *__pyx_v_inputparser = 0;
  PyObject *__pyx_v_outputparser = 0;
  PyObject *__pyx_v_inputscanner = 0;
  PyObject *__pyx_v_outputscanner = 0;
  PyObject *__pyx_v_buffering = 0;
  PyObject *__pyx_v_stdout = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("start (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_termenc,&__pyx_n_s_inputhandler,&__pyx_n_s_outputhandler,&__pyx_n_s_inputparser,&__pyx_n_s_outputparser,&__pyx_n_s_inputscanner,&__pyx_n_s_outputscanner,&__pyx_n_s_buffering,&__pyx_n_s_stdout,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    __pyx_defaults1 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self);
    values[8] = ((PyObject *)((PyObject *)Py_False));
    values[9] = __pyx_dynamic_args->__pyx_arg_stdout;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_termenc)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("start", 0, 8, 10, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_inputhandler)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("start", 0, 8, 10, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_outputhandler)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("start", 0, 8, 10, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_inputparser)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("start", 0, 8, 10, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_outputparser)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("start", 0, 8, 10, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  6:
        if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_inputscanner)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("start", 0, 8, 10, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  7:
        if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_outputscanner)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("start", 0, 8, 10, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  8:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buffering);
          if (value) { values[8] = value; kw_args--; }
        }
        case  9:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stdout);
          if (value) { values[9] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "start") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_termenc = values[1];
    __pyx_v_inputhandler = values[2];
    __pyx_v_outputhandler = values[3];
    __pyx_v_inputparser = values[4];
    __pyx_v_outputparser = values[5];
    __pyx_v_inputscanner = values[6];
    __pyx_v_outputscanner = values[7];
    __pyx_v_buffering = values[8];
    __pyx_v_stdout = values[9];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("start", 0, 8, 10, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.Process.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_7Process_2start(__pyx_self, __pyx_v_self, __pyx_v_termenc, __pyx_v_inputhandler, __pyx_v_outputhandler, __pyx_v_inputparser, __pyx_v_outputparser, __pyx_v_inputscanner, __pyx_v_outputscanner, __pyx_v_buffering, __pyx_v_stdout);

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

static PyObject *__pyx_pf_4ctff_7Process_2start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_termenc, PyObject *__pyx_v_inputhandler, PyObject *__pyx_v_outputhandler, PyObject *__pyx_v_inputparser, PyObject *__pyx_v_outputparser, PyObject *__pyx_v_inputscanner, PyObject *__pyx_v_outputscanner, PyObject *__pyx_v_buffering, PyObject *__pyx_v_stdout) {
  PyObject *__pyx_v_inputcontext = NULL;
  PyObject *__pyx_v_outputcontext = NULL;
  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("start", 0);

  /* "ctff.pyx":1077
 *               stdout=sys.stdout):
 * 
 *         inputcontext = ParseContext(output=self._tty,             # <<<<<<<<<<<<<<
 *                                     termenc=termenc,
 *                                     scanner=inputscanner,
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ParseContext); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tty_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_output, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ctff.pyx":1078
 * 
 *         inputcontext = ParseContext(output=self._tty,
 *                                     termenc=termenc,             # <<<<<<<<<<<<<<
 *                                     scanner=inputscanner,
 *                                     handler=inputhandler,
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_termenc, __pyx_v_termenc) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1079
 *         inputcontext = ParseContext(output=self._tty,
 *                                     termenc=termenc,
 *                                     scanner=inputscanner,             # <<<<<<<<<<<<<<
 *                                     handler=inputhandler,
 *                                     buffering=buffering)
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_scanner, __pyx_v_inputscanner) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1080
 *                                     termenc=termenc,
 *                                     scanner=inputscanner,
 *                                     handler=inputhandler,             # <<<<<<<<<<<<<<
 *                                     buffering=buffering)
 *         outputcontext = ParseContext(output=stdout,
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_handler, __pyx_v_inputhandler) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1081
 *                                     scanner=inputscanner,
 *                                     handler=inputhandler,
 *                                     buffering=buffering)             # <<<<<<<<<<<<<<
 *         outputcontext = ParseContext(output=stdout,
 *                                      termenc=termenc,
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_buffering, __pyx_v_buffering) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1077
 *               stdout=sys.stdout):
 * 
 *         inputcontext = ParseContext(output=self._tty,             # <<<<<<<<<<<<<<
 *                                     termenc=termenc,
 *                                     scanner=inputscanner,
 */
  __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_inputcontext = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ctff.pyx":1082
 *                                     handler=inputhandler,
 *                                     buffering=buffering)
 *         outputcontext = ParseContext(output=stdout,             # <<<<<<<<<<<<<<
 *                                      termenc=termenc,
 *                                      scanner=outputscanner,
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_ParseContext); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_output, __pyx_v_stdout) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1083
 *                                     buffering=buffering)
 *         outputcontext = ParseContext(output=stdout,
 *                                      termenc=termenc,             # <<<<<<<<<<<<<<
 *                                      scanner=outputscanner,
 *                                      handler=outputhandler,
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_termenc, __pyx_v_termenc) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1084
 *         outputcontext = ParseContext(output=stdout,
 *                                      termenc=termenc,
 *                                      scanner=outputscanner,             # <<<<<<<<<<<<<<
 *                                      handler=outputhandler,
 *                                      buffering=buffering)
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_scanner, __pyx_v_outputscanner) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1085
 *                                      termenc=termenc,
 *                                      scanner=outputscanner,
 *                                      handler=outputhandler,             # <<<<<<<<<<<<<<
 *                                      buffering=buffering)
 * 
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_handler, __pyx_v_outputhandler) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1086
 *                                      scanner=outputscanner,
 *                                      handler=outputhandler,
 *                                      buffering=buffering)             # <<<<<<<<<<<<<<
 * 
 *         inputparser.init(inputcontext)
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_buffering, __pyx_v_buffering) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1082
 *                                     handler=inputhandler,
 *                                     buffering=buffering)
 *         outputcontext = ParseContext(output=stdout,             # <<<<<<<<<<<<<<
 *                                      termenc=termenc,
 *                                      scanner=outputscanner,
 */
  __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_outputcontext = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ctff.pyx":1088
 *                                      buffering=buffering)
 * 
 *         inputparser.init(inputcontext)             # <<<<<<<<<<<<<<
 *         outputparser.init(outputcontext)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_inputparser, __pyx_n_s_init_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_inputcontext);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_inputcontext);
  __Pyx_GIVEREF(__pyx_v_inputcontext);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ctff.pyx":1089
 * 
 *         inputparser.init(inputcontext)
 *         outputparser.init(outputcontext)             # <<<<<<<<<<<<<<
 * 
 *         self._inputhandler = inputhandler
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_outputparser, __pyx_n_s_init_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_outputcontext);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_outputcontext);
  __Pyx_GIVEREF(__pyx_v_outputcontext);
  __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1091
 *         outputparser.init(outputcontext)
 * 
 *         self._inputhandler = inputhandler             # <<<<<<<<<<<<<<
 *         self._outputhandler = outputhandler
 *         self._inputparser = inputparser
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_inputhandler_2, __pyx_v_inputhandler) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1092
 * 
 *         self._inputhandler = inputhandler
 *         self._outputhandler = outputhandler             # <<<<<<<<<<<<<<
 *         self._inputparser = inputparser
 *         self._outputparser = outputparser
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_outputhandler_2, __pyx_v_outputhandler) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1093
 *         self._inputhandler = inputhandler
 *         self._outputhandler = outputhandler
 *         self._inputparser = inputparser             # <<<<<<<<<<<<<<
 *         self._outputparser = outputparser
 *         self._inputcontext = inputcontext
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_inputparser_2, __pyx_v_inputparser) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1094
 *         self._outputhandler = outputhandler
 *         self._inputparser = inputparser
 *         self._outputparser = outputparser             # <<<<<<<<<<<<<<
 *         self._inputcontext = inputcontext
 *         self._outputcontext = outputcontext
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_outputparser_2, __pyx_v_outputparser) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1095
 *         self._inputparser = inputparser
 *         self._outputparser = outputparser
 *         self._inputcontext = inputcontext             # <<<<<<<<<<<<<<
 *         self._outputcontext = outputcontext
 *         inputhandler.handle_start(outputcontext)
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_inputcontext, __pyx_v_inputcontext) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1096
 *         self._outputparser = outputparser
 *         self._inputcontext = inputcontext
 *         self._outputcontext = outputcontext             # <<<<<<<<<<<<<<
 *         inputhandler.handle_start(outputcontext)
 *         outputhandler.handle_start(outputcontext)
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_outputcontext, __pyx_v_outputcontext) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1097
 *         self._inputcontext = inputcontext
 *         self._outputcontext = outputcontext
 *         inputhandler.handle_start(outputcontext)             # <<<<<<<<<<<<<<
 *         outputhandler.handle_start(outputcontext)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_inputhandler, __pyx_n_s_handle_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_outputcontext);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_outputcontext);
  __Pyx_GIVEREF(__pyx_v_outputcontext);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ctff.pyx":1098
 *         self._outputcontext = outputcontext
 *         inputhandler.handle_start(outputcontext)
 *         outputhandler.handle_start(outputcontext)             # <<<<<<<<<<<<<<
 * 
 *     def getpid(self):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_outputhandler, __pyx_n_s_handle_start); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_outputcontext);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_outputcontext);
  __Pyx_GIVEREF(__pyx_v_outputcontext);
  __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1070
 *         self._tty = tty
 * 
 *     def start(self, termenc,             # <<<<<<<<<<<<<<
 *               inputhandler, outputhandler,
 *               inputparser, outputparser,
 */

  /* 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("ctff.Process.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_inputcontext);
  __Pyx_XDECREF(__pyx_v_outputcontext);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":1100
 *         outputhandler.handle_start(outputcontext)
 * 
 *     def getpid(self):             # <<<<<<<<<<<<<<
 *         return self._tty.pid
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Process_5getpid(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Process_5getpid = {__Pyx_NAMESTR("getpid"), (PyCFunction)__pyx_pw_4ctff_7Process_5getpid, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Process_5getpid(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getpid (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_7Process_4getpid(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ctff_7Process_4getpid(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("getpid", 0);

  /* "ctff.pyx":1101
 * 
 *     def getpid(self):
 *         return self._tty.pid             # <<<<<<<<<<<<<<
 * 
 *     def is_alive(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tty_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pid); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __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;

  /* "ctff.pyx":1100
 *         outputhandler.handle_start(outputcontext)
 * 
 *     def getpid(self):             # <<<<<<<<<<<<<<
 *         return self._tty.pid
 * 
 */

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

/* "ctff.pyx":1103
 *         return self._tty.pid
 * 
 *     def is_alive(self):             # <<<<<<<<<<<<<<
 *         return self._tty is not None
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Process_7is_alive(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Process_7is_alive = {__Pyx_NAMESTR("is_alive"), (PyCFunction)__pyx_pw_4ctff_7Process_7is_alive, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Process_7is_alive(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_alive (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_7Process_6is_alive(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "ctff.pyx":1104
 * 
 *     def is_alive(self):
 *         return self._tty is not None             # <<<<<<<<<<<<<<
 * 
 *     def fileno(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tty_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "ctff.pyx":1103
 *         return self._tty.pid
 * 
 *     def is_alive(self):             # <<<<<<<<<<<<<<
 *         return self._tty is not None
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("ctff.Process.is_alive", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":1106
 *         return self._tty is not None
 * 
 *     def fileno(self):             # <<<<<<<<<<<<<<
 *         return self._tty.fileno()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Process_9fileno(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Process_9fileno = {__Pyx_NAMESTR("fileno"), (PyCFunction)__pyx_pw_4ctff_7Process_9fileno, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Process_9fileno(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fileno (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_7Process_8fileno(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ctff_7Process_8fileno(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("fileno", 0);

  /* "ctff.pyx":1107
 * 
 *     def fileno(self):
 *         return self._tty.fileno()             # <<<<<<<<<<<<<<
 * 
 *     def stdin_fileno(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tty_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_fileno); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __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;

  /* "ctff.pyx":1106
 *         return self._tty is not None
 * 
 *     def fileno(self):             # <<<<<<<<<<<<<<
 *         return self._tty.fileno()
 * 
 */

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

/* "ctff.pyx":1109
 *         return self._tty.fileno()
 * 
 *     def stdin_fileno(self):             # <<<<<<<<<<<<<<
 *         return self._tty.stdin_fileno()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Process_11stdin_fileno(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Process_11stdin_fileno = {__Pyx_NAMESTR("stdin_fileno"), (PyCFunction)__pyx_pw_4ctff_7Process_11stdin_fileno, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Process_11stdin_fileno(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stdin_fileno (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_7Process_10stdin_fileno(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ctff_7Process_10stdin_fileno(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("stdin_fileno", 0);

  /* "ctff.pyx":1110
 * 
 *     def stdin_fileno(self):
 *         return self._tty.stdin_fileno()             # <<<<<<<<<<<<<<
 * 
 *     def read(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tty_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdin_fileno_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __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;

  /* "ctff.pyx":1109
 *         return self._tty.fileno()
 * 
 *     def stdin_fileno(self):             # <<<<<<<<<<<<<<
 *         return self._tty.stdin_fileno()
 * 
 */

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

/* "ctff.pyx":1112
 *         return self._tty.stdin_fileno()
 * 
 *     def read(self):             # <<<<<<<<<<<<<<
 *         return self._tty.read()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Process_13read(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Process_13read = {__Pyx_NAMESTR("read"), (PyCFunction)__pyx_pw_4ctff_7Process_13read, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Process_13read(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_7Process_12read(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ctff_7Process_12read(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("read", 0);

  /* "ctff.pyx":1113
 * 
 *     def read(self):
 *         return self._tty.read()             # <<<<<<<<<<<<<<
 * 
 *     def write(self, data):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tty_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __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;

  /* "ctff.pyx":1112
 *         return self._tty.stdin_fileno()
 * 
 *     def read(self):             # <<<<<<<<<<<<<<
 *         return self._tty.read()
 * 
 */

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

/* "ctff.pyx":1115
 *         return self._tty.read()
 * 
 *     def write(self, data):             # <<<<<<<<<<<<<<
 *         self._tty.write(data)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Process_15write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Process_15write = {__Pyx_NAMESTR("write"), (PyCFunction)__pyx_pw_4ctff_7Process_15write, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Process_15write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_data = 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_self,&__pyx_n_s_data,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("write", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_data = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.Process.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_7Process_14write(__pyx_self, __pyx_v_self, __pyx_v_data);

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

static PyObject *__pyx_pf_4ctff_7Process_14write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  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("write", 0);

  /* "ctff.pyx":1116
 * 
 *     def write(self, data):
 *         self._tty.write(data)             # <<<<<<<<<<<<<<
 * 
 *     def close(self):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tty_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_data);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_data);
  __Pyx_GIVEREF(__pyx_v_data);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ctff.pyx":1115
 *         return self._tty.read()
 * 
 *     def write(self, data):             # <<<<<<<<<<<<<<
 *         self._tty.write(data)
 * 
 */

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

/* "ctff.pyx":1118
 *         self._tty.write(data)
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         tty = self._tty
 *         if tty is not None:
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Process_17close(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Process_17close = {__Pyx_NAMESTR("close"), (PyCFunction)__pyx_pw_4ctff_7Process_17close, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Process_17close(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_7Process_16close(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "ctff.pyx":1119
 * 
 *     def close(self):
 *         tty = self._tty             # <<<<<<<<<<<<<<
 *         if tty is not None:
 *             tty.close()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tty_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tty = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ctff.pyx":1120
 *     def close(self):
 *         tty = self._tty
 *         if tty is not None:             # <<<<<<<<<<<<<<
 *             tty.close()
 *             self._tty = None
 */
  __pyx_t_2 = (__pyx_v_tty != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "ctff.pyx":1121
 *         tty = self._tty
 *         if tty is not None:
 *             tty.close()             # <<<<<<<<<<<<<<
 *             self._tty = None
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tty, __pyx_n_s_close); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ctff.pyx":1122
 *         if tty is not None:
 *             tty.close()
 *             self._tty = None             # <<<<<<<<<<<<<<
 * 
 *     def end(self):
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_tty_2, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "ctff.pyx":1118
 *         self._tty.write(data)
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         tty = self._tty
 *         if tty is not None:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("ctff.Process.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tty);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":1124
 *             self._tty = None
 * 
 *     def end(self):             # <<<<<<<<<<<<<<
 *         self._inputhandler.handle_end(self._outputcontext)
 *         self._outputhandler.handle_end(self._outputcontext)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Process_19end(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Process_19end = {__Pyx_NAMESTR("end"), (PyCFunction)__pyx_pw_4ctff_7Process_19end, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Process_19end(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("end (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_7Process_18end(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "ctff.pyx":1125
 * 
 *     def end(self):
 *         self._inputhandler.handle_end(self._outputcontext)             # <<<<<<<<<<<<<<
 *         self._outputhandler.handle_end(self._outputcontext)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_inputhandler_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_end); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_outputcontext); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1126
 *     def end(self):
 *         self._inputhandler.handle_end(self._outputcontext)
 *         self._outputhandler.handle_end(self._outputcontext)             # <<<<<<<<<<<<<<
 * 
 *     def resize(self, row, col):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_outputhandler_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_end); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_outputcontext); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1124
 *             self._tty = None
 * 
 *     def end(self):             # <<<<<<<<<<<<<<
 *         self._inputhandler.handle_end(self._outputcontext)
 *         self._outputhandler.handle_end(self._outputcontext)
 */

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

/* "ctff.pyx":1128
 *         self._outputhandler.handle_end(self._outputcontext)
 * 
 *     def resize(self, row, col):             # <<<<<<<<<<<<<<
 *         self._tty.resize(row, col)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Process_21resize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Process_21resize = {__Pyx_NAMESTR("resize"), (PyCFunction)__pyx_pw_4ctff_7Process_21resize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Process_21resize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_row = 0;
  PyObject *__pyx_v_col = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("resize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_row,&__pyx_n_s_col,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);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("resize", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_col)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("resize", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "resize") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __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_row = values[1];
    __pyx_v_col = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("resize", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.Process.resize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_7Process_20resize(__pyx_self, __pyx_v_self, __pyx_v_row, __pyx_v_col);

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

static PyObject *__pyx_pf_4ctff_7Process_20resize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_row, PyObject *__pyx_v_col) {
  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("resize", 0);

  /* "ctff.pyx":1129
 * 
 *     def resize(self, row, col):
 *         self._tty.resize(row, col)             # <<<<<<<<<<<<<<
 * 
 *     def fitsize(self):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tty_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_resize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_row);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_row);
  __Pyx_GIVEREF(__pyx_v_row);
  __Pyx_INCREF(__pyx_v_col);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_col);
  __Pyx_GIVEREF(__pyx_v_col);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ctff.pyx":1128
 *         self._outputhandler.handle_end(self._outputcontext)
 * 
 *     def resize(self, row, col):             # <<<<<<<<<<<<<<
 *         self._tty.resize(row, col)
 * 
 */

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

/* "ctff.pyx":1131
 *         self._tty.resize(row, col)
 * 
 *     def fitsize(self):             # <<<<<<<<<<<<<<
 *         return self._tty.fitsize()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Process_23fitsize(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Process_23fitsize = {__Pyx_NAMESTR("fitsize"), (PyCFunction)__pyx_pw_4ctff_7Process_23fitsize, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Process_23fitsize(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fitsize (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_7Process_22fitsize(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ctff_7Process_22fitsize(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("fitsize", 0);

  /* "ctff.pyx":1132
 * 
 *     def fitsize(self):
 *         return self._tty.fitsize()             # <<<<<<<<<<<<<<
 * 
 *     def on_write(self, data):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tty_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_fitsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __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;

  /* "ctff.pyx":1131
 *         self._tty.resize(row, col)
 * 
 *     def fitsize(self):             # <<<<<<<<<<<<<<
 *         return self._tty.fitsize()
 * 
 */

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

/* "ctff.pyx":1134
 *         return self._tty.fitsize()
 * 
 *     def on_write(self, data):             # <<<<<<<<<<<<<<
 *         self._inputparser.parse(data)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Process_25on_write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Process_25on_write = {__Pyx_NAMESTR("on_write"), (PyCFunction)__pyx_pw_4ctff_7Process_25on_write, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Process_25on_write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_data = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_write (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("on_write", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "on_write") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_data = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("on_write", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.Process.on_write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_7Process_24on_write(__pyx_self, __pyx_v_self, __pyx_v_data);

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

static PyObject *__pyx_pf_4ctff_7Process_24on_write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  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("on_write", 0);

  /* "ctff.pyx":1135
 * 
 *     def on_write(self, data):
 *         self._inputparser.parse(data)             # <<<<<<<<<<<<<<
 * 
 *     def process_start(self):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_inputparser_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_parse); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_data);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_data);
  __Pyx_GIVEREF(__pyx_v_data);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ctff.pyx":1134
 *         return self._tty.fitsize()
 * 
 *     def on_write(self, data):             # <<<<<<<<<<<<<<
 *         self._inputparser.parse(data)
 * 
 */

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

/* "ctff.pyx":1137
 *         self._inputparser.parse(data)
 * 
 *     def process_start(self):             # <<<<<<<<<<<<<<
 *         self._inputhandler.handle_start(self._inputcontext)
 *         self._outputhandler.handle_start(self._outputcontext)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Process_27process_start(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Process_27process_start = {__Pyx_NAMESTR("process_start"), (PyCFunction)__pyx_pw_4ctff_7Process_27process_start, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Process_27process_start(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("process_start (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_7Process_26process_start(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "ctff.pyx":1138
 * 
 *     def process_start(self):
 *         self._inputhandler.handle_start(self._inputcontext)             # <<<<<<<<<<<<<<
 *         self._outputhandler.handle_start(self._outputcontext)
 *         self._inputhandler.handle_draw(self._outputcontext)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_inputhandler_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_inputcontext); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1139
 *     def process_start(self):
 *         self._inputhandler.handle_start(self._inputcontext)
 *         self._outputhandler.handle_start(self._outputcontext)             # <<<<<<<<<<<<<<
 *         self._inputhandler.handle_draw(self._outputcontext)
 *         self._outputhandler.handle_draw(self._outputcontext)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_outputhandler_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_start); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_outputcontext); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1140
 *         self._inputhandler.handle_start(self._inputcontext)
 *         self._outputhandler.handle_start(self._outputcontext)
 *         self._inputhandler.handle_draw(self._outputcontext)             # <<<<<<<<<<<<<<
 *         self._outputhandler.handle_draw(self._outputcontext)
 *         #self._inputcontext.flush()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_inputhandler_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_outputcontext); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1141
 *         self._outputhandler.handle_start(self._outputcontext)
 *         self._inputhandler.handle_draw(self._outputcontext)
 *         self._outputhandler.handle_draw(self._outputcontext)             # <<<<<<<<<<<<<<
 *         #self._inputcontext.flush()
 *         self._outputcontext.flush()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_outputhandler_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_draw); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_outputcontext); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1143
 *         self._outputhandler.handle_draw(self._outputcontext)
 *         #self._inputcontext.flush()
 *         self._outputcontext.flush()             # <<<<<<<<<<<<<<
 * 
 *     def process_end(self):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_outputcontext); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1137
 *         self._inputparser.parse(data)
 * 
 *     def process_start(self):             # <<<<<<<<<<<<<<
 *         self._inputhandler.handle_start(self._inputcontext)
 *         self._outputhandler.handle_start(self._outputcontext)
 */

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

/* "ctff.pyx":1145
 *         self._outputcontext.flush()
 * 
 *     def process_end(self):             # <<<<<<<<<<<<<<
 *         self._inputhandler.handle_end(self._inputcontext)
 *         self._outputhandler.handle_end(self._outputcontext)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Process_29process_end(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Process_29process_end = {__Pyx_NAMESTR("process_end"), (PyCFunction)__pyx_pw_4ctff_7Process_29process_end, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Process_29process_end(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("process_end (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_7Process_28process_end(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "ctff.pyx":1146
 * 
 *     def process_end(self):
 *         self._inputhandler.handle_end(self._inputcontext)             # <<<<<<<<<<<<<<
 *         self._outputhandler.handle_end(self._outputcontext)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_inputhandler_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_end); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_inputcontext); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1147
 *     def process_end(self):
 *         self._inputhandler.handle_end(self._inputcontext)
 *         self._outputhandler.handle_end(self._outputcontext)             # <<<<<<<<<<<<<<
 * 
 *     def process_resize(self, row, col):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_outputhandler_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_end); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_outputcontext); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1145
 *         self._outputcontext.flush()
 * 
 *     def process_end(self):             # <<<<<<<<<<<<<<
 *         self._inputhandler.handle_end(self._inputcontext)
 *         self._outputhandler.handle_end(self._outputcontext)
 */

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

/* "ctff.pyx":1149
 *         self._outputhandler.handle_end(self._outputcontext)
 * 
 *     def process_resize(self, row, col):             # <<<<<<<<<<<<<<
 *         try:
 *             self._inputhandler.handle_resize(self._inputcontext, row, col)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Process_31process_resize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Process_31process_resize = {__Pyx_NAMESTR("process_resize"), (PyCFunction)__pyx_pw_4ctff_7Process_31process_resize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Process_31process_resize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_row = 0;
  PyObject *__pyx_v_col = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("process_resize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_row,&__pyx_n_s_col,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);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("process_resize", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_col)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("process_resize", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "process_resize") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __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_row = values[1];
    __pyx_v_col = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("process_resize", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.Process.process_resize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_7Process_30process_resize(__pyx_self, __pyx_v_self, __pyx_v_row, __pyx_v_col);

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

static PyObject *__pyx_pf_4ctff_7Process_30process_resize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_row, PyObject *__pyx_v_col) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  char const *__pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("process_resize", 0);

  /* "ctff.pyx":1150
 * 
 *     def process_resize(self, row, col):
 *         try:             # <<<<<<<<<<<<<<
 *             self._inputhandler.handle_resize(self._inputcontext, row, col)
 *             self._outputhandler.handle_resize(self._outputcontext, row, col)
 */
  /*try:*/ {

    /* "ctff.pyx":1151
 *     def process_resize(self, row, col):
 *         try:
 *             self._inputhandler.handle_resize(self._inputcontext, row, col)             # <<<<<<<<<<<<<<
 *             self._outputhandler.handle_resize(self._outputcontext, row, col)
 *         finally:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_inputhandler_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_resize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_inputcontext); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_row);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_row);
    __Pyx_GIVEREF(__pyx_v_row);
    __Pyx_INCREF(__pyx_v_col);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_col);
    __Pyx_GIVEREF(__pyx_v_col);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "ctff.pyx":1152
 *         try:
 *             self._inputhandler.handle_resize(self._inputcontext, row, col)
 *             self._outputhandler.handle_resize(self._outputcontext, row, col)             # <<<<<<<<<<<<<<
 *         finally:
 *             self._resized = False
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_outputhandler_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_resize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_outputcontext); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_row);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_row);
    __Pyx_GIVEREF(__pyx_v_row);
    __Pyx_INCREF(__pyx_v_col);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_col);
    __Pyx_GIVEREF(__pyx_v_col);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "ctff.pyx":1154
 *             self._outputhandler.handle_resize(self._outputcontext, row, col)
 *         finally:
 *             self._resized = False             # <<<<<<<<<<<<<<
 * 
 *     def process_input(self, data):
 */
  /*finally:*/ {
    /*normal exit:*/{
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_resized, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L5;
    }
    /*exception exit:*/{
      __pyx_L4_error:;
      __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
      {
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_resized, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
      __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
      goto __pyx_L1_error;
      __pyx_L7_error:;
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L5:;
  }

  /* "ctff.pyx":1149
 *         self._outputhandler.handle_end(self._outputcontext)
 * 
 *     def process_resize(self, row, col):             # <<<<<<<<<<<<<<
 *         try:
 *             self._inputhandler.handle_resize(self._inputcontext, row, col)
 */

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

/* "ctff.pyx":1156
 *             self._resized = False
 * 
 *     def process_input(self, data):             # <<<<<<<<<<<<<<
 *         if not self._esc_timer is None:
 *             self._esc_timer.cancel()
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Process_33process_input(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Process_33process_input = {__Pyx_NAMESTR("process_input"), (PyCFunction)__pyx_pw_4ctff_7Process_33process_input, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Process_33process_input(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_data = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("process_input (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("process_input", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "process_input") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_data = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("process_input", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.Process.process_input", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_7Process_32process_input(__pyx_self, __pyx_v_self, __pyx_v_data);

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

/* "ctff.pyx":1170
 *             self._outputcontext.flush()
 *         else:
 *             def dispatch_esc():             # <<<<<<<<<<<<<<
 *                 self._inputparser.flush()
 *                 self._inputparser.reset()
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Process_13process_input_1dispatch_esc(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Process_13process_input_1dispatch_esc = {__Pyx_NAMESTR("dispatch_esc"), (PyCFunction)__pyx_pw_4ctff_7Process_13process_input_1dispatch_esc, METH_NOARGS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Process_13process_input_1dispatch_esc(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dispatch_esc (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_7Process_13process_input_dispatch_esc(__pyx_self);

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

static PyObject *__pyx_pf_4ctff_7Process_13process_input_dispatch_esc(PyObject *__pyx_self) {
  struct __pyx_obj_4ctff___pyx_scope_struct_2_process_input *__pyx_cur_scope;
  struct __pyx_obj_4ctff___pyx_scope_struct_2_process_input *__pyx_outer_scope;
  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("dispatch_esc", 0);
  __pyx_outer_scope = (struct __pyx_obj_4ctff___pyx_scope_struct_2_process_input *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "ctff.pyx":1171
 *         else:
 *             def dispatch_esc():
 *                 self._inputparser.flush()             # <<<<<<<<<<<<<<
 *                 self._inputparser.reset()
 *                 self._inputhandler.handle_draw(self._outputcontext)
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_inputparser_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1172
 *             def dispatch_esc():
 *                 self._inputparser.flush()
 *                 self._inputparser.reset()             # <<<<<<<<<<<<<<
 *                 self._inputhandler.handle_draw(self._outputcontext)
 *                 self._outputhandler.handle_draw(self._outputcontext)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_inputparser_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_reset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1173
 *                 self._inputparser.flush()
 *                 self._inputparser.reset()
 *                 self._inputhandler.handle_draw(self._outputcontext)             # <<<<<<<<<<<<<<
 *                 self._outputhandler.handle_draw(self._outputcontext)
 *                 #self._inputcontext.flush()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_inputhandler_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_outputcontext); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1174
 *                 self._inputparser.reset()
 *                 self._inputhandler.handle_draw(self._outputcontext)
 *                 self._outputhandler.handle_draw(self._outputcontext)             # <<<<<<<<<<<<<<
 *                 #self._inputcontext.flush()
 *                 self._outputcontext.flush()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_outputhandler_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_handle_draw); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_outputcontext); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1176
 *                 self._outputhandler.handle_draw(self._outputcontext)
 *                 #self._inputcontext.flush()
 *                 self._outputcontext.flush()             # <<<<<<<<<<<<<<
 *             self._esc_timer = threading.Timer(_ESC_TIMEOUT, dispatch_esc)
 *             self._esc_timer.start()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_outputcontext); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1170
 *             self._outputcontext.flush()
 *         else:
 *             def dispatch_esc():             # <<<<<<<<<<<<<<
 *                 self._inputparser.flush()
 *                 self._inputparser.reset()
 */

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

/* "ctff.pyx":1156
 *             self._resized = False
 * 
 *     def process_input(self, data):             # <<<<<<<<<<<<<<
 *         if not self._esc_timer is None:
 *             self._esc_timer.cancel()
 */

static PyObject *__pyx_pf_4ctff_7Process_32process_input(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  struct __pyx_obj_4ctff___pyx_scope_struct_2_process_input *__pyx_cur_scope;
  PyObject *__pyx_v_dispatch_esc = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("process_input", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ctff___pyx_scope_struct_2_process_input *)__pyx_tp_new_4ctff___pyx_scope_struct_2_process_input(__pyx_ptype_4ctff___pyx_scope_struct_2_process_input, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);

  /* "ctff.pyx":1157
 * 
 *     def process_input(self, data):
 *         if not self._esc_timer is None:             # <<<<<<<<<<<<<<
 *             self._esc_timer.cancel()
 *             self._esc_timer = None
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_esc_timer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "ctff.pyx":1158
 *     def process_input(self, data):
 *         if not self._esc_timer is None:
 *             self._esc_timer.cancel()             # <<<<<<<<<<<<<<
 *             self._esc_timer = None
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_esc_timer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cancel); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "ctff.pyx":1159
 *         if not self._esc_timer is None:
 *             self._esc_timer.cancel()
 *             self._esc_timer = None             # <<<<<<<<<<<<<<
 * 
 *         self._inputparser.parse(data)
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_esc_timer, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "ctff.pyx":1161
 *             self._esc_timer = None
 * 
 *         self._inputparser.parse(data)             # <<<<<<<<<<<<<<
 * 
 *         # set ESC timer
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_inputparser_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_parse); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_data);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_data);
  __Pyx_GIVEREF(__pyx_v_data);
  __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ctff.pyx":1164
 * 
 *         # set ESC timer
 *         if not self._inputparser.state_is_esc():             # <<<<<<<<<<<<<<
 *             self._inputhandler.handle_draw(self._outputcontext)
 *             self._outputhandler.handle_draw(self._outputcontext)
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_inputparser_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_state_is_esc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __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_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = ((!__pyx_t_3) != 0);
  if (__pyx_t_2) {

    /* "ctff.pyx":1165
 *         # set ESC timer
 *         if not self._inputparser.state_is_esc():
 *             self._inputhandler.handle_draw(self._outputcontext)             # <<<<<<<<<<<<<<
 *             self._outputhandler.handle_draw(self._outputcontext)
 *             #self._inputcontext.flush()
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_inputhandler_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_handle_draw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_outputcontext); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ctff.pyx":1166
 *         if not self._inputparser.state_is_esc():
 *             self._inputhandler.handle_draw(self._outputcontext)
 *             self._outputhandler.handle_draw(self._outputcontext)             # <<<<<<<<<<<<<<
 *             #self._inputcontext.flush()
 *             self._outputcontext.flush()
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_outputhandler_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_handle_draw); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_outputcontext); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ctff.pyx":1168
 *             self._outputhandler.handle_draw(self._outputcontext)
 *             #self._inputcontext.flush()
 *             self._outputcontext.flush()             # <<<<<<<<<<<<<<
 *         else:
 *             def dispatch_esc():
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_outputcontext); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_flush); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "ctff.pyx":1170
 *             self._outputcontext.flush()
 *         else:
 *             def dispatch_esc():             # <<<<<<<<<<<<<<
 *                 self._inputparser.flush()
 *                 self._inputparser.reset()
 */
    __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Process_13process_input_1dispatch_esc, 0, __pyx_n_s_Process_process_input_locals_dis, ((PyObject*)__pyx_cur_scope), __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_v_dispatch_esc = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "ctff.pyx":1177
 *                 #self._inputcontext.flush()
 *                 self._outputcontext.flush()
 *             self._esc_timer = threading.Timer(_ESC_TIMEOUT, dispatch_esc)             # <<<<<<<<<<<<<<
 *             self._esc_timer.start()
 * 
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_threading); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Timer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_ESC_TIMEOUT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_dispatch_esc);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_dispatch_esc);
    __Pyx_GIVEREF(__pyx_v_dispatch_esc);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_esc_timer, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ctff.pyx":1178
 *                 self._outputcontext.flush()
 *             self._esc_timer = threading.Timer(_ESC_TIMEOUT, dispatch_esc)
 *             self._esc_timer.start()             # <<<<<<<<<<<<<<
 * 
 *     def process_output(self, data):
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_esc_timer); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_start); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_L4:;

  /* "ctff.pyx":1156
 *             self._resized = False
 * 
 *     def process_input(self, data):             # <<<<<<<<<<<<<<
 *         if not self._esc_timer is None:
 *             self._esc_timer.cancel()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("ctff.Process.process_input", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dispatch_esc);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":1180
 *             self._esc_timer.start()
 * 
 *     def process_output(self, data):             # <<<<<<<<<<<<<<
 *         self._outputparser.parse(data)
 *         if not self._outputparser.state_is_esc():
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Process_35process_output(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Process_35process_output = {__Pyx_NAMESTR("process_output"), (PyCFunction)__pyx_pw_4ctff_7Process_35process_output, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Process_35process_output(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_data = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("process_output (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("process_output", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "process_output") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_data = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("process_output", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.Process.process_output", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_7Process_34process_output(__pyx_self, __pyx_v_self, __pyx_v_data);

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

static PyObject *__pyx_pf_4ctff_7Process_34process_output(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("process_output", 0);

  /* "ctff.pyx":1181
 * 
 *     def process_output(self, data):
 *         self._outputparser.parse(data)             # <<<<<<<<<<<<<<
 *         if not self._outputparser.state_is_esc():
 *             self._inputhandler.handle_draw(self._outputcontext)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_outputparser_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_parse); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_data);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_data);
  __Pyx_GIVEREF(__pyx_v_data);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ctff.pyx":1182
 *     def process_output(self, data):
 *         self._outputparser.parse(data)
 *         if not self._outputparser.state_is_esc():             # <<<<<<<<<<<<<<
 *             self._inputhandler.handle_draw(self._outputcontext)
 *             self._outputhandler.handle_draw(self._outputcontext)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_outputparser_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_state_is_esc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (__pyx_t_5) {

    /* "ctff.pyx":1183
 *         self._outputparser.parse(data)
 *         if not self._outputparser.state_is_esc():
 *             self._inputhandler.handle_draw(self._outputcontext)             # <<<<<<<<<<<<<<
 *             self._outputhandler.handle_draw(self._outputcontext)
 *             #self._inputcontext.flush()
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_inputhandler_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_handle_draw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_outputcontext); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "ctff.pyx":1184
 *         if not self._outputparser.state_is_esc():
 *             self._inputhandler.handle_draw(self._outputcontext)
 *             self._outputhandler.handle_draw(self._outputcontext)             # <<<<<<<<<<<<<<
 *             #self._inputcontext.flush()
 *             self._outputcontext.flush()
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_outputhandler_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_handle_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_outputcontext); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "ctff.pyx":1186
 *             self._outputhandler.handle_draw(self._outputcontext)
 *             #self._inputcontext.flush()
 *             self._outputcontext.flush()             # <<<<<<<<<<<<<<
 * 
 *     def on_read(self, data):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_outputcontext); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flush); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "ctff.pyx":1180
 *             self._esc_timer.start()
 * 
 *     def process_output(self, data):             # <<<<<<<<<<<<<<
 *         self._outputparser.parse(data)
 *         if not self._outputparser.state_is_esc():
 */

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

/* "ctff.pyx":1188
 *             self._outputcontext.flush()
 * 
 *     def on_read(self, data):             # <<<<<<<<<<<<<<
 *         self._outputparser.parse(data)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Process_37on_read(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Process_37on_read = {__Pyx_NAMESTR("on_read"), (PyCFunction)__pyx_pw_4ctff_7Process_37on_read, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Process_37on_read(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_data = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_read (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("on_read", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "on_read") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_data = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("on_read", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.Process.on_read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_7Process_36on_read(__pyx_self, __pyx_v_self, __pyx_v_data);

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

static PyObject *__pyx_pf_4ctff_7Process_36on_read(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  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("on_read", 0);

  /* "ctff.pyx":1189
 * 
 *     def on_read(self, data):
 *         self._outputparser.parse(data)             # <<<<<<<<<<<<<<
 * 
 *     def drain(self):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_outputparser_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_parse); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_data);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_data);
  __Pyx_GIVEREF(__pyx_v_data);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ctff.pyx":1188
 *             self._outputcontext.flush()
 * 
 *     def on_read(self, data):             # <<<<<<<<<<<<<<
 *         self._outputparser.parse(data)
 * 
 */

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

/* "ctff.pyx":1191
 *         self._outputparser.parse(data)
 * 
 *     def drain(self):             # <<<<<<<<<<<<<<
 *         self._inputparser.reset()
 *         self._inputcontext.assign('')
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Process_39drain(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Process_39drain = {__Pyx_NAMESTR("drain"), (PyCFunction)__pyx_pw_4ctff_7Process_39drain, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Process_39drain(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("drain (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_7Process_38drain(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ctff_7Process_38drain(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("drain", 0);

  /* "ctff.pyx":1192
 * 
 *     def drain(self):
 *         self._inputparser.reset()             # <<<<<<<<<<<<<<
 *         self._inputcontext.assign('')
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_inputparser_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_reset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1193
 *     def drain(self):
 *         self._inputparser.reset()
 *         self._inputcontext.assign('')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_inputcontext); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_assign); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1191
 *         self._outputparser.parse(data)
 * 
 *     def drain(self):             # <<<<<<<<<<<<<<
 *         self._inputparser.reset()
 *         self._inputcontext.assign('')
 */

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

/* "ctff.pyx":1202
 * class Session:
 * 
 *     def __init__(self, tty):             # <<<<<<<<<<<<<<
 * 
 *         self._alive = True
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Session_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Session_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_4ctff_7Session_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Session_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_tty = 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_tty,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tty)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_tty = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.Session.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_7Session___init__(__pyx_self, __pyx_v_self, __pyx_v_tty);

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

static PyObject *__pyx_pf_4ctff_7Session___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_tty) {
  PyObject *__pyx_v_stdin_fileno = NULL;
  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);

  /* "ctff.pyx":1204
 *     def __init__(self, tty):
 * 
 *         self._alive = True             # <<<<<<<<<<<<<<
 *         self._mainprocess = Process(tty)
 *         self._input_target = self._mainprocess
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_alive, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1205
 * 
 *         self._alive = True
 *         self._mainprocess = Process(tty)             # <<<<<<<<<<<<<<
 *         self._input_target = self._mainprocess
 *         stdin_fileno = self._mainprocess.stdin_fileno()
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Process); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_tty);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_tty);
  __Pyx_GIVEREF(__pyx_v_tty);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_mainprocess, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ctff.pyx":1206
 *         self._alive = True
 *         self._mainprocess = Process(tty)
 *         self._input_target = self._mainprocess             # <<<<<<<<<<<<<<
 *         stdin_fileno = self._mainprocess.stdin_fileno()
 *         self._rfds = [stdin_fileno]
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mainprocess); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_input_target, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ctff.pyx":1207
 *         self._mainprocess = Process(tty)
 *         self._input_target = self._mainprocess
 *         stdin_fileno = self._mainprocess.stdin_fileno()             # <<<<<<<<<<<<<<
 *         self._rfds = [stdin_fileno]
 *         self._xfds = [stdin_fileno]
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mainprocess); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_stdin_fileno_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_stdin_fileno = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ctff.pyx":1208
 *         self._input_target = self._mainprocess
 *         stdin_fileno = self._mainprocess.stdin_fileno()
 *         self._rfds = [stdin_fileno]             # <<<<<<<<<<<<<<
 *         self._xfds = [stdin_fileno]
 *         self._resized = False
 */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_stdin_fileno);
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_stdin_fileno);
  __Pyx_GIVEREF(__pyx_v_stdin_fileno);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_rfds, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ctff.pyx":1209
 *         stdin_fileno = self._mainprocess.stdin_fileno()
 *         self._rfds = [stdin_fileno]
 *         self._xfds = [stdin_fileno]             # <<<<<<<<<<<<<<
 *         self._resized = False
 *         self._process_map = {}
 */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_stdin_fileno);
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_stdin_fileno);
  __Pyx_GIVEREF(__pyx_v_stdin_fileno);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_xfds, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ctff.pyx":1210
 *         self._rfds = [stdin_fileno]
 *         self._xfds = [stdin_fileno]
 *         self._resized = False             # <<<<<<<<<<<<<<
 *         self._process_map = {}
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_resized, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1211
 *         self._xfds = [stdin_fileno]
 *         self._resized = False
 *         self._process_map = {}             # <<<<<<<<<<<<<<
 * 
 *     # deprecated
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_process_map, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ctff.pyx":1202
 * class Session:
 * 
 *     def __init__(self, tty):             # <<<<<<<<<<<<<<
 * 
 *         self._alive = True
 */

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

/* "ctff.pyx":1214
 * 
 *     # deprecated
 *     def add_subtty(self, term, lang,             # <<<<<<<<<<<<<<
 *                    command, row, col,
 *                    termenc,
 */

static PyObject *__pyx_pf_4ctff_7Session_22__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_inputhandler);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_inputhandler);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_inputhandler);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_outputhandler);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_outputhandler);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_outputhandler);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Session_3add_subtty(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Session_3add_subtty = {__Pyx_NAMESTR("add_subtty"), (PyCFunction)__pyx_pw_4ctff_7Session_3add_subtty, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Session_3add_subtty(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_term = 0;
  PyObject *__pyx_v_lang = 0;
  PyObject *__pyx_v_command = 0;
  PyObject *__pyx_v_row = 0;
  PyObject *__pyx_v_col = 0;
  PyObject *__pyx_v_termenc = 0;
  PyObject *__pyx_v_inputhandler = 0;
  PyObject *__pyx_v_outputhandler = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_subtty (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_term,&__pyx_n_s_lang,&__pyx_n_s_command,&__pyx_n_s_row,&__pyx_n_s_col,&__pyx_n_s_termenc,&__pyx_n_s_inputhandler,&__pyx_n_s_outputhandler,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    __pyx_defaults2 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self);
    values[7] = __pyx_dynamic_args->__pyx_arg_inputhandler;
    values[8] = __pyx_dynamic_args->__pyx_arg_outputhandler;
    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);
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_term)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add_subtty", 0, 7, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lang)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add_subtty", 0, 7, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_command)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add_subtty", 0, 7, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add_subtty", 0, 7, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_col)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add_subtty", 0, 7, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  6:
        if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_termenc)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add_subtty", 0, 7, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  7:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_inputhandler);
          if (value) { values[7] = value; kw_args--; }
        }
        case  8:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_outputhandler);
          if (value) { values[8] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_subtty") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_term = values[1];
    __pyx_v_lang = values[2];
    __pyx_v_command = values[3];
    __pyx_v_row = values[4];
    __pyx_v_col = values[5];
    __pyx_v_termenc = values[6];
    __pyx_v_inputhandler = values[7];
    __pyx_v_outputhandler = values[8];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_subtty", 0, 7, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.Session.add_subtty", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_7Session_2add_subtty(__pyx_self, __pyx_v_self, __pyx_v_term, __pyx_v_lang, __pyx_v_command, __pyx_v_row, __pyx_v_col, __pyx_v_termenc, __pyx_v_inputhandler, __pyx_v_outputhandler);

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

static PyObject *__pyx_pf_4ctff_7Session_2add_subtty(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_term, PyObject *__pyx_v_lang, PyObject *__pyx_v_command, PyObject *__pyx_v_row, PyObject *__pyx_v_col, PyObject *__pyx_v_termenc, PyObject *__pyx_v_inputhandler, PyObject *__pyx_v_outputhandler) {
  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("add_subtty", 0);

  /* "ctff.pyx":1219
 *                    inputhandler=DefaultHandler(),
 *                    outputhandler=DefaultHandler()):
 *         return self.create_process(term, lang, command, row, col,             # <<<<<<<<<<<<<<
 *                                    termenc, inputhandler, outputhandler)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_create_process); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "ctff.pyx":1220
 *                    outputhandler=DefaultHandler()):
 *         return self.create_process(term, lang, command, row, col,
 *                                    termenc, inputhandler, outputhandler)             # <<<<<<<<<<<<<<
 * 
 *     def create_process(self, term, lang,
 */
  __pyx_t_2 = PyTuple_New(8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_term);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_term);
  __Pyx_GIVEREF(__pyx_v_term);
  __Pyx_INCREF(__pyx_v_lang);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_lang);
  __Pyx_GIVEREF(__pyx_v_lang);
  __Pyx_INCREF(__pyx_v_command);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_command);
  __Pyx_GIVEREF(__pyx_v_command);
  __Pyx_INCREF(__pyx_v_row);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_row);
  __Pyx_GIVEREF(__pyx_v_row);
  __Pyx_INCREF(__pyx_v_col);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_col);
  __Pyx_GIVEREF(__pyx_v_col);
  __Pyx_INCREF(__pyx_v_termenc);
  PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_v_termenc);
  __Pyx_GIVEREF(__pyx_v_termenc);
  __Pyx_INCREF(__pyx_v_inputhandler);
  PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_v_inputhandler);
  __Pyx_GIVEREF(__pyx_v_inputhandler);
  __Pyx_INCREF(__pyx_v_outputhandler);
  PyTuple_SET_ITEM(__pyx_t_2, 7, __pyx_v_outputhandler);
  __Pyx_GIVEREF(__pyx_v_outputhandler);

  /* "ctff.pyx":1219
 *                    inputhandler=DefaultHandler(),
 *                    outputhandler=DefaultHandler()):
 *         return self.create_process(term, lang, command, row, col,             # <<<<<<<<<<<<<<
 *                                    termenc, inputhandler, outputhandler)
 * 
 */
  __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "ctff.pyx":1214
 * 
 *     # deprecated
 *     def add_subtty(self, term, lang,             # <<<<<<<<<<<<<<
 *                    command, row, col,
 *                    termenc,
 */

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

/* "ctff.pyx":1222
 *                                    termenc, inputhandler, outputhandler)
 * 
 *     def create_process(self, term, lang,             # <<<<<<<<<<<<<<
 *                        command, row, col,
 *                        termenc,
 */

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

  /* "ctff.pyx":1231
 *                        inputscanner=DefaultScanner(),
 *                        outputscanner=DefaultScanner(),
 *                        buffering=False):             # <<<<<<<<<<<<<<
 * 
 *         tty = DefaultPTY(term, lang, command, sys.stdin, row, col)
 */
  __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_inputhandler);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_inputhandler);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_inputhandler);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_outputhandler);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_outputhandler);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_outputhandler);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_inputparser);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_inputparser);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_inputparser);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_outputparser);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_outputparser);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_outputparser);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_inputscanner);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_inputscanner);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_inputscanner);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_outputscanner);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_outputscanner);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_outputscanner);
  __Pyx_INCREF(((PyObject *)Py_False));
  PyTuple_SET_ITEM(__pyx_t_1, 6, ((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));

  /* "ctff.pyx":1222
 *                                    termenc, inputhandler, outputhandler)
 * 
 *     def create_process(self, term, lang,             # <<<<<<<<<<<<<<
 *                        command, row, col,
 *                        termenc,
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Session_5create_process(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Session_5create_process = {__Pyx_NAMESTR("create_process"), (PyCFunction)__pyx_pw_4ctff_7Session_5create_process, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Session_5create_process(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_term = 0;
  PyObject *__pyx_v_lang = 0;
  PyObject *__pyx_v_command = 0;
  PyObject *__pyx_v_row = 0;
  PyObject *__pyx_v_col = 0;
  PyObject *__pyx_v_termenc = 0;
  PyObject *__pyx_v_inputhandler = 0;
  PyObject *__pyx_v_outputhandler = 0;
  PyObject *__pyx_v_inputparser = 0;
  PyObject *__pyx_v_outputparser = 0;
  PyObject *__pyx_v_inputscanner = 0;
  PyObject *__pyx_v_outputscanner = 0;
  PyObject *__pyx_v_buffering = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_process (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_term,&__pyx_n_s_lang,&__pyx_n_s_command,&__pyx_n_s_row,&__pyx_n_s_col,&__pyx_n_s_termenc,&__pyx_n_s_inputhandler,&__pyx_n_s_outputhandler,&__pyx_n_s_inputparser,&__pyx_n_s_outputparser,&__pyx_n_s_inputscanner,&__pyx_n_s_outputscanner,&__pyx_n_s_buffering,0};
    PyObject* values[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    __pyx_defaults3 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self);
    values[7] = __pyx_dynamic_args->__pyx_arg_inputhandler;
    values[8] = __pyx_dynamic_args->__pyx_arg_outputhandler;
    values[9] = __pyx_dynamic_args->__pyx_arg_inputparser;
    values[10] = __pyx_dynamic_args->__pyx_arg_outputparser;
    values[11] = __pyx_dynamic_args->__pyx_arg_inputscanner;
    values[12] = __pyx_dynamic_args->__pyx_arg_outputscanner;
    values[13] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_term)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create_process", 0, 7, 14, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lang)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create_process", 0, 7, 14, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_command)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create_process", 0, 7, 14, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create_process", 0, 7, 14, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_col)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create_process", 0, 7, 14, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  6:
        if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_termenc)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create_process", 0, 7, 14, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  7:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_inputhandler);
          if (value) { values[7] = value; kw_args--; }
        }
        case  8:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_outputhandler);
          if (value) { values[8] = value; kw_args--; }
        }
        case  9:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_inputparser);
          if (value) { values[9] = value; kw_args--; }
        }
        case 10:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_outputparser);
          if (value) { values[10] = value; kw_args--; }
        }
        case 11:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_inputscanner);
          if (value) { values[11] = value; kw_args--; }
        }
        case 12:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_outputscanner);
          if (value) { values[12] = value; kw_args--; }
        }
        case 13:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buffering);
          if (value) { values[13] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create_process") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_term = values[1];
    __pyx_v_lang = values[2];
    __pyx_v_command = values[3];
    __pyx_v_row = values[4];
    __pyx_v_col = values[5];
    __pyx_v_termenc = values[6];
    __pyx_v_inputhandler = values[7];
    __pyx_v_outputhandler = values[8];
    __pyx_v_inputparser = values[9];
    __pyx_v_outputparser = values[10];
    __pyx_v_inputscanner = values[11];
    __pyx_v_outputscanner = values[12];
    __pyx_v_buffering = values[13];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create_process", 0, 7, 14, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.Session.create_process", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_7Session_4create_process(__pyx_self, __pyx_v_self, __pyx_v_term, __pyx_v_lang, __pyx_v_command, __pyx_v_row, __pyx_v_col, __pyx_v_termenc, __pyx_v_inputhandler, __pyx_v_outputhandler, __pyx_v_inputparser, __pyx_v_outputparser, __pyx_v_inputscanner, __pyx_v_outputscanner, __pyx_v_buffering);

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

static PyObject *__pyx_pf_4ctff_7Session_4create_process(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_term, PyObject *__pyx_v_lang, PyObject *__pyx_v_command, PyObject *__pyx_v_row, PyObject *__pyx_v_col, PyObject *__pyx_v_termenc, PyObject *__pyx_v_inputhandler, PyObject *__pyx_v_outputhandler, PyObject *__pyx_v_inputparser, PyObject *__pyx_v_outputparser, PyObject *__pyx_v_inputscanner, PyObject *__pyx_v_outputscanner, PyObject *__pyx_v_buffering) {
  PyObject *__pyx_v_tty = NULL;
  PyObject *__pyx_v_process = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create_process", 0);

  /* "ctff.pyx":1233
 *                        buffering=False):
 * 
 *         tty = DefaultPTY(term, lang, command, sys.stdin, row, col)             # <<<<<<<<<<<<<<
 *         process = Process(tty)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DefaultPTY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdin); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_term);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_term);
  __Pyx_GIVEREF(__pyx_v_term);
  __Pyx_INCREF(__pyx_v_lang);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_lang);
  __Pyx_GIVEREF(__pyx_v_lang);
  __Pyx_INCREF(__pyx_v_command);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_command);
  __Pyx_GIVEREF(__pyx_v_command);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_row);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_row);
  __Pyx_GIVEREF(__pyx_v_row);
  __Pyx_INCREF(__pyx_v_col);
  PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_v_col);
  __Pyx_GIVEREF(__pyx_v_col);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_tty = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ctff.pyx":1234
 * 
 *         tty = DefaultPTY(term, lang, command, sys.stdin, row, col)
 *         process = Process(tty)             # <<<<<<<<<<<<<<
 * 
 *         self._init_process(process,
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Process); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_tty);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_tty);
  __Pyx_GIVEREF(__pyx_v_tty);
  __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_process = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ctff.pyx":1236
 *         process = Process(tty)
 * 
 *         self._init_process(process,             # <<<<<<<<<<<<<<
 *                            termenc,
 *                            inputhandler, outputhandler,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_init_process); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "ctff.pyx":1240
 *                            inputhandler, outputhandler,
 *                            inputparser, outputparser,
 *                            inputscanner, outputscanner,             # <<<<<<<<<<<<<<
 *                            buffering=buffering)
 *         return process
 */
  __pyx_t_2 = PyTuple_New(8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_process);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_process);
  __Pyx_GIVEREF(__pyx_v_process);
  __Pyx_INCREF(__pyx_v_termenc);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_termenc);
  __Pyx_GIVEREF(__pyx_v_termenc);
  __Pyx_INCREF(__pyx_v_inputhandler);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_inputhandler);
  __Pyx_GIVEREF(__pyx_v_inputhandler);
  __Pyx_INCREF(__pyx_v_outputhandler);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_outputhandler);
  __Pyx_GIVEREF(__pyx_v_outputhandler);
  __Pyx_INCREF(__pyx_v_inputparser);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_inputparser);
  __Pyx_GIVEREF(__pyx_v_inputparser);
  __Pyx_INCREF(__pyx_v_outputparser);
  PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_v_outputparser);
  __Pyx_GIVEREF(__pyx_v_outputparser);
  __Pyx_INCREF(__pyx_v_inputscanner);
  PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_v_inputscanner);
  __Pyx_GIVEREF(__pyx_v_inputscanner);
  __Pyx_INCREF(__pyx_v_outputscanner);
  PyTuple_SET_ITEM(__pyx_t_2, 7, __pyx_v_outputscanner);
  __Pyx_GIVEREF(__pyx_v_outputscanner);

  /* "ctff.pyx":1236
 *         process = Process(tty)
 * 
 *         self._init_process(process,             # <<<<<<<<<<<<<<
 *                            termenc,
 *                            inputhandler, outputhandler,
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);

  /* "ctff.pyx":1241
 *                            inputparser, outputparser,
 *                            inputscanner, outputscanner,
 *                            buffering=buffering)             # <<<<<<<<<<<<<<
 *         return process
 * 
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_buffering, __pyx_v_buffering) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1236
 *         process = Process(tty)
 * 
 *         self._init_process(process,             # <<<<<<<<<<<<<<
 *                            termenc,
 *                            inputhandler, outputhandler,
 */
  __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":1242
 *                            inputscanner, outputscanner,
 *                            buffering=buffering)
 *         return process             # <<<<<<<<<<<<<<
 * 
 *     def getactiveprocess(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_process);
  __pyx_r = __pyx_v_process;
  goto __pyx_L0;

  /* "ctff.pyx":1222
 *                                    termenc, inputhandler, outputhandler)
 * 
 *     def create_process(self, term, lang,             # <<<<<<<<<<<<<<
 *                        command, row, col,
 *                        termenc,
 */

  /* 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("ctff.Session.create_process", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tty);
  __Pyx_XDECREF(__pyx_v_process);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":1244
 *         return process
 * 
 *     def getactiveprocess(self):             # <<<<<<<<<<<<<<
 *         return self._input_target
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Session_7getactiveprocess(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Session_7getactiveprocess = {__Pyx_NAMESTR("getactiveprocess"), (PyCFunction)__pyx_pw_4ctff_7Session_7getactiveprocess, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Session_7getactiveprocess(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getactiveprocess (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_7Session_6getactiveprocess(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "ctff.pyx":1245
 * 
 *     def getactiveprocess(self):
 *         return self._input_target             # <<<<<<<<<<<<<<
 * 
 *     def process_is_active(self, process):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_input_target); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "ctff.pyx":1244
 *         return process
 * 
 *     def getactiveprocess(self):             # <<<<<<<<<<<<<<
 *         return self._input_target
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("ctff.Session.getactiveprocess", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":1247
 *         return self._input_target
 * 
 *     def process_is_active(self, process):             # <<<<<<<<<<<<<<
 *         return self._input_target == process
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Session_9process_is_active(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Session_9process_is_active = {__Pyx_NAMESTR("process_is_active"), (PyCFunction)__pyx_pw_4ctff_7Session_9process_is_active, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Session_9process_is_active(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_process = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("process_is_active (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_process,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_process)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("process_is_active", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "process_is_active") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_process = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("process_is_active", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.Session.process_is_active", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_7Session_8process_is_active(__pyx_self, __pyx_v_self, __pyx_v_process);

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

static PyObject *__pyx_pf_4ctff_7Session_8process_is_active(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_process) {
  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("process_is_active", 0);

  /* "ctff.pyx":1248
 * 
 *     def process_is_active(self, process):
 *         return self._input_target == process             # <<<<<<<<<<<<<<
 * 
 *     def focus_process(self, process):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_input_target); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_v_process, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "ctff.pyx":1247
 *         return self._input_target
 * 
 *     def process_is_active(self, process):             # <<<<<<<<<<<<<<
 *         return self._input_target == process
 * 
 */

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

/* "ctff.pyx":1250
 *         return self._input_target == process
 * 
 *     def focus_process(self, process):             # <<<<<<<<<<<<<<
 *         if process.is_alive():
 *             logging.info("Switching focus: fileno=%d" % process.fileno())
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Session_11focus_process(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Session_11focus_process = {__Pyx_NAMESTR("focus_process"), (PyCFunction)__pyx_pw_4ctff_7Session_11focus_process, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Session_11focus_process(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_process = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("focus_process (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_process,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_process)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("focus_process", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "focus_process") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_process = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("focus_process", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.Session.focus_process", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_7Session_10focus_process(__pyx_self, __pyx_v_self, __pyx_v_process);

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

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

  /* "ctff.pyx":1251
 * 
 *     def focus_process(self, process):
 *         if process.is_alive():             # <<<<<<<<<<<<<<
 *             logging.info("Switching focus: fileno=%d" % process.fileno())
 *             self._input_target.drain()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_process, __pyx_n_s_is_alive); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "ctff.pyx":1252
 *     def focus_process(self, process):
 *         if process.is_alive():
 *             logging.info("Switching focus: fileno=%d" % process.fileno())             # <<<<<<<<<<<<<<
 *             self._input_target.drain()
 *             self._input_target = process
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_process, __pyx_n_s_fileno); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Switching_focus_fileno_d, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "ctff.pyx":1253
 *         if process.is_alive():
 *             logging.info("Switching focus: fileno=%d" % process.fileno())
 *             self._input_target.drain()             # <<<<<<<<<<<<<<
 *             self._input_target = process
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_input_target); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_drain); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "ctff.pyx":1254
 *             logging.info("Switching focus: fileno=%d" % process.fileno())
 *             self._input_target.drain()
 *             self._input_target = process             # <<<<<<<<<<<<<<
 * 
 *     def blur_process(self):
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_input_target, __pyx_v_process) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "ctff.pyx":1250
 *         return self._input_target == process
 * 
 *     def focus_process(self, process):             # <<<<<<<<<<<<<<
 *         if process.is_alive():
 *             logging.info("Switching focus: fileno=%d" % process.fileno())
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("ctff.Session.focus_process", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":1256
 *             self._input_target = process
 * 
 *     def blur_process(self):             # <<<<<<<<<<<<<<
 *         process = self._mainprocess
 *         if process.is_alive():
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Session_13blur_process(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Session_13blur_process = {__Pyx_NAMESTR("blur_process"), (PyCFunction)__pyx_pw_4ctff_7Session_13blur_process, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Session_13blur_process(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("blur_process (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_7Session_12blur_process(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_4ctff_7Session_12blur_process(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_process = NULL;
  PyObject *__pyx_v_template = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("blur_process", 0);

  /* "ctff.pyx":1257
 * 
 *     def blur_process(self):
 *         process = self._mainprocess             # <<<<<<<<<<<<<<
 *         if process.is_alive():
 *             template = "Switching focus: fileno=%d (main process)"
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mainprocess); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_process = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ctff.pyx":1258
 *     def blur_process(self):
 *         process = self._mainprocess
 *         if process.is_alive():             # <<<<<<<<<<<<<<
 *             template = "Switching focus: fileno=%d (main process)"
 *             logging.info(template % process.fileno())
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_process, __pyx_n_s_is_alive); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "ctff.pyx":1259
 *         process = self._mainprocess
 *         if process.is_alive():
 *             template = "Switching focus: fileno=%d (main process)"             # <<<<<<<<<<<<<<
 *             logging.info(template % process.fileno())
 *             self._input_target.drain()
 */
    __Pyx_INCREF(__pyx_kp_s_Switching_focus_fileno_d_main_pr);
    __pyx_v_template = __pyx_kp_s_Switching_focus_fileno_d_main_pr;

    /* "ctff.pyx":1260
 *         if process.is_alive():
 *             template = "Switching focus: fileno=%d (main process)"
 *             logging.info(template % process.fileno())             # <<<<<<<<<<<<<<
 *             self._input_target.drain()
 *             self._input_target = process
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_process, __pyx_n_s_fileno); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Remainder(__pyx_v_template, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "ctff.pyx":1261
 *             template = "Switching focus: fileno=%d (main process)"
 *             logging.info(template % process.fileno())
 *             self._input_target.drain()             # <<<<<<<<<<<<<<
 *             self._input_target = process
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_input_target); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_drain); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "ctff.pyx":1262
 *             logging.info(template % process.fileno())
 *             self._input_target.drain()
 *             self._input_target = process             # <<<<<<<<<<<<<<
 * 
 *     def destruct_process(self, process):
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_input_target, __pyx_v_process) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "ctff.pyx":1256
 *             self._input_target = process
 * 
 *     def blur_process(self):             # <<<<<<<<<<<<<<
 *         process = self._mainprocess
 *         if process.is_alive():
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("ctff.Session.blur_process", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_process);
  __Pyx_XDECREF(__pyx_v_template);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":1264
 *             self._input_target = process
 * 
 *     def destruct_process(self, process):             # <<<<<<<<<<<<<<
 *         fd = process.fileno()
 *         if fd in self._rfds:
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Session_15destruct_process(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Session_15destruct_process = {__Pyx_NAMESTR("destruct_process"), (PyCFunction)__pyx_pw_4ctff_7Session_15destruct_process, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Session_15destruct_process(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_process = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destruct_process (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_process,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_process)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("destruct_process", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "destruct_process") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_process = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("destruct_process", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.Session.destruct_process", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_7Session_14destruct_process(__pyx_self, __pyx_v_self, __pyx_v_process);

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

static PyObject *__pyx_pf_4ctff_7Session_14destruct_process(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_process) {
  PyObject *__pyx_v_fd = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("destruct_process", 0);

  /* "ctff.pyx":1265
 * 
 *     def destruct_process(self, process):
 *         fd = process.fileno()             # <<<<<<<<<<<<<<
 *         if fd in self._rfds:
 *             self._rfds.remove(fd)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_process, __pyx_n_s_fileno); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_fd = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "ctff.pyx":1266
 *     def destruct_process(self, process):
 *         fd = process.fileno()
 *         if fd in self._rfds:             # <<<<<<<<<<<<<<
 *             self._rfds.remove(fd)
 *         if fd in self._xfds:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rfds); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_v_fd, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "ctff.pyx":1267
 *         fd = process.fileno()
 *         if fd in self._rfds:
 *             self._rfds.remove(fd)             # <<<<<<<<<<<<<<
 *         if fd in self._xfds:
 *             self._xfds.remove(fd)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rfds); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_remove); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_fd);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_fd);
    __Pyx_GIVEREF(__pyx_v_fd);
    __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "ctff.pyx":1268
 *         if fd in self._rfds:
 *             self._rfds.remove(fd)
 *         if fd in self._xfds:             # <<<<<<<<<<<<<<
 *             self._xfds.remove(fd)
 *         process.end()
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_xfds); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_v_fd, __pyx_t_5, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "ctff.pyx":1269
 *             self._rfds.remove(fd)
 *         if fd in self._xfds:
 *             self._xfds.remove(fd)             # <<<<<<<<<<<<<<
 *         process.end()
 *         process.close()
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_xfds); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_remove); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_fd);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_fd);
    __Pyx_GIVEREF(__pyx_v_fd);
    __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "ctff.pyx":1270
 *         if fd in self._xfds:
 *             self._xfds.remove(fd)
 *         process.end()             # <<<<<<<<<<<<<<
 *         process.close()
 *         del self._process_map[fd]
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_process, __pyx_n_s_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ctff.pyx":1271
 *             self._xfds.remove(fd)
 *         process.end()
 *         process.close()             # <<<<<<<<<<<<<<
 *         del self._process_map[fd]
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_process, __pyx_n_s_close); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1272
 *         process.end()
 *         process.close()
 *         del self._process_map[fd]             # <<<<<<<<<<<<<<
 * 
 *         self.focus_process(self._mainprocess)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_process_map); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_DelItem(__pyx_t_1, __pyx_v_fd) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1274
 *         del self._process_map[fd]
 * 
 *         self.focus_process(self._mainprocess)             # <<<<<<<<<<<<<<
 *         self._mainprocess.process_output("")
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_focus_process); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mainprocess); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ctff.pyx":1275
 * 
 *         self.focus_process(self._mainprocess)
 *         self._mainprocess.process_output("")             # <<<<<<<<<<<<<<
 * 
 *     def drive(self):
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mainprocess); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_process_output); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ctff.pyx":1264
 *             self._input_target = process
 * 
 *     def destruct_process(self, process):             # <<<<<<<<<<<<<<
 *         fd = process.fileno()
 *         if fd in self._rfds:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("ctff.Session.destruct_process", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fd);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":1277
 *         self._mainprocess.process_output("")
 * 
 *     def drive(self):             # <<<<<<<<<<<<<<
 * 
 *         def onresize(no, frame):
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Session_17drive(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Session_17drive = {__Pyx_NAMESTR("drive"), (PyCFunction)__pyx_pw_4ctff_7Session_17drive, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Session_17drive(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("drive (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff_7Session_16drive(__pyx_self, ((PyObject *)__pyx_v_self));

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

/* "ctff.pyx":1279
 *     def drive(self):
 * 
 *         def onresize(no, frame):             # <<<<<<<<<<<<<<
 *             ''' handle resize '''
 *             self._resized = True
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Session_5drive_1onresize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4ctff_7Session_5drive_onresize[] = " handle resize ";
static PyMethodDef __pyx_mdef_4ctff_7Session_5drive_1onresize = {__Pyx_NAMESTR("onresize"), (PyCFunction)__pyx_pw_4ctff_7Session_5drive_1onresize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4ctff_7Session_5drive_onresize)};
static PyObject *__pyx_pw_4ctff_7Session_5drive_1onresize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_no = 0;
  CYTHON_UNUSED PyObject *__pyx_v_frame = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("onresize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_no,&__pyx_n_s_frame,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_no)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_frame)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("onresize", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "onresize") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __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_no = values[0];
    __pyx_v_frame = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("onresize", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.Session.drive.onresize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_7Session_5drive_onresize(__pyx_self, __pyx_v_no, __pyx_v_frame);

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

static PyObject *__pyx_pf_4ctff_7Session_5drive_onresize(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_no, CYTHON_UNUSED PyObject *__pyx_v_frame) {
  struct __pyx_obj_4ctff___pyx_scope_struct_3_drive *__pyx_cur_scope;
  struct __pyx_obj_4ctff___pyx_scope_struct_3_drive *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("onresize", 0);
  __pyx_outer_scope = (struct __pyx_obj_4ctff___pyx_scope_struct_3_drive *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "ctff.pyx":1281
 *         def onresize(no, frame):
 *             ''' handle resize '''
 *             self._resized = True             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_resized, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1279
 *     def drive(self):
 * 
 *         def onresize(no, frame):             # <<<<<<<<<<<<<<
 *             ''' handle resize '''
 *             self._resized = True
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("ctff.Session.drive.onresize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":1277
 *         self._mainprocess.process_output("")
 * 
 *     def drive(self):             # <<<<<<<<<<<<<<
 * 
 *         def onresize(no, frame):
 */

static PyObject *__pyx_pf_4ctff_7Session_16drive(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  struct __pyx_obj_4ctff___pyx_scope_struct_3_drive *__pyx_cur_scope;
  PyObject *__pyx_v_onresize = 0;
  PyObject *__pyx_v_stdin_fileno = NULL;
  PyObject *__pyx_v_rfd = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_wfd = NULL;
  PyObject *__pyx_v_xfd = NULL;
  PyObject *__pyx_v_fd = NULL;
  PyObject *__pyx_v_process = NULL;
  PyObject *__pyx_v_row = NULL;
  PyObject *__pyx_v_col = NULL;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_target_fd = NULL;
  PyObject *__pyx_v_process_map = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_v_no = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_msg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *(*__pyx_t_14)(PyObject *);
  Py_ssize_t __pyx_t_15;
  PyObject *(*__pyx_t_16)(PyObject *);
  int __pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_t_20;
  char const *__pyx_t_21;
  char const *__pyx_t_22;
  int __pyx_t_23;
  int __pyx_t_24;
  char const *__pyx_t_25;
  PyObject *__pyx_t_26 = NULL;
  PyObject *__pyx_t_27 = NULL;
  PyObject *__pyx_t_28 = NULL;
  PyObject *__pyx_t_29 = NULL;
  PyObject *__pyx_t_30 = NULL;
  PyObject *__pyx_t_31 = NULL;
  char const *__pyx_t_32;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("drive", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ctff___pyx_scope_struct_3_drive *)__pyx_tp_new_4ctff___pyx_scope_struct_3_drive(__pyx_ptype_4ctff___pyx_scope_struct_3_drive, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);

  /* "ctff.pyx":1279
 *     def drive(self):
 * 
 *         def onresize(no, frame):             # <<<<<<<<<<<<<<
 *             ''' handle resize '''
 *             self._resized = True
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Session_5drive_1onresize, 0, __pyx_n_s_Session_drive_locals_onresize, ((PyObject*)__pyx_cur_scope), __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_onresize = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ctff.pyx":1283
 *             self._resized = True
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             signal.signal(signal.SIGWINCH, onresize)
 *         except ValueError:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    /*try:*/ {

      /* "ctff.pyx":1284
 * 
 *         try:
 *             signal.signal(signal.SIGWINCH, onresize)             # <<<<<<<<<<<<<<
 *         except ValueError:
 *             pass
 */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_signal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_signal); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_signal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_SIGWINCH); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_onresize);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_onresize);
      __Pyx_GIVEREF(__pyx_v_onresize);
      __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L3_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_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L10_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "ctff.pyx":1285
 *         try:
 *             signal.signal(signal.SIGWINCH, onresize)
 *         except ValueError:             # <<<<<<<<<<<<<<
 *             pass
 * 
 */
    __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
    if (__pyx_t_7) {
      PyErr_Restore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    __pyx_L10_try_end:;
  }

  /* "ctff.pyx":1288
 *             pass
 * 
 *         stdin_fileno = self._mainprocess.stdin_fileno()             # <<<<<<<<<<<<<<
 *         try:
 *             while self._alive:
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_mainprocess); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_stdin_fileno_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_stdin_fileno = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "ctff.pyx":1289
 * 
 *         stdin_fileno = self._mainprocess.stdin_fileno()
 *         try:             # <<<<<<<<<<<<<<
 *             while self._alive:
 *                 try:
 */
  /*try:*/ {
    {
      __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_2);
      /*try:*/ {

        /* "ctff.pyx":1290
 *         stdin_fileno = self._mainprocess.stdin_fileno()
 *         try:
 *             while self._alive:             # <<<<<<<<<<<<<<
 *                 try:
 *                     rfd, wfd, xfd = select.select(self._rfds, [], self._xfds, 0.6)
 */
        while (1) {
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_alive); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (!__pyx_t_8) break;

          /* "ctff.pyx":1291
 *         try:
 *             while self._alive:
 *                 try:             # <<<<<<<<<<<<<<
 *                     rfd, wfd, xfd = select.select(self._rfds, [], self._xfds, 0.6)
 *                     if xfd:
 */
          {
            __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
            __Pyx_XGOTREF(__pyx_t_9);
            __Pyx_XGOTREF(__pyx_t_10);
            __Pyx_XGOTREF(__pyx_t_11);
            /*try:*/ {

              /* "ctff.pyx":1292
 *             while self._alive:
 *                 try:
 *                     rfd, wfd, xfd = select.select(self._rfds, [], self._xfds, 0.6)             # <<<<<<<<<<<<<<
 *                     if xfd:
 *                         for fd in xfd:
 */
              __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_select); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
              __Pyx_GOTREF(__pyx_t_6);
              __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_select); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_rfds); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
              __Pyx_GOTREF(__pyx_t_6);
              __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
              __Pyx_GOTREF(__pyx_t_5);
              __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_xfds); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
              __Pyx_GOTREF(__pyx_t_12);
              __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
              __Pyx_GOTREF(__pyx_t_13);
              PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_6);
              __Pyx_GIVEREF(__pyx_t_6);
              PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_5);
              __Pyx_GIVEREF(__pyx_t_5);
              PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_12);
              __Pyx_INCREF(__pyx_float_0_6);
              PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_float_0_6);
              __Pyx_GIVEREF(__pyx_float_0_6);
              __pyx_t_6 = 0;
              __pyx_t_5 = 0;
              __pyx_t_12 = 0;
              __pyx_t_12 = PyObject_Call(__pyx_t_1, __pyx_t_13, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              if ((likely(PyTuple_CheckExact(__pyx_t_12))) || (PyList_CheckExact(__pyx_t_12))) {
                PyObject* sequence = __pyx_t_12;
                #if CYTHON_COMPILING_IN_CPYTHON
                Py_ssize_t size = Py_SIZE(sequence);
                #else
                Py_ssize_t size = PySequence_Size(sequence);
                #endif
                if (unlikely(size != 3)) {
                  if (size > 3) __Pyx_RaiseTooManyValuesError(3);
                  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
                  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                }
                #if CYTHON_COMPILING_IN_CPYTHON
                if (likely(PyTuple_CheckExact(sequence))) {
                  __pyx_t_13 = PyTuple_GET_ITEM(sequence, 0); 
                  __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
                  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); 
                } else {
                  __pyx_t_13 = PyList_GET_ITEM(sequence, 0); 
                  __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
                  __pyx_t_5 = PyList_GET_ITEM(sequence, 2); 
                }
                __Pyx_INCREF(__pyx_t_13);
                __Pyx_INCREF(__pyx_t_1);
                __Pyx_INCREF(__pyx_t_5);
                #else
                __pyx_t_13 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                __Pyx_GOTREF(__pyx_t_13);
                __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                __Pyx_GOTREF(__pyx_t_1);
                __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                __Pyx_GOTREF(__pyx_t_5);
                #endif
                __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              } else {
                Py_ssize_t index = -1;
                __pyx_t_6 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                __Pyx_GOTREF(__pyx_t_6);
                __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                __pyx_t_14 = Py_TYPE(__pyx_t_6)->tp_iternext;
                index = 0; __pyx_t_13 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_13)) goto __pyx_L32_unpacking_failed;
                __Pyx_GOTREF(__pyx_t_13);
                index = 1; __pyx_t_1 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L32_unpacking_failed;
                __Pyx_GOTREF(__pyx_t_1);
                index = 2; __pyx_t_5 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L32_unpacking_failed;
                __Pyx_GOTREF(__pyx_t_5);
                if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_6), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                __pyx_t_14 = NULL;
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                goto __pyx_L33_unpacking_done;
                __pyx_L32_unpacking_failed:;
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                __pyx_t_14 = NULL;
                if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
                {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                __pyx_L33_unpacking_done:;
              }
              __Pyx_XDECREF_SET(__pyx_v_rfd, __pyx_t_13);
              __pyx_t_13 = 0;
              __Pyx_XDECREF_SET(__pyx_v_wfd, __pyx_t_1);
              __pyx_t_1 = 0;
              __Pyx_XDECREF_SET(__pyx_v_xfd, __pyx_t_5);
              __pyx_t_5 = 0;

              /* "ctff.pyx":1293
 *                 try:
 *                     rfd, wfd, xfd = select.select(self._rfds, [], self._xfds, 0.6)
 *                     if xfd:             # <<<<<<<<<<<<<<
 *                         for fd in xfd:
 *                             if fd in self._process_map:
 */
              __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_xfd); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
              if (__pyx_t_8) {

                /* "ctff.pyx":1294
 *                     rfd, wfd, xfd = select.select(self._rfds, [], self._xfds, 0.6)
 *                     if xfd:
 *                         for fd in xfd:             # <<<<<<<<<<<<<<
 *                             if fd in self._process_map:
 *                                 process = self._process_map[fd]
 */
                if (PyList_CheckExact(__pyx_v_xfd) || PyTuple_CheckExact(__pyx_v_xfd)) {
                  __pyx_t_12 = __pyx_v_xfd; __Pyx_INCREF(__pyx_t_12); __pyx_t_15 = 0;
                  __pyx_t_16 = NULL;
                } else {
                  __pyx_t_15 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_v_xfd); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  __pyx_t_16 = Py_TYPE(__pyx_t_12)->tp_iternext;
                }
                for (;;) {
                  if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_12)) {
                    if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_12)) break;
                    #if CYTHON_COMPILING_IN_CPYTHON
                    __pyx_t_5 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_15); __Pyx_INCREF(__pyx_t_5); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                    #else
                    __pyx_t_5 = PySequence_ITEM(__pyx_t_12, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                    #endif
                  } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_12)) {
                    if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_12)) break;
                    #if CYTHON_COMPILING_IN_CPYTHON
                    __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_15); __Pyx_INCREF(__pyx_t_5); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                    #else
                    __pyx_t_5 = PySequence_ITEM(__pyx_t_12, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                    #endif
                  } else {
                    __pyx_t_5 = __pyx_t_16(__pyx_t_12);
                    if (unlikely(!__pyx_t_5)) {
                      PyObject* exc_type = PyErr_Occurred();
                      if (exc_type) {
                        if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                        else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                      }
                      break;
                    }
                    __Pyx_GOTREF(__pyx_t_5);
                  }
                  __Pyx_XDECREF_SET(__pyx_v_fd, __pyx_t_5);
                  __pyx_t_5 = 0;

                  /* "ctff.pyx":1295
 *                     if xfd:
 *                         for fd in xfd:
 *                             if fd in self._process_map:             # <<<<<<<<<<<<<<
 *                                 process = self._process_map[fd]
 *                                 self.destruct_process(process)
 */
                  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_process_map); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                  __Pyx_GOTREF(__pyx_t_5);
                  __pyx_t_8 = (__Pyx_PySequence_Contains(__pyx_v_fd, __pyx_t_5, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                  __pyx_t_17 = (__pyx_t_8 != 0);
                  if (__pyx_t_17) {

                    /* "ctff.pyx":1296
 *                         for fd in xfd:
 *                             if fd in self._process_map:
 *                                 process = self._process_map[fd]             # <<<<<<<<<<<<<<
 *                                 self.destruct_process(process)
 *                                 continue
 */
                    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_process_map); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                    __Pyx_GOTREF(__pyx_t_5);
                    __pyx_t_1 = PyObject_GetItem(__pyx_t_5, __pyx_v_fd); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; __pyx_clineno = __LINE__; goto __pyx_L24_error;};
                    __Pyx_GOTREF(__pyx_t_1);
                    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                    __Pyx_XDECREF_SET(__pyx_v_process, __pyx_t_1);
                    __pyx_t_1 = 0;

                    /* "ctff.pyx":1297
 *                             if fd in self._process_map:
 *                                 process = self._process_map[fd]
 *                                 self.destruct_process(process)             # <<<<<<<<<<<<<<
 *                                 continue
 *                     if self._resized:
 */
                    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_destruct_process); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                    __Pyx_GOTREF(__pyx_t_1);
                    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                    __Pyx_GOTREF(__pyx_t_5);
                    __Pyx_INCREF(__pyx_v_process);
                    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_process);
                    __Pyx_GIVEREF(__pyx_v_process);
                    __pyx_t_13 = PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                    __Pyx_GOTREF(__pyx_t_13);
                    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

                    /* "ctff.pyx":1298
 *                                 process = self._process_map[fd]
 *                                 self.destruct_process(process)
 *                                 continue             # <<<<<<<<<<<<<<
 *                     if self._resized:
 *                         self._resized = False
 */
                    goto __pyx_L35_continue;
                  }
                  __pyx_L35_continue:;
                }
                __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                goto __pyx_L34;
              }
              __pyx_L34:;

              /* "ctff.pyx":1299
 *                                 self.destruct_process(process)
 *                                 continue
 *                     if self._resized:             # <<<<<<<<<<<<<<
 *                         self._resized = False
 *                         row, col = self._mainprocess.fitsize()
 */
              __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_resized); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
              __Pyx_GOTREF(__pyx_t_12);
              __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_17 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              if (__pyx_t_17) {

                /* "ctff.pyx":1300
 *                                 continue
 *                     if self._resized:
 *                         self._resized = False             # <<<<<<<<<<<<<<
 *                         row, col = self._mainprocess.fitsize()
 *                         self._mainprocess.process_resize(row, col)
 */
                if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_resized, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1300; __pyx_clineno = __LINE__; goto __pyx_L24_error;}

                /* "ctff.pyx":1301
 *                     if self._resized:
 *                         self._resized = False
 *                         row, col = self._mainprocess.fitsize()             # <<<<<<<<<<<<<<
 *                         self._mainprocess.process_resize(row, col)
 *                     if rfd:
 */
                __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_mainprocess); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                __Pyx_GOTREF(__pyx_t_12);
                __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_fitsize); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                __Pyx_GOTREF(__pyx_t_13);
                __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                __pyx_t_12 = PyObject_Call(__pyx_t_13, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                __Pyx_GOTREF(__pyx_t_12);
                __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
                if ((likely(PyTuple_CheckExact(__pyx_t_12))) || (PyList_CheckExact(__pyx_t_12))) {
                  PyObject* sequence = __pyx_t_12;
                  #if CYTHON_COMPILING_IN_CPYTHON
                  Py_ssize_t size = Py_SIZE(sequence);
                  #else
                  Py_ssize_t size = PySequence_Size(sequence);
                  #endif
                  if (unlikely(size != 2)) {
                    if (size > 2) __Pyx_RaiseTooManyValuesError(2);
                    else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
                    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                  }
                  #if CYTHON_COMPILING_IN_CPYTHON
                  if (likely(PyTuple_CheckExact(sequence))) {
                    __pyx_t_13 = PyTuple_GET_ITEM(sequence, 0); 
                    __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
                  } else {
                    __pyx_t_13 = PyList_GET_ITEM(sequence, 0); 
                    __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
                  }
                  __Pyx_INCREF(__pyx_t_13);
                  __Pyx_INCREF(__pyx_t_5);
                  #else
                  __pyx_t_13 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                  __Pyx_GOTREF(__pyx_t_13);
                  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                  __Pyx_GOTREF(__pyx_t_5);
                  #endif
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                } else {
                  Py_ssize_t index = -1;
                  __pyx_t_1 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                  __Pyx_GOTREF(__pyx_t_1);
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_14 = Py_TYPE(__pyx_t_1)->tp_iternext;
                  index = 0; __pyx_t_13 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_13)) goto __pyx_L39_unpacking_failed;
                  __Pyx_GOTREF(__pyx_t_13);
                  index = 1; __pyx_t_5 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L39_unpacking_failed;
                  __Pyx_GOTREF(__pyx_t_5);
                  if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                  __pyx_t_14 = NULL;
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  goto __pyx_L40_unpacking_done;
                  __pyx_L39_unpacking_failed:;
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __pyx_t_14 = NULL;
                  if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
                  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                  __pyx_L40_unpacking_done:;
                }
                __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_13);
                __pyx_t_13 = 0;
                __Pyx_XDECREF_SET(__pyx_v_col, __pyx_t_5);
                __pyx_t_5 = 0;

                /* "ctff.pyx":1302
 *                         self._resized = False
 *                         row, col = self._mainprocess.fitsize()
 *                         self._mainprocess.process_resize(row, col)             # <<<<<<<<<<<<<<
 *                     if rfd:
 *                         for fd in rfd:
 */
                __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_mainprocess); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1302; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                __Pyx_GOTREF(__pyx_t_12);
                __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_process_resize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1302; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                __Pyx_GOTREF(__pyx_t_5);
                __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1302; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                __Pyx_GOTREF(__pyx_t_12);
                __Pyx_INCREF(__pyx_v_row);
                PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_row);
                __Pyx_GIVEREF(__pyx_v_row);
                __Pyx_INCREF(__pyx_v_col);
                PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_col);
                __Pyx_GIVEREF(__pyx_v_col);
                __pyx_t_13 = PyObject_Call(__pyx_t_5, __pyx_t_12, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1302; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                __Pyx_GOTREF(__pyx_t_13);
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
                goto __pyx_L38;
              }
              __pyx_L38:;

              /* "ctff.pyx":1303
 *                         row, col = self._mainprocess.fitsize()
 *                         self._mainprocess.process_resize(row, col)
 *                     if rfd:             # <<<<<<<<<<<<<<
 *                         for fd in rfd:
 *                             if fd == stdin_fileno:
 */
              __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_v_rfd); if (unlikely(__pyx_t_17 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
              if (__pyx_t_17) {

                /* "ctff.pyx":1304
 *                         self._mainprocess.process_resize(row, col)
 *                     if rfd:
 *                         for fd in rfd:             # <<<<<<<<<<<<<<
 *                             if fd == stdin_fileno:
 *                                 data = os.read(stdin_fileno, _BUFFER_SIZE)
 */
                if (PyList_CheckExact(__pyx_v_rfd) || PyTuple_CheckExact(__pyx_v_rfd)) {
                  __pyx_t_13 = __pyx_v_rfd; __Pyx_INCREF(__pyx_t_13); __pyx_t_15 = 0;
                  __pyx_t_16 = NULL;
                } else {
                  __pyx_t_15 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_v_rfd); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                  __Pyx_GOTREF(__pyx_t_13);
                  __pyx_t_16 = Py_TYPE(__pyx_t_13)->tp_iternext;
                }
                for (;;) {
                  if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_13)) {
                    if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_13)) break;
                    #if CYTHON_COMPILING_IN_CPYTHON
                    __pyx_t_12 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_15); __Pyx_INCREF(__pyx_t_12); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                    #else
                    __pyx_t_12 = PySequence_ITEM(__pyx_t_13, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                    #endif
                  } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_13)) {
                    if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_13)) break;
                    #if CYTHON_COMPILING_IN_CPYTHON
                    __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_15); __Pyx_INCREF(__pyx_t_12); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                    #else
                    __pyx_t_12 = PySequence_ITEM(__pyx_t_13, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                    #endif
                  } else {
                    __pyx_t_12 = __pyx_t_16(__pyx_t_13);
                    if (unlikely(!__pyx_t_12)) {
                      PyObject* exc_type = PyErr_Occurred();
                      if (exc_type) {
                        if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                        else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                      }
                      break;
                    }
                    __Pyx_GOTREF(__pyx_t_12);
                  }
                  __Pyx_XDECREF_SET(__pyx_v_fd, __pyx_t_12);
                  __pyx_t_12 = 0;

                  /* "ctff.pyx":1305
 *                     if rfd:
 *                         for fd in rfd:
 *                             if fd == stdin_fileno:             # <<<<<<<<<<<<<<
 *                                 data = os.read(stdin_fileno, _BUFFER_SIZE)
 *                                 if self._input_target.is_alive():
 */
                  __pyx_t_12 = PyObject_RichCompare(__pyx_v_fd, __pyx_v_stdin_fileno, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                  __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_17 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  if (__pyx_t_17) {

                    /* "ctff.pyx":1306
 *                         for fd in rfd:
 *                             if fd == stdin_fileno:
 *                                 data = os.read(stdin_fileno, _BUFFER_SIZE)             # <<<<<<<<<<<<<<
 *                                 if self._input_target.is_alive():
 *                                     target_fd = self._input_target.fileno()
 */
                    __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_read); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                    __Pyx_GOTREF(__pyx_t_5);
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_BUFFER_SIZE); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                    __Pyx_GOTREF(__pyx_t_1);
                    __Pyx_INCREF(__pyx_v_stdin_fileno);
                    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_stdin_fileno);
                    __Pyx_GIVEREF(__pyx_v_stdin_fileno);
                    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_12);
                    __Pyx_GIVEREF(__pyx_t_12);
                    __pyx_t_12 = 0;
                    __pyx_t_12 = PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                    __Pyx_XDECREF_SET(__pyx_v_data, __pyx_t_12);
                    __pyx_t_12 = 0;

                    /* "ctff.pyx":1307
 *                             if fd == stdin_fileno:
 *                                 data = os.read(stdin_fileno, _BUFFER_SIZE)
 *                                 if self._input_target.is_alive():             # <<<<<<<<<<<<<<
 *                                     target_fd = self._input_target.fileno()
 *                                     process = self._process_map[target_fd]
 */
                    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_input_target); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_is_alive); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                    __Pyx_GOTREF(__pyx_t_1);
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_17 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    if (__pyx_t_17) {

                      /* "ctff.pyx":1308
 *                                 data = os.read(stdin_fileno, _BUFFER_SIZE)
 *                                 if self._input_target.is_alive():
 *                                     target_fd = self._input_target.fileno()             # <<<<<<<<<<<<<<
 *                                     process = self._process_map[target_fd]
 *                                     process.process_input(data)
 */
                      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_input_target); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                      __Pyx_GOTREF(__pyx_t_12);
                      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_fileno); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                      __Pyx_GOTREF(__pyx_t_1);
                      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                      __pyx_t_12 = PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                      __Pyx_GOTREF(__pyx_t_12);
                      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                      __Pyx_XDECREF_SET(__pyx_v_target_fd, __pyx_t_12);
                      __pyx_t_12 = 0;

                      /* "ctff.pyx":1309
 *                                 if self._input_target.is_alive():
 *                                     target_fd = self._input_target.fileno()
 *                                     process = self._process_map[target_fd]             # <<<<<<<<<<<<<<
 *                                     process.process_input(data)
 *                                     self._mainprocess.process_input("")
 */
                      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_process_map); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                      __Pyx_GOTREF(__pyx_t_12);
                      __pyx_t_1 = PyObject_GetItem(__pyx_t_12, __pyx_v_target_fd); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L24_error;};
                      __Pyx_GOTREF(__pyx_t_1);
                      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                      __Pyx_XDECREF_SET(__pyx_v_process, __pyx_t_1);
                      __pyx_t_1 = 0;

                      /* "ctff.pyx":1310
 *                                     target_fd = self._input_target.fileno()
 *                                     process = self._process_map[target_fd]
 *                                     process.process_input(data)             # <<<<<<<<<<<<<<
 *                                     self._mainprocess.process_input("")
 *                             elif self._process_map:
 */
                      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_process, __pyx_n_s_process_input); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                      __Pyx_GOTREF(__pyx_t_1);
                      __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                      __Pyx_GOTREF(__pyx_t_12);
                      __Pyx_INCREF(__pyx_v_data);
                      PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_data);
                      __Pyx_GIVEREF(__pyx_v_data);
                      __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                      __Pyx_GOTREF(__pyx_t_5);
                      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

                      /* "ctff.pyx":1311
 *                                     process = self._process_map[target_fd]
 *                                     process.process_input(data)
 *                                     self._mainprocess.process_input("")             # <<<<<<<<<<<<<<
 *                             elif self._process_map:
 *                                 process_map = self._process_map
 */
                      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_mainprocess); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                      __Pyx_GOTREF(__pyx_t_5);
                      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_process_input); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                      __Pyx_GOTREF(__pyx_t_12);
                      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                      __pyx_t_5 = PyObject_Call(__pyx_t_12, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                      __Pyx_GOTREF(__pyx_t_5);
                      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                      goto __pyx_L45;
                    }
                    __pyx_L45:;
                    goto __pyx_L44;
                  }

                  /* "ctff.pyx":1312
 *                                     process.process_input(data)
 *                                     self._mainprocess.process_input("")
 *                             elif self._process_map:             # <<<<<<<<<<<<<<
 *                                 process_map = self._process_map
 *                                 if fd in process_map:
 */
                  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_process_map); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                  __Pyx_GOTREF(__pyx_t_5);
                  __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_17 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                  if (__pyx_t_17) {

                    /* "ctff.pyx":1313
 *                                     self._mainprocess.process_input("")
 *                             elif self._process_map:
 *                                 process_map = self._process_map             # <<<<<<<<<<<<<<
 *                                 if fd in process_map:
 *                                     process = process_map[fd]
 */
                    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_process_map); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                    __Pyx_GOTREF(__pyx_t_5);
                    __Pyx_XDECREF_SET(__pyx_v_process_map, __pyx_t_5);
                    __pyx_t_5 = 0;

                    /* "ctff.pyx":1314
 *                             elif self._process_map:
 *                                 process_map = self._process_map
 *                                 if fd in process_map:             # <<<<<<<<<<<<<<
 *                                     process = process_map[fd]
 *                                     if self._input_target.is_alive():
 */
                    __pyx_t_17 = (__Pyx_PySequence_Contains(__pyx_v_fd, __pyx_v_process_map, Py_EQ)); if (unlikely(__pyx_t_17 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                    __pyx_t_8 = (__pyx_t_17 != 0);
                    if (__pyx_t_8) {

                      /* "ctff.pyx":1315
 *                                 process_map = self._process_map
 *                                 if fd in process_map:
 *                                     process = process_map[fd]             # <<<<<<<<<<<<<<
 *                                     if self._input_target.is_alive():
 *                                         if fd == self._input_target.fileno():
 */
                      __pyx_t_5 = PyObject_GetItem(__pyx_v_process_map, __pyx_v_fd); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L24_error;};
                      __Pyx_GOTREF(__pyx_t_5);
                      __Pyx_XDECREF_SET(__pyx_v_process, __pyx_t_5);
                      __pyx_t_5 = 0;

                      /* "ctff.pyx":1316
 *                                 if fd in process_map:
 *                                     process = process_map[fd]
 *                                     if self._input_target.is_alive():             # <<<<<<<<<<<<<<
 *                                         if fd == self._input_target.fileno():
 *                                             data = process.read()
 */
                      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_input_target); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                      __Pyx_GOTREF(__pyx_t_5);
                      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_is_alive); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                      __Pyx_GOTREF(__pyx_t_12);
                      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                      __pyx_t_5 = PyObject_Call(__pyx_t_12, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                      __Pyx_GOTREF(__pyx_t_5);
                      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                      if (__pyx_t_8) {

                        /* "ctff.pyx":1317
 *                                     process = process_map[fd]
 *                                     if self._input_target.is_alive():
 *                                         if fd == self._input_target.fileno():             # <<<<<<<<<<<<<<
 *                                             data = process.read()
 *                                             process.on_read(data)
 */
                        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_input_target); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                        __Pyx_GOTREF(__pyx_t_5);
                        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_fileno); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                        __Pyx_GOTREF(__pyx_t_12);
                        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                        __pyx_t_5 = PyObject_Call(__pyx_t_12, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                        __Pyx_GOTREF(__pyx_t_5);
                        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                        __pyx_t_12 = PyObject_RichCompare(__pyx_v_fd, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                        if (__pyx_t_8) {

                          /* "ctff.pyx":1318
 *                                     if self._input_target.is_alive():
 *                                         if fd == self._input_target.fileno():
 *                                             data = process.read()             # <<<<<<<<<<<<<<
 *                                             process.on_read(data)
 *                                             self._mainprocess.process_output("")
 */
                          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_process, __pyx_n_s_read); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                          __Pyx_GOTREF(__pyx_t_12);
                          __pyx_t_5 = PyObject_Call(__pyx_t_12, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                          __Pyx_GOTREF(__pyx_t_5);
                          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                          __Pyx_XDECREF_SET(__pyx_v_data, __pyx_t_5);
                          __pyx_t_5 = 0;

                          /* "ctff.pyx":1319
 *                                         if fd == self._input_target.fileno():
 *                                             data = process.read()
 *                                             process.on_read(data)             # <<<<<<<<<<<<<<
 *                                             self._mainprocess.process_output("")
 *                     else:
 */
                          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_process, __pyx_n_s_on_read); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                          __Pyx_GOTREF(__pyx_t_5);
                          __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                          __Pyx_GOTREF(__pyx_t_12);
                          __Pyx_INCREF(__pyx_v_data);
                          PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_data);
                          __Pyx_GIVEREF(__pyx_v_data);
                          __pyx_t_1 = PyObject_Call(__pyx_t_5, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                          __Pyx_GOTREF(__pyx_t_1);
                          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

                          /* "ctff.pyx":1320
 *                                             data = process.read()
 *                                             process.on_read(data)
 *                                             self._mainprocess.process_output("")             # <<<<<<<<<<<<<<
 *                     else:
 *                         pass
 */
                          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_mainprocess); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                          __Pyx_GOTREF(__pyx_t_1);
                          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_process_output); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                          __Pyx_GOTREF(__pyx_t_12);
                          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                          __pyx_t_1 = PyObject_Call(__pyx_t_12, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                          __Pyx_GOTREF(__pyx_t_1);
                          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                          goto __pyx_L48;
                        }
                        __pyx_L48:;
                        goto __pyx_L47;
                      }
                      __pyx_L47:;
                      goto __pyx_L46;
                    }
                    __pyx_L46:;
                    goto __pyx_L44;
                  }
                  __pyx_L44:;
                }
                __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
                goto __pyx_L41;
              }
              /*else*/ {
              }
              __pyx_L41:;
            }
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            goto __pyx_L31_try_end;
            __pyx_L24_error:;
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;

            /* "ctff.pyx":1323
 *                     else:
 *                         pass
 *                 except select.error, e:             # <<<<<<<<<<<<<<
 *                     no, msg = e
 *                     if no == errno.EINTR:
 */
            __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_select); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __pyx_t_7 = PyErr_ExceptionMatches(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (__pyx_t_7) {
              __Pyx_AddTraceback("ctff.Session.drive", __pyx_clineno, __pyx_lineno, __pyx_filename);
              if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_13, &__pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_13);
              __Pyx_XDECREF_SET(__pyx_v_e, __pyx_t_13);

              /* "ctff.pyx":1324
 *                         pass
 *                 except select.error, e:
 *                     no, msg = e             # <<<<<<<<<<<<<<
 *                     if no == errno.EINTR:
 *                         # The call was interrupted by a signal
 */
              if ((likely(PyTuple_CheckExact(__pyx_v_e))) || (PyList_CheckExact(__pyx_v_e))) {
                PyObject* sequence = __pyx_v_e;
                #if CYTHON_COMPILING_IN_CPYTHON
                Py_ssize_t size = Py_SIZE(sequence);
                #else
                Py_ssize_t size = PySequence_Size(sequence);
                #endif
                if (unlikely(size != 2)) {
                  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
                  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
                  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
                }
                #if CYTHON_COMPILING_IN_CPYTHON
                if (likely(PyTuple_CheckExact(sequence))) {
                  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
                  __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
                } else {
                  __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
                  __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
                }
                __Pyx_INCREF(__pyx_t_5);
                __Pyx_INCREF(__pyx_t_6);
                #else
                __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
                __Pyx_GOTREF(__pyx_t_5);
                __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
                __Pyx_GOTREF(__pyx_t_6);
                #endif
              } else {
                Py_ssize_t index = -1;
                __pyx_t_18 = PyObject_GetIter(__pyx_v_e); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
                __Pyx_GOTREF(__pyx_t_18);
                __pyx_t_14 = Py_TYPE(__pyx_t_18)->tp_iternext;
                index = 0; __pyx_t_5 = __pyx_t_14(__pyx_t_18); if (unlikely(!__pyx_t_5)) goto __pyx_L51_unpacking_failed;
                __Pyx_GOTREF(__pyx_t_5);
                index = 1; __pyx_t_6 = __pyx_t_14(__pyx_t_18); if (unlikely(!__pyx_t_6)) goto __pyx_L51_unpacking_failed;
                __Pyx_GOTREF(__pyx_t_6);
                if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_18), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
                __pyx_t_14 = NULL;
                __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
                goto __pyx_L52_unpacking_done;
                __pyx_L51_unpacking_failed:;
                __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
                __pyx_t_14 = NULL;
                if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
                {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
                __pyx_L52_unpacking_done:;
              }
              __Pyx_XDECREF_SET(__pyx_v_no, __pyx_t_5);
              __pyx_t_5 = 0;
              __Pyx_XDECREF_SET(__pyx_v_msg, __pyx_t_6);
              __pyx_t_6 = 0;

              /* "ctff.pyx":1325
 *                 except select.error, e:
 *                     no, msg = e
 *                     if no == errno.EINTR:             # <<<<<<<<<<<<<<
 *                         # The call was interrupted by a signal
 *                         self._resized = True
 */
              __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_errno); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
              __Pyx_GOTREF(__pyx_t_6);
              __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_EINTR); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __pyx_t_6 = PyObject_RichCompare(__pyx_v_no, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
              __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_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              if (__pyx_t_8) {

                /* "ctff.pyx":1327
 *                     if no == errno.EINTR:
 *                         # The call was interrupted by a signal
 *                         self._resized = True             # <<<<<<<<<<<<<<
 *                     elif no == errno.EBADF:
 *                         for fd in self._process_map:
 */
                if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_resized, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
                goto __pyx_L53;
              }

              /* "ctff.pyx":1328
 *                         # The call was interrupted by a signal
 *                         self._resized = True
 *                     elif no == errno.EBADF:             # <<<<<<<<<<<<<<
 *                         for fd in self._process_map:
 *                             process = self._process_map[fd]
 */
              __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_errno); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1328; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
              __Pyx_GOTREF(__pyx_t_6);
              __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_EBADF); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1328; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __pyx_t_6 = PyObject_RichCompare(__pyx_v_no, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1328; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
              __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_filename = __pyx_f[0]; __pyx_lineno = 1328; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              if (__pyx_t_8) {

                /* "ctff.pyx":1329
 *                         self._resized = True
 *                     elif no == errno.EBADF:
 *                         for fd in self._process_map:             # <<<<<<<<<<<<<<
 *                             process = self._process_map[fd]
 *                             self.destruct_process(process)
 */
                __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_process_map); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
                __Pyx_GOTREF(__pyx_t_6);
                if (PyList_CheckExact(__pyx_t_6) || PyTuple_CheckExact(__pyx_t_6)) {
                  __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); __pyx_t_15 = 0;
                  __pyx_t_16 = NULL;
                } else {
                  __pyx_t_15 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
                  __Pyx_GOTREF(__pyx_t_5);
                  __pyx_t_16 = Py_TYPE(__pyx_t_5)->tp_iternext;
                }
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                for (;;) {
                  if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_5)) {
                    if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_5)) break;
                    #if CYTHON_COMPILING_IN_CPYTHON
                    __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_15); __Pyx_INCREF(__pyx_t_6); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
                    #else
                    __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
                    #endif
                  } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_5)) {
                    if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
                    #if CYTHON_COMPILING_IN_CPYTHON
                    __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_15); __Pyx_INCREF(__pyx_t_6); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
                    #else
                    __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
                    #endif
                  } else {
                    __pyx_t_6 = __pyx_t_16(__pyx_t_5);
                    if (unlikely(!__pyx_t_6)) {
                      PyObject* exc_type = PyErr_Occurred();
                      if (exc_type) {
                        if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                        else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
                      }
                      break;
                    }
                    __Pyx_GOTREF(__pyx_t_6);
                  }
                  __Pyx_XDECREF_SET(__pyx_v_fd, __pyx_t_6);
                  __pyx_t_6 = 0;

                  /* "ctff.pyx":1330
 *                     elif no == errno.EBADF:
 *                         for fd in self._process_map:
 *                             process = self._process_map[fd]             # <<<<<<<<<<<<<<
 *                             self.destruct_process(process)
 *                     else:
 */
                  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_process_map); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
                  __Pyx_GOTREF(__pyx_t_6);
                  __pyx_t_18 = PyObject_GetItem(__pyx_t_6, __pyx_v_fd); if (unlikely(__pyx_t_18 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;};
                  __Pyx_GOTREF(__pyx_t_18);
                  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                  __Pyx_XDECREF_SET(__pyx_v_process, __pyx_t_18);
                  __pyx_t_18 = 0;

                  /* "ctff.pyx":1331
 *                         for fd in self._process_map:
 *                             process = self._process_map[fd]
 *                             self.destruct_process(process)             # <<<<<<<<<<<<<<
 *                     else:
 *                         raise e
 */
                  __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_destruct_process); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
                  __Pyx_GOTREF(__pyx_t_18);
                  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
                  __Pyx_GOTREF(__pyx_t_6);
                  __Pyx_INCREF(__pyx_v_process);
                  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_process);
                  __Pyx_GIVEREF(__pyx_v_process);
                  __pyx_t_19 = PyObject_Call(__pyx_t_18, __pyx_t_6, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
                  __Pyx_GOTREF(__pyx_t_19);
                  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
                  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
                }
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                goto __pyx_L53;
              }
              /*else*/ {

                /* "ctff.pyx":1333
 *                             self.destruct_process(process)
 *                     else:
 *                         raise e             # <<<<<<<<<<<<<<
 *                 except OSError, e:
 *                     no, msg = e
 */
                __Pyx_Raise(__pyx_v_e, 0, 0, 0);
                {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
              }
              __pyx_L53:;
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              goto __pyx_L25_exception_handled;
            }

            /* "ctff.pyx":1334
 *                     else:
 *                         raise e
 *                 except OSError, e:             # <<<<<<<<<<<<<<
 *                     no, msg = e
 *                     if no == errno.EINTR:
 */
            __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_OSError);
            if (__pyx_t_7) {
              __Pyx_AddTraceback("ctff.Session.drive", __pyx_clineno, __pyx_lineno, __pyx_filename);
              if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_13);
              __Pyx_XDECREF_SET(__pyx_v_e, __pyx_t_13);

              /* "ctff.pyx":1335
 *                         raise e
 *                 except OSError, e:
 *                     no, msg = e             # <<<<<<<<<<<<<<
 *                     if no == errno.EINTR:
 *                         # The call was interrupted by a signal
 */
              if ((likely(PyTuple_CheckExact(__pyx_v_e))) || (PyList_CheckExact(__pyx_v_e))) {
                PyObject* sequence = __pyx_v_e;
                #if CYTHON_COMPILING_IN_CPYTHON
                Py_ssize_t size = Py_SIZE(sequence);
                #else
                Py_ssize_t size = PySequence_Size(sequence);
                #endif
                if (unlikely(size != 2)) {
                  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
                  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
                  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
                }
                #if CYTHON_COMPILING_IN_CPYTHON
                if (likely(PyTuple_CheckExact(sequence))) {
                  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
                  __pyx_t_19 = PyTuple_GET_ITEM(sequence, 1); 
                } else {
                  __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
                  __pyx_t_19 = PyList_GET_ITEM(sequence, 1); 
                }
                __Pyx_INCREF(__pyx_t_5);
                __Pyx_INCREF(__pyx_t_19);
                #else
                __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
                __Pyx_GOTREF(__pyx_t_5);
                __pyx_t_19 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
                __Pyx_GOTREF(__pyx_t_19);
                #endif
              } else {
                Py_ssize_t index = -1;
                __pyx_t_6 = PyObject_GetIter(__pyx_v_e); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
                __Pyx_GOTREF(__pyx_t_6);
                __pyx_t_14 = Py_TYPE(__pyx_t_6)->tp_iternext;
                index = 0; __pyx_t_5 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L58_unpacking_failed;
                __Pyx_GOTREF(__pyx_t_5);
                index = 1; __pyx_t_19 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_19)) goto __pyx_L58_unpacking_failed;
                __Pyx_GOTREF(__pyx_t_19);
                if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
                __pyx_t_14 = NULL;
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                goto __pyx_L59_unpacking_done;
                __pyx_L58_unpacking_failed:;
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                __pyx_t_14 = NULL;
                if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
                {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
                __pyx_L59_unpacking_done:;
              }
              __Pyx_XDECREF_SET(__pyx_v_no, __pyx_t_5);
              __pyx_t_5 = 0;
              __Pyx_XDECREF_SET(__pyx_v_msg, __pyx_t_19);
              __pyx_t_19 = 0;

              /* "ctff.pyx":1336
 *                 except OSError, e:
 *                     no, msg = e
 *                     if no == errno.EINTR:             # <<<<<<<<<<<<<<
 *                         # The call was interrupted by a signal
 *                         self._resized = True
 */
              __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_errno); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
              __Pyx_GOTREF(__pyx_t_19);
              __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_EINTR); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
              __pyx_t_19 = PyObject_RichCompare(__pyx_v_no, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_19); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_19); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
              __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
              if (__pyx_t_8) {

                /* "ctff.pyx":1338
 *                     if no == errno.EINTR:
 *                         # The call was interrupted by a signal
 *                         self._resized = True             # <<<<<<<<<<<<<<
 *                     else:
 *                         raise e
 */
                if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_resized, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
                goto __pyx_L60;
              }
              /*else*/ {

                /* "ctff.pyx":1340
 *                         self._resized = True
 *                     else:
 *                         raise e             # <<<<<<<<<<<<<<
 *         except OSError, e:
 *             no, msg = e
 */
                __Pyx_Raise(__pyx_v_e, 0, 0, 0);
                {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1340; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
              }
              __pyx_L60:;
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              goto __pyx_L25_exception_handled;
            }
            goto __pyx_L26_except_error;
            __pyx_L26_except_error:;
            __Pyx_XGIVEREF(__pyx_t_9);
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
            goto __pyx_L14_error;
            __pyx_L25_exception_handled:;
            __Pyx_XGIVEREF(__pyx_t_9);
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
            __pyx_L31_try_end:;
          }
        }
      }
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L21_try_end;
      __pyx_L14_error:;
      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "ctff.pyx":1341
 *                     else:
 *                         raise e
 *         except OSError, e:             # <<<<<<<<<<<<<<
 *             no, msg = e
 *             if no == errno.EIO:
 */
      __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_OSError);
      if (__pyx_t_7) {
        __Pyx_AddTraceback("ctff.Session.drive", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_13, &__pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_XDECREF_SET(__pyx_v_e, __pyx_t_13);

        /* "ctff.pyx":1342
 *                         raise e
 *         except OSError, e:
 *             no, msg = e             # <<<<<<<<<<<<<<
 *             if no == errno.EIO:
 *                 return
 */
        if ((likely(PyTuple_CheckExact(__pyx_v_e))) || (PyList_CheckExact(__pyx_v_e))) {
          PyObject* sequence = __pyx_v_e;
          #if CYTHON_COMPILING_IN_CPYTHON
          Py_ssize_t size = Py_SIZE(sequence);
          #else
          Py_ssize_t size = PySequence_Size(sequence);
          #endif
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
          }
          #if CYTHON_COMPILING_IN_CPYTHON
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_19 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_19 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_19);
          __Pyx_INCREF(__pyx_t_5);
          #else
          __pyx_t_19 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
          __Pyx_GOTREF(__pyx_t_19);
          __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          Py_ssize_t index = -1;
          __pyx_t_6 = PyObject_GetIter(__pyx_v_e); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_14 = Py_TYPE(__pyx_t_6)->tp_iternext;
          index = 0; __pyx_t_19 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_19)) goto __pyx_L63_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_19);
          index = 1; __pyx_t_5 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L63_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_5);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
          __pyx_t_14 = NULL;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          goto __pyx_L64_unpacking_done;
          __pyx_L63_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_14 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
          __pyx_L64_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_v_no, __pyx_t_19);
        __pyx_t_19 = 0;
        __Pyx_XDECREF_SET(__pyx_v_msg, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "ctff.pyx":1343
 *         except OSError, e:
 *             no, msg = e
 *             if no == errno.EIO:             # <<<<<<<<<<<<<<
 *                 return
 *             elif no == errno.EBADF:
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_errno); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_EIO); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_RichCompare(__pyx_v_no, __pyx_t_19, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (__pyx_t_8) {

          /* "ctff.pyx":1344
 *             no, msg = e
 *             if no == errno.EIO:
 *                 return             # <<<<<<<<<<<<<<
 *             elif no == errno.EBADF:
 *                 return
 */
          __Pyx_XDECREF(__pyx_r);
          __pyx_r = Py_None; __Pyx_INCREF(Py_None);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          goto __pyx_L17_except_return;
        }

        /* "ctff.pyx":1345
 *             if no == errno.EIO:
 *                 return
 *             elif no == errno.EBADF:             # <<<<<<<<<<<<<<
 *                 return
 *             else:
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_errno); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_EBADF); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_RichCompare(__pyx_v_no, __pyx_t_19, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (__pyx_t_8) {

          /* "ctff.pyx":1346
 *                 return
 *             elif no == errno.EBADF:
 *                 return             # <<<<<<<<<<<<<<
 *             else:
 *                 raise e
 */
          __Pyx_XDECREF(__pyx_r);
          __pyx_r = Py_None; __Pyx_INCREF(Py_None);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          goto __pyx_L17_except_return;
        }
        /*else*/ {

          /* "ctff.pyx":1348
 *                 return
 *             else:
 *                 raise e             # <<<<<<<<<<<<<<
 *         finally:
 *             try:
 */
          __Pyx_Raise(__pyx_v_e, 0, 0, 0);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        goto __pyx_L15_exception_handled;
      }
      goto __pyx_L16_except_error;
      __pyx_L16_except_error:;
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_3, __pyx_t_2);
      goto __pyx_L12_error;
      __pyx_L17_except_return:;
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_3, __pyx_t_2);
      goto __pyx_L11_return;
      __pyx_L15_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_3, __pyx_t_2);
      __pyx_L21_try_end:;
    }
  }

  /* "ctff.pyx":1350
 *                 raise e
 *         finally:
 *             try:             # <<<<<<<<<<<<<<
 *                 self._mainprocess.process_end()
 *             finally:
 */
  /*finally:*/ {
    /*normal exit:*/{
      /*try:*/ {

        /* "ctff.pyx":1351
 *         finally:
 *             try:
 *                 self._mainprocess.process_end()             # <<<<<<<<<<<<<<
 *             finally:
 *                 for fd in self._process_map:
 */
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_mainprocess); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; __pyx_clineno = __LINE__; goto __pyx_L67_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_process_end); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; __pyx_clineno = __LINE__; goto __pyx_L67_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PyObject_Call(__pyx_t_13, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; __pyx_clineno = __LINE__; goto __pyx_L67_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }

      /* "ctff.pyx":1353
 *                 self._mainprocess.process_end()
 *             finally:
 *                 for fd in self._process_map:             # <<<<<<<<<<<<<<
 *                     process = self._process_map[fd]
 *                     process.end()
 */
      /*finally:*/ {
        /*normal exit:*/{
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_process_map); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_12);
          if (PyList_CheckExact(__pyx_t_12) || PyTuple_CheckExact(__pyx_t_12)) {
            __pyx_t_13 = __pyx_t_12; __Pyx_INCREF(__pyx_t_13); __pyx_t_15 = 0;
            __pyx_t_16 = NULL;
          } else {
            __pyx_t_15 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_16 = Py_TYPE(__pyx_t_13)->tp_iternext;
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          for (;;) {
            if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_13)) {
              if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_13)) break;
              #if CYTHON_COMPILING_IN_CPYTHON
              __pyx_t_12 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_15); __Pyx_INCREF(__pyx_t_12); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              #else
              __pyx_t_12 = PySequence_ITEM(__pyx_t_13, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              #endif
            } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_13)) {
              if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_13)) break;
              #if CYTHON_COMPILING_IN_CPYTHON
              __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_15); __Pyx_INCREF(__pyx_t_12); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              #else
              __pyx_t_12 = PySequence_ITEM(__pyx_t_13, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              #endif
            } else {
              __pyx_t_12 = __pyx_t_16(__pyx_t_13);
              if (unlikely(!__pyx_t_12)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                  else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_12);
            }
            __Pyx_XDECREF_SET(__pyx_v_fd, __pyx_t_12);
            __pyx_t_12 = 0;

            /* "ctff.pyx":1354
 *             finally:
 *                 for fd in self._process_map:
 *                     process = self._process_map[fd]             # <<<<<<<<<<<<<<
 *                     process.end()
 *                     process.close()
 */
            __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_process_map); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_1 = PyObject_GetItem(__pyx_t_12, __pyx_v_fd); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF_SET(__pyx_v_process, __pyx_t_1);
            __pyx_t_1 = 0;

            /* "ctff.pyx":1355
 *                 for fd in self._process_map:
 *                     process = self._process_map[fd]
 *                     process.end()             # <<<<<<<<<<<<<<
 *                     process.close()
 * 
 */
            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_process, __pyx_n_s_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_12 = PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

            /* "ctff.pyx":1356
 *                     process = self._process_map[fd]
 *                     process.end()
 *                     process.close()             # <<<<<<<<<<<<<<
 * 
 *     def start(self,
 */
            __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_process, __pyx_n_s_close); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_1 = PyObject_Call(__pyx_t_12, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          goto __pyx_L68;
        }
        /*exception exit:*/{
          __pyx_L67_error:;
          __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4) < 0)) __Pyx_ErrFetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_3);
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_9);
          __pyx_t_7 = __pyx_lineno; __pyx_t_20 = __pyx_clineno; __pyx_t_21 = __pyx_filename;
          {

            /* "ctff.pyx":1353
 *                 self._mainprocess.process_end()
 *             finally:
 *                 for fd in self._process_map:             # <<<<<<<<<<<<<<
 *                     process = self._process_map[fd]
 *                     process.end()
 */
            __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_process_map); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L72_error;}
            __Pyx_GOTREF(__pyx_t_13);
            if (PyList_CheckExact(__pyx_t_13) || PyTuple_CheckExact(__pyx_t_13)) {
              __pyx_t_1 = __pyx_t_13; __Pyx_INCREF(__pyx_t_1); __pyx_t_15 = 0;
              __pyx_t_16 = NULL;
            } else {
              __pyx_t_15 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_13); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L72_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_16 = Py_TYPE(__pyx_t_1)->tp_iternext;
            }
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            for (;;) {
              if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_1)) {
                if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_1)) break;
                #if CYTHON_COMPILING_IN_CPYTHON
                __pyx_t_13 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_15); __Pyx_INCREF(__pyx_t_13); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L72_error;}
                #else
                __pyx_t_13 = PySequence_ITEM(__pyx_t_1, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L72_error;}
                #endif
              } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_1)) {
                if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
                #if CYTHON_COMPILING_IN_CPYTHON
                __pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_15); __Pyx_INCREF(__pyx_t_13); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L72_error;}
                #else
                __pyx_t_13 = PySequence_ITEM(__pyx_t_1, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L72_error;}
                #endif
              } else {
                __pyx_t_13 = __pyx_t_16(__pyx_t_1);
                if (unlikely(!__pyx_t_13)) {
                  PyObject* exc_type = PyErr_Occurred();
                  if (exc_type) {
                    if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                    else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L72_error;}
                  }
                  break;
                }
                __Pyx_GOTREF(__pyx_t_13);
              }
              __Pyx_XDECREF_SET(__pyx_v_fd, __pyx_t_13);
              __pyx_t_13 = 0;

              /* "ctff.pyx":1354
 *             finally:
 *                 for fd in self._process_map:
 *                     process = self._process_map[fd]             # <<<<<<<<<<<<<<
 *                     process.end()
 *                     process.close()
 */
              __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_process_map); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L72_error;}
              __Pyx_GOTREF(__pyx_t_13);
              __pyx_t_12 = PyObject_GetItem(__pyx_t_13, __pyx_v_fd); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L72_error;};
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_XDECREF_SET(__pyx_v_process, __pyx_t_12);
              __pyx_t_12 = 0;

              /* "ctff.pyx":1355
 *                 for fd in self._process_map:
 *                     process = self._process_map[fd]
 *                     process.end()             # <<<<<<<<<<<<<<
 *                     process.close()
 * 
 */
              __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_process, __pyx_n_s_end); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L72_error;}
              __Pyx_GOTREF(__pyx_t_12);
              __pyx_t_13 = PyObject_Call(__pyx_t_12, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L72_error;}
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

              /* "ctff.pyx":1356
 *                     process = self._process_map[fd]
 *                     process.end()
 *                     process.close()             # <<<<<<<<<<<<<<
 * 
 *     def start(self,
 */
              __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_process, __pyx_n_s_close); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L72_error;}
              __Pyx_GOTREF(__pyx_t_13);
              __pyx_t_12 = PyObject_Call(__pyx_t_13, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L72_error;}
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_XGIVEREF(__pyx_t_9);
            __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
          }
          __Pyx_XGIVEREF(__pyx_t_2);
          __Pyx_XGIVEREF(__pyx_t_3);
          __Pyx_XGIVEREF(__pyx_t_4);
          __Pyx_ErrRestore(__pyx_t_2, __pyx_t_3, __pyx_t_4);
          __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0;
          __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_20; __pyx_filename = __pyx_t_21;
          goto __pyx_L1_error;
          __pyx_L72_error:;
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_XGIVEREF(__pyx_t_9);
            __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
          }
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0;
          goto __pyx_L1_error;
        }
        __pyx_L68:;
      }
      goto __pyx_L13;
    }
    /*exception exit:*/{
      __pyx_L12_error:;
      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_20 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_22 = __pyx_filename;
      {

        /* "ctff.pyx":1350
 *                 raise e
 *         finally:
 *             try:             # <<<<<<<<<<<<<<
 *                 self._mainprocess.process_end()
 *             finally:
 */
        /*try:*/ {

          /* "ctff.pyx":1351
 *         finally:
 *             try:
 *                 self._mainprocess.process_end()             # <<<<<<<<<<<<<<
 *             finally:
 *                 for fd in self._process_map:
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_mainprocess); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; __pyx_clineno = __LINE__; goto __pyx_L78_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_process_end); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; __pyx_clineno = __LINE__; goto __pyx_L78_error;}
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = PyObject_Call(__pyx_t_12, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; __pyx_clineno = __LINE__; goto __pyx_L78_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        }

        /* "ctff.pyx":1353
 *                 self._mainprocess.process_end()
 *             finally:
 *                 for fd in self._process_map:             # <<<<<<<<<<<<<<
 *                     process = self._process_map[fd]
 *                     process.end()
 */
        /*finally:*/ {
          /*normal exit:*/{
            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_process_map); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L76_error;}
            __Pyx_GOTREF(__pyx_t_1);
            if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
              __pyx_t_12 = __pyx_t_1; __Pyx_INCREF(__pyx_t_12); __pyx_t_15 = 0;
              __pyx_t_16 = NULL;
            } else {
              __pyx_t_15 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L76_error;}
              __Pyx_GOTREF(__pyx_t_12);
              __pyx_t_16 = Py_TYPE(__pyx_t_12)->tp_iternext;
            }
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            for (;;) {
              if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_12)) {
                if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_12)) break;
                #if CYTHON_COMPILING_IN_CPYTHON
                __pyx_t_1 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L76_error;}
                #else
                __pyx_t_1 = PySequence_ITEM(__pyx_t_12, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L76_error;}
                #endif
              } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_12)) {
                if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_12)) break;
                #if CYTHON_COMPILING_IN_CPYTHON
                __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L76_error;}
                #else
                __pyx_t_1 = PySequence_ITEM(__pyx_t_12, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L76_error;}
                #endif
              } else {
                __pyx_t_1 = __pyx_t_16(__pyx_t_12);
                if (unlikely(!__pyx_t_1)) {
                  PyObject* exc_type = PyErr_Occurred();
                  if (exc_type) {
                    if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                    else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L76_error;}
                  }
                  break;
                }
                __Pyx_GOTREF(__pyx_t_1);
              }
              __Pyx_XDECREF_SET(__pyx_v_fd, __pyx_t_1);
              __pyx_t_1 = 0;

              /* "ctff.pyx":1354
 *             finally:
 *                 for fd in self._process_map:
 *                     process = self._process_map[fd]             # <<<<<<<<<<<<<<
 *                     process.end()
 *                     process.close()
 */
              __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_process_map); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L76_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_13 = PyObject_GetItem(__pyx_t_1, __pyx_v_fd); if (unlikely(__pyx_t_13 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L76_error;};
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_XDECREF_SET(__pyx_v_process, __pyx_t_13);
              __pyx_t_13 = 0;

              /* "ctff.pyx":1355
 *                 for fd in self._process_map:
 *                     process = self._process_map[fd]
 *                     process.end()             # <<<<<<<<<<<<<<
 *                     process.close()
 * 
 */
              __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_process, __pyx_n_s_end); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L76_error;}
              __Pyx_GOTREF(__pyx_t_13);
              __pyx_t_1 = PyObject_Call(__pyx_t_13, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L76_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

              /* "ctff.pyx":1356
 *                     process = self._process_map[fd]
 *                     process.end()
 *                     process.close()             # <<<<<<<<<<<<<<
 * 
 *     def start(self,
 */
              __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_process, __pyx_n_s_close); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L76_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_13 = PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L76_error;}
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            goto __pyx_L79;
          }
          /*exception exit:*/{
            __pyx_L78_error:;
            __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0; __pyx_t_30 = 0; __pyx_t_31 = 0;
            __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_29, &__pyx_t_30, &__pyx_t_31);
            if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_26, &__pyx_t_27, &__pyx_t_28) < 0)) __Pyx_ErrFetch(&__pyx_t_26, &__pyx_t_27, &__pyx_t_28);
            __Pyx_XGOTREF(__pyx_t_26);
            __Pyx_XGOTREF(__pyx_t_27);
            __Pyx_XGOTREF(__pyx_t_28);
            __Pyx_XGOTREF(__pyx_t_29);
            __Pyx_XGOTREF(__pyx_t_30);
            __Pyx_XGOTREF(__pyx_t_31);
            __pyx_t_23 = __pyx_lineno; __pyx_t_24 = __pyx_clineno; __pyx_t_25 = __pyx_filename;
            {

              /* "ctff.pyx":1353
 *                 self._mainprocess.process_end()
 *             finally:
 *                 for fd in self._process_map:             # <<<<<<<<<<<<<<
 *                     process = self._process_map[fd]
 *                     process.end()
 */
              __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_process_map); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L83_error;}
              __Pyx_GOTREF(__pyx_t_12);
              if (PyList_CheckExact(__pyx_t_12) || PyTuple_CheckExact(__pyx_t_12)) {
                __pyx_t_13 = __pyx_t_12; __Pyx_INCREF(__pyx_t_13); __pyx_t_15 = 0;
                __pyx_t_16 = NULL;
              } else {
                __pyx_t_15 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L83_error;}
                __Pyx_GOTREF(__pyx_t_13);
                __pyx_t_16 = Py_TYPE(__pyx_t_13)->tp_iternext;
              }
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              for (;;) {
                if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_13)) {
                  if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_13)) break;
                  #if CYTHON_COMPILING_IN_CPYTHON
                  __pyx_t_12 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_15); __Pyx_INCREF(__pyx_t_12); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L83_error;}
                  #else
                  __pyx_t_12 = PySequence_ITEM(__pyx_t_13, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L83_error;}
                  #endif
                } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_13)) {
                  if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_13)) break;
                  #if CYTHON_COMPILING_IN_CPYTHON
                  __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_15); __Pyx_INCREF(__pyx_t_12); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L83_error;}
                  #else
                  __pyx_t_12 = PySequence_ITEM(__pyx_t_13, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L83_error;}
                  #endif
                } else {
                  __pyx_t_12 = __pyx_t_16(__pyx_t_13);
                  if (unlikely(!__pyx_t_12)) {
                    PyObject* exc_type = PyErr_Occurred();
                    if (exc_type) {
                      if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                      else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L83_error;}
                    }
                    break;
                  }
                  __Pyx_GOTREF(__pyx_t_12);
                }
                __Pyx_XDECREF_SET(__pyx_v_fd, __pyx_t_12);
                __pyx_t_12 = 0;

                /* "ctff.pyx":1354
 *             finally:
 *                 for fd in self._process_map:
 *                     process = self._process_map[fd]             # <<<<<<<<<<<<<<
 *                     process.end()
 *                     process.close()
 */
                __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_process_map); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L83_error;}
                __Pyx_GOTREF(__pyx_t_12);
                __pyx_t_1 = PyObject_GetItem(__pyx_t_12, __pyx_v_fd); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L83_error;};
                __Pyx_GOTREF(__pyx_t_1);
                __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                __Pyx_XDECREF_SET(__pyx_v_process, __pyx_t_1);
                __pyx_t_1 = 0;

                /* "ctff.pyx":1355
 *                 for fd in self._process_map:
 *                     process = self._process_map[fd]
 *                     process.end()             # <<<<<<<<<<<<<<
 *                     process.close()
 * 
 */
                __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_process, __pyx_n_s_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L83_error;}
                __Pyx_GOTREF(__pyx_t_1);
                __pyx_t_12 = PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L83_error;}
                __Pyx_GOTREF(__pyx_t_12);
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

                /* "ctff.pyx":1356
 *                     process = self._process_map[fd]
 *                     process.end()
 *                     process.close()             # <<<<<<<<<<<<<<
 * 
 *     def start(self,
 */
                __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_process, __pyx_n_s_close); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L83_error;}
                __Pyx_GOTREF(__pyx_t_12);
                __pyx_t_1 = PyObject_Call(__pyx_t_12, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L83_error;}
                __Pyx_GOTREF(__pyx_t_1);
                __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              }
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
            if (PY_MAJOR_VERSION >= 3) {
              __Pyx_XGIVEREF(__pyx_t_29);
              __Pyx_XGIVEREF(__pyx_t_30);
              __Pyx_XGIVEREF(__pyx_t_31);
              __Pyx_ExceptionReset(__pyx_t_29, __pyx_t_30, __pyx_t_31);
            }
            __Pyx_XGIVEREF(__pyx_t_26);
            __Pyx_XGIVEREF(__pyx_t_27);
            __Pyx_XGIVEREF(__pyx_t_28);
            __Pyx_ErrRestore(__pyx_t_26, __pyx_t_27, __pyx_t_28);
            __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0; __pyx_t_30 = 0; __pyx_t_31 = 0;
            __pyx_lineno = __pyx_t_23; __pyx_clineno = __pyx_t_24; __pyx_filename = __pyx_t_25;
            goto __pyx_L76_error;
            __pyx_L83_error:;
            if (PY_MAJOR_VERSION >= 3) {
              __Pyx_XGIVEREF(__pyx_t_29);
              __Pyx_XGIVEREF(__pyx_t_30);
              __Pyx_XGIVEREF(__pyx_t_31);
              __Pyx_ExceptionReset(__pyx_t_29, __pyx_t_30, __pyx_t_31);
            }
            __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0;
            __Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0;
            __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0;
            __pyx_t_29 = 0; __pyx_t_30 = 0; __pyx_t_31 = 0;
            goto __pyx_L76_error;
          }
          __pyx_L79:;
        }
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_3);
        __Pyx_XGIVEREF(__pyx_t_2);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_3, __pyx_t_2);
      }
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0;
      __pyx_lineno = __pyx_t_20; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_22;
      goto __pyx_L1_error;
      __pyx_L76_error:;
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_3);
        __Pyx_XGIVEREF(__pyx_t_2);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_3, __pyx_t_2);
      }
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L11_return: {
      __pyx_t_2 = __pyx_r;
      __pyx_r = 0;

      /* "ctff.pyx":1350
 *                 raise e
 *         finally:
 *             try:             # <<<<<<<<<<<<<<
 *                 self._mainprocess.process_end()
 *             finally:
 */
      /*try:*/ {

        /* "ctff.pyx":1351
 *         finally:
 *             try:
 *                 self._mainprocess.process_end()             # <<<<<<<<<<<<<<
 *             finally:
 *                 for fd in self._process_map:
 */
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_mainprocess); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; __pyx_clineno = __LINE__; goto __pyx_L87_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_process_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; __pyx_clineno = __LINE__; goto __pyx_L87_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_13 = PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; __pyx_clineno = __LINE__; goto __pyx_L87_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      }

      /* "ctff.pyx":1353
 *                 self._mainprocess.process_end()
 *             finally:
 *                 for fd in self._process_map:             # <<<<<<<<<<<<<<
 *                     process = self._process_map[fd]
 *                     process.end()
 */
      /*finally:*/ {
        /*normal exit:*/{
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_process_map); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          if (PyList_CheckExact(__pyx_t_13) || PyTuple_CheckExact(__pyx_t_13)) {
            __pyx_t_1 = __pyx_t_13; __Pyx_INCREF(__pyx_t_1); __pyx_t_15 = 0;
            __pyx_t_16 = NULL;
          } else {
            __pyx_t_15 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_13); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_16 = Py_TYPE(__pyx_t_1)->tp_iternext;
          }
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          for (;;) {
            if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_1)) {
              if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_1)) break;
              #if CYTHON_COMPILING_IN_CPYTHON
              __pyx_t_13 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_15); __Pyx_INCREF(__pyx_t_13); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              #else
              __pyx_t_13 = PySequence_ITEM(__pyx_t_1, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              #endif
            } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_1)) {
              if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
              #if CYTHON_COMPILING_IN_CPYTHON
              __pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_15); __Pyx_INCREF(__pyx_t_13); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              #else
              __pyx_t_13 = PySequence_ITEM(__pyx_t_1, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              #endif
            } else {
              __pyx_t_13 = __pyx_t_16(__pyx_t_1);
              if (unlikely(!__pyx_t_13)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                  else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_13);
            }
            __Pyx_XDECREF_SET(__pyx_v_fd, __pyx_t_13);
            __pyx_t_13 = 0;

            /* "ctff.pyx":1354
 *             finally:
 *                 for fd in self._process_map:
 *                     process = self._process_map[fd]             # <<<<<<<<<<<<<<
 *                     process.end()
 *                     process.close()
 */
            __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_process_map); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_12 = PyObject_GetItem(__pyx_t_13, __pyx_v_fd); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF_SET(__pyx_v_process, __pyx_t_12);
            __pyx_t_12 = 0;

            /* "ctff.pyx":1355
 *                 for fd in self._process_map:
 *                     process = self._process_map[fd]
 *                     process.end()             # <<<<<<<<<<<<<<
 *                     process.close()
 * 
 */
            __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_process, __pyx_n_s_end); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_13 = PyObject_Call(__pyx_t_12, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

            /* "ctff.pyx":1356
 *                     process = self._process_map[fd]
 *                     process.end()
 *                     process.close()             # <<<<<<<<<<<<<<
 * 
 *     def start(self,
 */
            __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_process, __pyx_n_s_close); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_12 = PyObject_Call(__pyx_t_13, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L88;
        }
        /*exception exit:*/{
          __pyx_L87_error:;
          __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_31 = 0;
          __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_9, &__pyx_t_31);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_3, &__pyx_t_4, &__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_3);
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_31);
          __pyx_t_7 = __pyx_lineno; __pyx_t_20 = __pyx_clineno; __pyx_t_32 = __pyx_filename;
          {

            /* "ctff.pyx":1353
 *                 self._mainprocess.process_end()
 *             finally:
 *                 for fd in self._process_map:             # <<<<<<<<<<<<<<
 *                     process = self._process_map[fd]
 *                     process.end()
 */
            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_process_map); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L92_error;}
            __Pyx_GOTREF(__pyx_t_1);
            if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
              __pyx_t_12 = __pyx_t_1; __Pyx_INCREF(__pyx_t_12); __pyx_t_15 = 0;
              __pyx_t_16 = NULL;
            } else {
              __pyx_t_15 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L92_error;}
              __Pyx_GOTREF(__pyx_t_12);
              __pyx_t_16 = Py_TYPE(__pyx_t_12)->tp_iternext;
            }
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            for (;;) {
              if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_12)) {
                if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_12)) break;
                #if CYTHON_COMPILING_IN_CPYTHON
                __pyx_t_1 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L92_error;}
                #else
                __pyx_t_1 = PySequence_ITEM(__pyx_t_12, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L92_error;}
                #endif
              } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_12)) {
                if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_12)) break;
                #if CYTHON_COMPILING_IN_CPYTHON
                __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L92_error;}
                #else
                __pyx_t_1 = PySequence_ITEM(__pyx_t_12, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L92_error;}
                #endif
              } else {
                __pyx_t_1 = __pyx_t_16(__pyx_t_12);
                if (unlikely(!__pyx_t_1)) {
                  PyObject* exc_type = PyErr_Occurred();
                  if (exc_type) {
                    if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                    else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L92_error;}
                  }
                  break;
                }
                __Pyx_GOTREF(__pyx_t_1);
              }
              __Pyx_XDECREF_SET(__pyx_v_fd, __pyx_t_1);
              __pyx_t_1 = 0;

              /* "ctff.pyx":1354
 *             finally:
 *                 for fd in self._process_map:
 *                     process = self._process_map[fd]             # <<<<<<<<<<<<<<
 *                     process.end()
 *                     process.close()
 */
              __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_process_map); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L92_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_13 = PyObject_GetItem(__pyx_t_1, __pyx_v_fd); if (unlikely(__pyx_t_13 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L92_error;};
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_XDECREF_SET(__pyx_v_process, __pyx_t_13);
              __pyx_t_13 = 0;

              /* "ctff.pyx":1355
 *                 for fd in self._process_map:
 *                     process = self._process_map[fd]
 *                     process.end()             # <<<<<<<<<<<<<<
 *                     process.close()
 * 
 */
              __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_process, __pyx_n_s_end); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L92_error;}
              __Pyx_GOTREF(__pyx_t_13);
              __pyx_t_1 = PyObject_Call(__pyx_t_13, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L92_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

              /* "ctff.pyx":1356
 *                     process = self._process_map[fd]
 *                     process.end()
 *                     process.close()             # <<<<<<<<<<<<<<
 * 
 *     def start(self,
 */
              __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_process, __pyx_n_s_close); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L92_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_13 = PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L92_error;}
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_XGIVEREF(__pyx_t_9);
            __Pyx_XGIVEREF(__pyx_t_31);
            __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_31);
          }
          __Pyx_XGIVEREF(__pyx_t_3);
          __Pyx_XGIVEREF(__pyx_t_4);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_ErrRestore(__pyx_t_3, __pyx_t_4, __pyx_t_11);
          __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_31 = 0;
          __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_20; __pyx_filename = __pyx_t_32;
          goto __pyx_L1_error;
          __pyx_L92_error:;
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_XGIVEREF(__pyx_t_9);
            __Pyx_XGIVEREF(__pyx_t_31);
            __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_31);
          }
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_31 = 0;
          goto __pyx_L1_error;
        }
        __pyx_L88:;
      }
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    }
    __pyx_L13:;
  }

  /* "ctff.pyx":1277
 *         self._mainprocess.process_output("")
 * 
 *     def drive(self):             # <<<<<<<<<<<<<<
 * 
 *         def onresize(no, frame):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_AddTraceback("ctff.Session.drive", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_onresize);
  __Pyx_XDECREF(__pyx_v_stdin_fileno);
  __Pyx_XDECREF(__pyx_v_rfd);
  __Pyx_XDECREF(__pyx_v_wfd);
  __Pyx_XDECREF(__pyx_v_xfd);
  __Pyx_XDECREF(__pyx_v_fd);
  __Pyx_XDECREF(__pyx_v_process);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XDECREF(__pyx_v_col);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_target_fd);
  __Pyx_XDECREF(__pyx_v_process_map);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_no);
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":1358
 *                     process.close()
 * 
 *     def start(self,             # <<<<<<<<<<<<<<
 *               termenc,
 *               stdin=sys.stdin,
 */

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

  /* "ctff.pyx":1368
 *               outputparser=DefaultParser(),
 *               outputhandler=DefaultHandler(),
 *               buffering=False):             # <<<<<<<<<<<<<<
 * 
 *         mainprocess = self._mainprocess
 */
  __pyx_t_1 = PyTuple_New(9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_stdin);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_stdin);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_stdin);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_stdout);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_stdout);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_stdout);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_inputscanner);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_inputscanner);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_inputscanner);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_inputparser);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_inputparser);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_inputparser);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_inputhandler);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_inputhandler);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_inputhandler);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_outputscanner);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_outputscanner);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_outputscanner);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_outputparser);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_outputparser);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_outputparser);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_outputhandler);
  PyTuple_SET_ITEM(__pyx_t_1, 7, __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_outputhandler);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_outputhandler);
  __Pyx_INCREF(((PyObject *)Py_False));
  PyTuple_SET_ITEM(__pyx_t_1, 8, ((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));

  /* "ctff.pyx":1358
 *                     process.close()
 * 
 *     def start(self,             # <<<<<<<<<<<<<<
 *               termenc,
 *               stdin=sys.stdin,
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Session_19start(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Session_19start = {__Pyx_NAMESTR("start"), (PyCFunction)__pyx_pw_4ctff_7Session_19start, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Session_19start(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_termenc = 0;
  CYTHON_UNUSED PyObject *__pyx_v_stdin = 0;
  CYTHON_UNUSED PyObject *__pyx_v_stdout = 0;
  PyObject *__pyx_v_inputscanner = 0;
  PyObject *__pyx_v_inputparser = 0;
  PyObject *__pyx_v_inputhandler = 0;
  PyObject *__pyx_v_outputscanner = 0;
  PyObject *__pyx_v_outputparser = 0;
  PyObject *__pyx_v_outputhandler = 0;
  PyObject *__pyx_v_buffering = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("start (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_termenc,&__pyx_n_s_stdin,&__pyx_n_s_stdout,&__pyx_n_s_inputscanner,&__pyx_n_s_inputparser,&__pyx_n_s_inputhandler,&__pyx_n_s_outputscanner,&__pyx_n_s_outputparser,&__pyx_n_s_outputhandler,&__pyx_n_s_buffering,0};
    PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
    __pyx_defaults4 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self);
    values[2] = __pyx_dynamic_args->__pyx_arg_stdin;
    values[3] = __pyx_dynamic_args->__pyx_arg_stdout;
    values[4] = __pyx_dynamic_args->__pyx_arg_inputscanner;
    values[5] = __pyx_dynamic_args->__pyx_arg_inputparser;
    values[6] = __pyx_dynamic_args->__pyx_arg_inputhandler;
    values[7] = __pyx_dynamic_args->__pyx_arg_outputscanner;
    values[8] = __pyx_dynamic_args->__pyx_arg_outputparser;
    values[9] = __pyx_dynamic_args->__pyx_arg_outputhandler;
    values[10] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_termenc)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("start", 0, 2, 11, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stdin);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stdout);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_inputscanner);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_inputparser);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_inputhandler);
          if (value) { values[6] = value; kw_args--; }
        }
        case  7:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_outputscanner);
          if (value) { values[7] = value; kw_args--; }
        }
        case  8:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_outputparser);
          if (value) { values[8] = value; kw_args--; }
        }
        case  9:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_outputhandler);
          if (value) { values[9] = value; kw_args--; }
        }
        case 10:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buffering);
          if (value) { values[10] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "start") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_termenc = values[1];
    __pyx_v_stdin = values[2];
    __pyx_v_stdout = values[3];
    __pyx_v_inputscanner = values[4];
    __pyx_v_inputparser = values[5];
    __pyx_v_inputhandler = values[6];
    __pyx_v_outputscanner = values[7];
    __pyx_v_outputparser = values[8];
    __pyx_v_outputhandler = values[9];
    __pyx_v_buffering = values[10];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("start", 0, 2, 11, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.Session.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_7Session_18start(__pyx_self, __pyx_v_self, __pyx_v_termenc, __pyx_v_stdin, __pyx_v_stdout, __pyx_v_inputscanner, __pyx_v_inputparser, __pyx_v_inputhandler, __pyx_v_outputscanner, __pyx_v_outputparser, __pyx_v_outputhandler, __pyx_v_buffering);

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

/* "ctff.pyx":1381
 *         self._resized = False
 * 
 *         def onclose(no, frame):             # <<<<<<<<<<<<<<
 *             pid, status = os.wait()
 *             if not mainprocess.is_alive():
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Session_5start_1onclose(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Session_5start_1onclose = {__Pyx_NAMESTR("onclose"), (PyCFunction)__pyx_pw_4ctff_7Session_5start_1onclose, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Session_5start_1onclose(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_no = 0;
  CYTHON_UNUSED PyObject *__pyx_v_frame = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("onclose (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_no,&__pyx_n_s_frame,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_no)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_frame)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("onclose", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "onclose") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __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_no = values[0];
    __pyx_v_frame = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("onclose", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.Session.start.onclose", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_7Session_5start_onclose(__pyx_self, __pyx_v_no, __pyx_v_frame);

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

static PyObject *__pyx_pf_4ctff_7Session_5start_onclose(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_no, CYTHON_UNUSED PyObject *__pyx_v_frame) {
  struct __pyx_obj_4ctff___pyx_scope_struct_4_start *__pyx_cur_scope;
  struct __pyx_obj_4ctff___pyx_scope_struct_4_start *__pyx_outer_scope;
  PyObject *__pyx_v_pid = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_status = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("onclose", 0);
  __pyx_outer_scope = (struct __pyx_obj_4ctff___pyx_scope_struct_4_start *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "ctff.pyx":1382
 * 
 *         def onclose(no, frame):
 *             pid, status = os.wait()             # <<<<<<<<<<<<<<
 *             if not mainprocess.is_alive():
 *                 self._alive = False
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_wait); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    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_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_pid = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_status = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ctff.pyx":1383
 *         def onclose(no, frame):
 *             pid, status = os.wait()
 *             if not mainprocess.is_alive():             # <<<<<<<<<<<<<<
 *                 self._alive = False
 *             elif pid == mainprocess.getpid():
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_mainprocess)) { __Pyx_RaiseClosureNameError("mainprocess"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_mainprocess, __pyx_n_s_is_alive); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = ((!__pyx_t_6) != 0);
  if (__pyx_t_7) {

    /* "ctff.pyx":1384
 *             pid, status = os.wait()
 *             if not mainprocess.is_alive():
 *                 self._alive = False             # <<<<<<<<<<<<<<
 *             elif pid == mainprocess.getpid():
 *                 self._alive = False
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_alive, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }

  /* "ctff.pyx":1385
 *             if not mainprocess.is_alive():
 *                 self._alive = False
 *             elif pid == mainprocess.getpid():             # <<<<<<<<<<<<<<
 *                 self._alive = False
 *             else:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_mainprocess, __pyx_n_s_getpid); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_pid, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_7) {

    /* "ctff.pyx":1386
 *                 self._alive = False
 *             elif pid == mainprocess.getpid():
 *                 self._alive = False             # <<<<<<<<<<<<<<
 *             else:
 *                 self.focus_process(mainprocess)
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_alive, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  /*else*/ {

    /* "ctff.pyx":1388
 *                 self._alive = False
 *             else:
 *                 self.focus_process(mainprocess)             # <<<<<<<<<<<<<<
 * 
 *         signal.signal(signal.SIGCHLD, onclose)
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_focus_process); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_mainprocess);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_mainprocess);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_mainprocess);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L5:;

  /* "ctff.pyx":1381
 *         self._resized = False
 * 
 *         def onclose(no, frame):             # <<<<<<<<<<<<<<
 *             pid, status = os.wait()
 *             if not mainprocess.is_alive():
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("ctff.Session.start.onclose", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pid);
  __Pyx_XDECREF(__pyx_v_status);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":1358
 *                     process.close()
 * 
 *     def start(self,             # <<<<<<<<<<<<<<
 *               termenc,
 *               stdin=sys.stdin,
 */

static PyObject *__pyx_pf_4ctff_7Session_18start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_termenc, CYTHON_UNUSED PyObject *__pyx_v_stdin, CYTHON_UNUSED PyObject *__pyx_v_stdout, PyObject *__pyx_v_inputscanner, PyObject *__pyx_v_inputparser, PyObject *__pyx_v_inputhandler, PyObject *__pyx_v_outputscanner, PyObject *__pyx_v_outputparser, PyObject *__pyx_v_outputhandler, PyObject *__pyx_v_buffering) {
  struct __pyx_obj_4ctff___pyx_scope_struct_4_start *__pyx_cur_scope;
  PyObject *__pyx_v_onclose = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("start", 0);
  __pyx_cur_scope = (struct __pyx_obj_4ctff___pyx_scope_struct_4_start *)__pyx_tp_new_4ctff___pyx_scope_struct_4_start(__pyx_ptype_4ctff___pyx_scope_struct_4_start, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);

  /* "ctff.pyx":1370
 *               buffering=False):
 * 
 *         mainprocess = self._mainprocess             # <<<<<<<<<<<<<<
 * 
 *         self._init_process(mainprocess,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_mainprocess); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_mainprocess = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ctff.pyx":1372
 *         mainprocess = self._mainprocess
 * 
 *         self._init_process(mainprocess,             # <<<<<<<<<<<<<<
 *                            termenc,
 *                            inputhandler, outputhandler,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_init_process); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "ctff.pyx":1377
 *                            inputparser, outputparser,
 *                            inputscanner, outputscanner,
 *                            buffering)             # <<<<<<<<<<<<<<
 * 
 *         self._resized = False
 */
  __pyx_t_2 = PyTuple_New(9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_mainprocess);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_mainprocess);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_mainprocess);
  __Pyx_INCREF(__pyx_v_termenc);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_termenc);
  __Pyx_GIVEREF(__pyx_v_termenc);
  __Pyx_INCREF(__pyx_v_inputhandler);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_inputhandler);
  __Pyx_GIVEREF(__pyx_v_inputhandler);
  __Pyx_INCREF(__pyx_v_outputhandler);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_outputhandler);
  __Pyx_GIVEREF(__pyx_v_outputhandler);
  __Pyx_INCREF(__pyx_v_inputparser);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_inputparser);
  __Pyx_GIVEREF(__pyx_v_inputparser);
  __Pyx_INCREF(__pyx_v_outputparser);
  PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_v_outputparser);
  __Pyx_GIVEREF(__pyx_v_outputparser);
  __Pyx_INCREF(__pyx_v_inputscanner);
  PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_v_inputscanner);
  __Pyx_GIVEREF(__pyx_v_inputscanner);
  __Pyx_INCREF(__pyx_v_outputscanner);
  PyTuple_SET_ITEM(__pyx_t_2, 7, __pyx_v_outputscanner);
  __Pyx_GIVEREF(__pyx_v_outputscanner);
  __Pyx_INCREF(__pyx_v_buffering);
  PyTuple_SET_ITEM(__pyx_t_2, 8, __pyx_v_buffering);
  __Pyx_GIVEREF(__pyx_v_buffering);

  /* "ctff.pyx":1372
 *         mainprocess = self._mainprocess
 * 
 *         self._init_process(mainprocess,             # <<<<<<<<<<<<<<
 *                            termenc,
 *                            inputhandler, outputhandler,
 */
  __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ctff.pyx":1379
 *                            buffering)
 * 
 *         self._resized = False             # <<<<<<<<<<<<<<
 * 
 *         def onclose(no, frame):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_resized, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1381
 *         self._resized = False
 * 
 *         def onclose(no, frame):             # <<<<<<<<<<<<<<
 *             pid, status = os.wait()
 *             if not mainprocess.is_alive():
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Session_5start_1onclose, 0, __pyx_n_s_Session_start_locals_onclose, ((PyObject*)__pyx_cur_scope), __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_onclose = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ctff.pyx":1390
 *                 self.focus_process(mainprocess)
 * 
 *         signal.signal(signal.SIGCHLD, onclose)             # <<<<<<<<<<<<<<
 * 
 *         self.drive()
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_signal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_signal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_signal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_SIGCHLD); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_onclose);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_onclose);
  __Pyx_GIVEREF(__pyx_v_onclose);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1392
 *         signal.signal(signal.SIGCHLD, onclose)
 * 
 *         self.drive()             # <<<<<<<<<<<<<<
 * 
 *     def _init_process(self,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_drive); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ctff.pyx":1358
 *                     process.close()
 * 
 *     def start(self,             # <<<<<<<<<<<<<<
 *               termenc,
 *               stdin=sys.stdin,
 */

  /* 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("ctff.Session.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_onclose);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":1394
 *         self.drive()
 * 
 *     def _init_process(self,             # <<<<<<<<<<<<<<
 *                       process,
 *                       termenc,
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_7Session_21_init_process(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_7Session_21_init_process = {__Pyx_NAMESTR("_init_process"), (PyCFunction)__pyx_pw_4ctff_7Session_21_init_process, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_7Session_21_init_process(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_process = 0;
  PyObject *__pyx_v_termenc = 0;
  PyObject *__pyx_v_inputhandler = 0;
  PyObject *__pyx_v_outputhandler = 0;
  PyObject *__pyx_v_inputparser = 0;
  PyObject *__pyx_v_outputparser = 0;
  PyObject *__pyx_v_inputscanner = 0;
  PyObject *__pyx_v_outputscanner = 0;
  PyObject *__pyx_v_buffering = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_process (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_process,&__pyx_n_s_termenc,&__pyx_n_s_inputhandler,&__pyx_n_s_outputhandler,&__pyx_n_s_inputparser,&__pyx_n_s_outputparser,&__pyx_n_s_inputscanner,&__pyx_n_s_outputscanner,&__pyx_n_s_buffering,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_process)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_init_process", 1, 10, 10, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_termenc)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_init_process", 1, 10, 10, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_inputhandler)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_init_process", 1, 10, 10, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_outputhandler)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_init_process", 1, 10, 10, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_inputparser)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_init_process", 1, 10, 10, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  6:
        if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_outputparser)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_init_process", 1, 10, 10, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  7:
        if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_inputscanner)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_init_process", 1, 10, 10, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  8:
        if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_outputscanner)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_init_process", 1, 10, 10, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  9:
        if (likely((values[9] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buffering)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_init_process", 1, 10, 10, 9); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_init_process") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_self = values[0];
    __pyx_v_process = values[1];
    __pyx_v_termenc = values[2];
    __pyx_v_inputhandler = values[3];
    __pyx_v_outputhandler = values[4];
    __pyx_v_inputparser = values[5];
    __pyx_v_outputparser = values[6];
    __pyx_v_inputscanner = values[7];
    __pyx_v_outputscanner = values[8];
    __pyx_v_buffering = values[9];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_init_process", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("ctff.Session._init_process", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4ctff_7Session_20_init_process(__pyx_self, __pyx_v_self, __pyx_v_process, __pyx_v_termenc, __pyx_v_inputhandler, __pyx_v_outputhandler, __pyx_v_inputparser, __pyx_v_outputparser, __pyx_v_inputscanner, __pyx_v_outputscanner, __pyx_v_buffering);

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

static PyObject *__pyx_pf_4ctff_7Session_20_init_process(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_process, PyObject *__pyx_v_termenc, PyObject *__pyx_v_inputhandler, PyObject *__pyx_v_outputhandler, PyObject *__pyx_v_inputparser, PyObject *__pyx_v_outputparser, PyObject *__pyx_v_inputscanner, PyObject *__pyx_v_outputscanner, PyObject *__pyx_v_buffering) {
  PyObject *__pyx_v_fd = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_process", 0);

  /* "ctff.pyx":1402
 *                       buffering):
 * 
 *         fd = process.fileno()             # <<<<<<<<<<<<<<
 *         self._rfds.append(fd)
 *         self._xfds.append(fd)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_process, __pyx_n_s_fileno); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_fd = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "ctff.pyx":1403
 * 
 *         fd = process.fileno()
 *         self._rfds.append(fd)             # <<<<<<<<<<<<<<
 *         self._xfds.append(fd)
 *         self._process_map[fd] = process
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rfds); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_v_fd); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":1404
 *         fd = process.fileno()
 *         self._rfds.append(fd)
 *         self._xfds.append(fd)             # <<<<<<<<<<<<<<
 *         self._process_map[fd] = process
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_xfds); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_v_fd); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":1405
 *         self._rfds.append(fd)
 *         self._xfds.append(fd)
 *         self._process_map[fd] = process             # <<<<<<<<<<<<<<
 * 
 *         process.start(termenc,
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_process_map); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_v_fd, __pyx_v_process) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":1407
 *         self._process_map[fd] = process
 * 
 *         process.start(termenc,             # <<<<<<<<<<<<<<
 *                       inputhandler,
 *                       outputhandler,
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_process, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);

  /* "ctff.pyx":1414
 *                       inputscanner,
 *                       outputscanner,
 *                       buffering)             # <<<<<<<<<<<<<<
 *         self.focus_process(process)
 * 
 */
  __pyx_t_1 = PyTuple_New(8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_termenc);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_termenc);
  __Pyx_GIVEREF(__pyx_v_termenc);
  __Pyx_INCREF(__pyx_v_inputhandler);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_inputhandler);
  __Pyx_GIVEREF(__pyx_v_inputhandler);
  __Pyx_INCREF(__pyx_v_outputhandler);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_outputhandler);
  __Pyx_GIVEREF(__pyx_v_outputhandler);
  __Pyx_INCREF(__pyx_v_inputparser);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_inputparser);
  __Pyx_GIVEREF(__pyx_v_inputparser);
  __Pyx_INCREF(__pyx_v_outputparser);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_outputparser);
  __Pyx_GIVEREF(__pyx_v_outputparser);
  __Pyx_INCREF(__pyx_v_inputscanner);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_v_inputscanner);
  __Pyx_GIVEREF(__pyx_v_inputscanner);
  __Pyx_INCREF(__pyx_v_outputscanner);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_v_outputscanner);
  __Pyx_GIVEREF(__pyx_v_outputscanner);
  __Pyx_INCREF(__pyx_v_buffering);
  PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_v_buffering);
  __Pyx_GIVEREF(__pyx_v_buffering);

  /* "ctff.pyx":1407
 *         self._process_map[fd] = process
 * 
 *         process.start(termenc,             # <<<<<<<<<<<<<<
 *                       inputhandler,
 *                       outputhandler,
 */
  __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":1415
 *                       outputscanner,
 *                       buffering)
 *         self.focus_process(process)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_focus_process); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_process);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_process);
  __Pyx_GIVEREF(__pyx_v_process);
  __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":1394
 *         self.drive()
 * 
 *     def _init_process(self,             # <<<<<<<<<<<<<<
 *                       process,
 *                       termenc,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("ctff.Session._init_process", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fd);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ctff.pyx":1418
 * 
 * 
 * def _test():             # <<<<<<<<<<<<<<
 *     import doctest
 *     doctest.testmod()
 */

/* Python wrapper */
static PyObject *__pyx_pw_4ctff_1_test(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_4ctff_1_test = {__Pyx_NAMESTR("_test"), (PyCFunction)__pyx_pw_4ctff_1_test, METH_NOARGS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_4ctff_1_test(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test (wrapper)", 0);
  __pyx_r = __pyx_pf_4ctff__test(__pyx_self);

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

static PyObject *__pyx_pf_4ctff__test(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_doctest = NULL;
  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("_test", 0);

  /* "ctff.pyx":1419
 * 
 * def _test():
 *     import doctest             # <<<<<<<<<<<<<<
 *     doctest.testmod()
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_doctest, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_doctest = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ctff.pyx":1420
 * def _test():
 *     import doctest
 *     doctest.testmod()             # <<<<<<<<<<<<<<
 * 
 * ''' main '''
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_doctest, __pyx_n_s_testmod); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":1418
 * 
 * 
 * def _test():             # <<<<<<<<<<<<<<
 *     import doctest
 *     doctest.testmod()
 */

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

static struct __pyx_obj_4ctff___pyx_scope_struct_2_process_input *__pyx_freelist_4ctff___pyx_scope_struct_2_process_input[8];
static int __pyx_freecount_4ctff___pyx_scope_struct_2_process_input = 0;

static PyObject *__pyx_tp_new_4ctff___pyx_scope_struct_2_process_input(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (likely((__pyx_freecount_4ctff___pyx_scope_struct_2_process_input > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4ctff___pyx_scope_struct_2_process_input)))) {
    o = (PyObject*)__pyx_freelist_4ctff___pyx_scope_struct_2_process_input[--__pyx_freecount_4ctff___pyx_scope_struct_2_process_input];
    memset(o, 0, sizeof(struct __pyx_obj_4ctff___pyx_scope_struct_2_process_input));
    (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_4ctff___pyx_scope_struct_2_process_input(PyObject *o) {
  struct __pyx_obj_4ctff___pyx_scope_struct_2_process_input *p = (struct __pyx_obj_4ctff___pyx_scope_struct_2_process_input *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if ((__pyx_freecount_4ctff___pyx_scope_struct_2_process_input < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ctff___pyx_scope_struct_2_process_input))) {
    __pyx_freelist_4ctff___pyx_scope_struct_2_process_input[__pyx_freecount_4ctff___pyx_scope_struct_2_process_input++] = ((struct __pyx_obj_4ctff___pyx_scope_struct_2_process_input *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_4ctff___pyx_scope_struct_2_process_input(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ctff___pyx_scope_struct_2_process_input *p = (struct __pyx_obj_4ctff___pyx_scope_struct_2_process_input *)o;
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4ctff___pyx_scope_struct_2_process_input(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4ctff___pyx_scope_struct_2_process_input *p = (struct __pyx_obj_4ctff___pyx_scope_struct_2_process_input *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_4ctff___pyx_scope_struct_2_process_input = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("ctff.__pyx_scope_struct_2_process_input"), /*tp_name*/
  sizeof(struct __pyx_obj_4ctff___pyx_scope_struct_2_process_input), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ctff___pyx_scope_struct_2_process_input, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_4ctff___pyx_scope_struct_2_process_input, /*tp_traverse*/
  __pyx_tp_clear_4ctff___pyx_scope_struct_2_process_input, /*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_4ctff___pyx_scope_struct_2_process_input, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_4ctff___pyx_scope_struct_4_start *__pyx_freelist_4ctff___pyx_scope_struct_4_start[8];
static int __pyx_freecount_4ctff___pyx_scope_struct_4_start = 0;

static PyObject *__pyx_tp_new_4ctff___pyx_scope_struct_4_start(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (likely((__pyx_freecount_4ctff___pyx_scope_struct_4_start > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4ctff___pyx_scope_struct_4_start)))) {
    o = (PyObject*)__pyx_freelist_4ctff___pyx_scope_struct_4_start[--__pyx_freecount_4ctff___pyx_scope_struct_4_start];
    memset(o, 0, sizeof(struct __pyx_obj_4ctff___pyx_scope_struct_4_start));
    (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_4ctff___pyx_scope_struct_4_start(PyObject *o) {
  struct __pyx_obj_4ctff___pyx_scope_struct_4_start *p = (struct __pyx_obj_4ctff___pyx_scope_struct_4_start *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_mainprocess);
  Py_CLEAR(p->__pyx_v_self);
  if ((__pyx_freecount_4ctff___pyx_scope_struct_4_start < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ctff___pyx_scope_struct_4_start))) {
    __pyx_freelist_4ctff___pyx_scope_struct_4_start[__pyx_freecount_4ctff___pyx_scope_struct_4_start++] = ((struct __pyx_obj_4ctff___pyx_scope_struct_4_start *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_4ctff___pyx_scope_struct_4_start(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ctff___pyx_scope_struct_4_start *p = (struct __pyx_obj_4ctff___pyx_scope_struct_4_start *)o;
  if (p->__pyx_v_mainprocess) {
    e = (*v)(p->__pyx_v_mainprocess, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4ctff___pyx_scope_struct_4_start(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4ctff___pyx_scope_struct_4_start *p = (struct __pyx_obj_4ctff___pyx_scope_struct_4_start *)o;
  tmp = ((PyObject*)p->__pyx_v_mainprocess);
  p->__pyx_v_mainprocess = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_4ctff___pyx_scope_struct_4_start = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("ctff.__pyx_scope_struct_4_start"), /*tp_name*/
  sizeof(struct __pyx_obj_4ctff___pyx_scope_struct_4_start), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ctff___pyx_scope_struct_4_start, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_4ctff___pyx_scope_struct_4_start, /*tp_traverse*/
  __pyx_tp_clear_4ctff___pyx_scope_struct_4_start, /*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_4ctff___pyx_scope_struct_4_start, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_4ctff___pyx_scope_struct____iter__ *__pyx_freelist_4ctff___pyx_scope_struct____iter__[8];
static int __pyx_freecount_4ctff___pyx_scope_struct____iter__ = 0;

static PyObject *__pyx_tp_new_4ctff___pyx_scope_struct____iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (likely((__pyx_freecount_4ctff___pyx_scope_struct____iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4ctff___pyx_scope_struct____iter__)))) {
    o = (PyObject*)__pyx_freelist_4ctff___pyx_scope_struct____iter__[--__pyx_freecount_4ctff___pyx_scope_struct____iter__];
    memset(o, 0, sizeof(struct __pyx_obj_4ctff___pyx_scope_struct____iter__));
    (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_4ctff___pyx_scope_struct____iter__(PyObject *o) {
  struct __pyx_obj_4ctff___pyx_scope_struct____iter__ *p = (struct __pyx_obj_4ctff___pyx_scope_struct____iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_t_0);
  if ((__pyx_freecount_4ctff___pyx_scope_struct____iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ctff___pyx_scope_struct____iter__))) {
    __pyx_freelist_4ctff___pyx_scope_struct____iter__[__pyx_freecount_4ctff___pyx_scope_struct____iter__++] = ((struct __pyx_obj_4ctff___pyx_scope_struct____iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_4ctff___pyx_scope_struct____iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ctff___pyx_scope_struct____iter__ *p = (struct __pyx_obj_4ctff___pyx_scope_struct____iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4ctff___pyx_scope_struct____iter__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4ctff___pyx_scope_struct____iter__ *p = (struct __pyx_obj_4ctff___pyx_scope_struct____iter__ *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_4ctff___pyx_scope_struct____iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("ctff.__pyx_scope_struct____iter__"), /*tp_name*/
  sizeof(struct __pyx_obj_4ctff___pyx_scope_struct____iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ctff___pyx_scope_struct____iter__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_4ctff___pyx_scope_struct____iter__, /*tp_traverse*/
  __pyx_tp_clear_4ctff___pyx_scope_struct____iter__, /*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_4ctff___pyx_scope_struct____iter__, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_4ctff___pyx_scope_struct_1___iter__ *__pyx_freelist_4ctff___pyx_scope_struct_1___iter__[8];
static int __pyx_freecount_4ctff___pyx_scope_struct_1___iter__ = 0;

static PyObject *__pyx_tp_new_4ctff___pyx_scope_struct_1___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (likely((__pyx_freecount_4ctff___pyx_scope_struct_1___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4ctff___pyx_scope_struct_1___iter__)))) {
    o = (PyObject*)__pyx_freelist_4ctff___pyx_scope_struct_1___iter__[--__pyx_freecount_4ctff___pyx_scope_struct_1___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_4ctff___pyx_scope_struct_1___iter__));
    (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_4ctff___pyx_scope_struct_1___iter__(PyObject *o) {
  struct __pyx_obj_4ctff___pyx_scope_struct_1___iter__ *p = (struct __pyx_obj_4ctff___pyx_scope_struct_1___iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_c);
  Py_CLEAR(p->__pyx_v_c1);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_x);
  Py_CLEAR(p->__pyx_t_0);
  if ((__pyx_freecount_4ctff___pyx_scope_struct_1___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ctff___pyx_scope_struct_1___iter__))) {
    __pyx_freelist_4ctff___pyx_scope_struct_1___iter__[__pyx_freecount_4ctff___pyx_scope_struct_1___iter__++] = ((struct __pyx_obj_4ctff___pyx_scope_struct_1___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_4ctff___pyx_scope_struct_1___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ctff___pyx_scope_struct_1___iter__ *p = (struct __pyx_obj_4ctff___pyx_scope_struct_1___iter__ *)o;
  if (p->__pyx_v_c) {
    e = (*v)(p->__pyx_v_c, a); if (e) return e;
  }
  if (p->__pyx_v_c1) {
    e = (*v)(p->__pyx_v_c1, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  if (p->__pyx_v_x) {
    e = (*v)(p->__pyx_v_x, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4ctff___pyx_scope_struct_1___iter__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4ctff___pyx_scope_struct_1___iter__ *p = (struct __pyx_obj_4ctff___pyx_scope_struct_1___iter__ *)o;
  tmp = ((PyObject*)p->__pyx_v_c);
  p->__pyx_v_c = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_c1);
  p->__pyx_v_c1 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_x);
  p->__pyx_v_x = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_4ctff___pyx_scope_struct_1___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("ctff.__pyx_scope_struct_1___iter__"), /*tp_name*/
  sizeof(struct __pyx_obj_4ctff___pyx_scope_struct_1___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ctff___pyx_scope_struct_1___iter__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_4ctff___pyx_scope_struct_1___iter__, /*tp_traverse*/
  __pyx_tp_clear_4ctff___pyx_scope_struct_1___iter__, /*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_4ctff___pyx_scope_struct_1___iter__, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_4ctff___pyx_scope_struct_3_drive *__pyx_freelist_4ctff___pyx_scope_struct_3_drive[8];
static int __pyx_freecount_4ctff___pyx_scope_struct_3_drive = 0;

static PyObject *__pyx_tp_new_4ctff___pyx_scope_struct_3_drive(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (likely((__pyx_freecount_4ctff___pyx_scope_struct_3_drive > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4ctff___pyx_scope_struct_3_drive)))) {
    o = (PyObject*)__pyx_freelist_4ctff___pyx_scope_struct_3_drive[--__pyx_freecount_4ctff___pyx_scope_struct_3_drive];
    memset(o, 0, sizeof(struct __pyx_obj_4ctff___pyx_scope_struct_3_drive));
    (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_4ctff___pyx_scope_struct_3_drive(PyObject *o) {
  struct __pyx_obj_4ctff___pyx_scope_struct_3_drive *p = (struct __pyx_obj_4ctff___pyx_scope_struct_3_drive *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if ((__pyx_freecount_4ctff___pyx_scope_struct_3_drive < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4ctff___pyx_scope_struct_3_drive))) {
    __pyx_freelist_4ctff___pyx_scope_struct_3_drive[__pyx_freecount_4ctff___pyx_scope_struct_3_drive++] = ((struct __pyx_obj_4ctff___pyx_scope_struct_3_drive *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_4ctff___pyx_scope_struct_3_drive(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4ctff___pyx_scope_struct_3_drive *p = (struct __pyx_obj_4ctff___pyx_scope_struct_3_drive *)o;
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4ctff___pyx_scope_struct_3_drive(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4ctff___pyx_scope_struct_3_drive *p = (struct __pyx_obj_4ctff___pyx_scope_struct_3_drive *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_4ctff___pyx_scope_struct_3_drive = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("ctff.__pyx_scope_struct_3_drive"), /*tp_name*/
  sizeof(struct __pyx_obj_4ctff___pyx_scope_struct_3_drive), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4ctff___pyx_scope_struct_3_drive, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_4ctff___pyx_scope_struct_3_drive, /*tp_traverse*/
  __pyx_tp_clear_4ctff___pyx_scope_struct_3_drive, /*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_4ctff___pyx_scope_struct_3_drive, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
  #if PY_VERSION_HEX < 0x03020000
    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  #else
    PyModuleDef_HEAD_INIT,
  #endif
    __Pyx_NAMESTR("ctff"),
    0, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_0_2_10, __pyx_k_0_2_10, sizeof(__pyx_k_0_2_10), 0, 0, 1, 0},
  {&__pyx_n_s_BRKINT, __pyx_k_BRKINT, sizeof(__pyx_k_BRKINT), 0, 0, 1, 1},
  {&__pyx_n_s_BUFFER_SIZE, __pyx_k_BUFFER_SIZE, sizeof(__pyx_k_BUFFER_SIZE), 0, 0, 1, 1},
  {&__pyx_n_s_CS8, __pyx_k_CS8, sizeof(__pyx_k_CS8), 0, 0, 1, 1},
  {&__pyx_n_s_CSIZE, __pyx_k_CSIZE, sizeof(__pyx_k_CSIZE), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultHandler, __pyx_k_DefaultHandler, sizeof(__pyx_k_DefaultHandler), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultHandler___init, __pyx_k_DefaultHandler___init, sizeof(__pyx_k_DefaultHandler___init), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultHandler_handle_char, __pyx_k_DefaultHandler_handle_char, sizeof(__pyx_k_DefaultHandler_handle_char), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultHandler_handle_control_st, __pyx_k_DefaultHandler_handle_control_st, sizeof(__pyx_k_DefaultHandler_handle_control_st), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultHandler_handle_csi, __pyx_k_DefaultHandler_handle_csi, sizeof(__pyx_k_DefaultHandler_handle_csi), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultHandler_handle_draw, __pyx_k_DefaultHandler_handle_draw, sizeof(__pyx_k_DefaultHandler_handle_draw), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultHandler_handle_end, __pyx_k_DefaultHandler_handle_end, sizeof(__pyx_k_DefaultHandler_handle_end), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultHandler_handle_esc, __pyx_k_DefaultHandler_handle_esc, sizeof(__pyx_k_DefaultHandler_handle_esc), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultHandler_handle_invalid, __pyx_k_DefaultHandler_handle_invalid, sizeof(__pyx_k_DefaultHandler_handle_invalid), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultHandler_handle_resize, __pyx_k_DefaultHandler_handle_resize, sizeof(__pyx_k_DefaultHandler_handle_resize), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultHandler_handle_ss2, __pyx_k_DefaultHandler_handle_ss2, sizeof(__pyx_k_DefaultHandler_handle_ss2), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultHandler_handle_ss3, __pyx_k_DefaultHandler_handle_ss3, sizeof(__pyx_k_DefaultHandler_handle_ss3), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultHandler_handle_start, __pyx_k_DefaultHandler_handle_start, sizeof(__pyx_k_DefaultHandler_handle_start), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultPTY, __pyx_k_DefaultPTY, sizeof(__pyx_k_DefaultPTY), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultPTY___init, __pyx_k_DefaultPTY___init, sizeof(__pyx_k_DefaultPTY___init), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultPTY___resize_impl, __pyx_k_DefaultPTY___resize_impl, sizeof(__pyx_k_DefaultPTY___resize_impl), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultPTY___setupterm, __pyx_k_DefaultPTY___setupterm, sizeof(__pyx_k_DefaultPTY___setupterm), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultPTY__resize_impl, __pyx_k_DefaultPTY__resize_impl, sizeof(__pyx_k_DefaultPTY__resize_impl), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultPTY__setupterm, __pyx_k_DefaultPTY__setupterm, sizeof(__pyx_k_DefaultPTY__setupterm), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultPTY_close, __pyx_k_DefaultPTY_close, sizeof(__pyx_k_DefaultPTY_close), 0, 0, 1, 1},
  {&__pyx_kp_s_DefaultPTY_close_master_d, __pyx_k_DefaultPTY_close_master_d, sizeof(__pyx_k_DefaultPTY_close_master_d), 0, 0, 1, 0},
  {&__pyx_n_s_DefaultPTY_fileno, __pyx_k_DefaultPTY_fileno, sizeof(__pyx_k_DefaultPTY_fileno), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultPTY_fitsize, __pyx_k_DefaultPTY_fitsize, sizeof(__pyx_k_DefaultPTY_fitsize), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultPTY_flush, __pyx_k_DefaultPTY_flush, sizeof(__pyx_k_DefaultPTY_flush), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultPTY_read, __pyx_k_DefaultPTY_read, sizeof(__pyx_k_DefaultPTY_read), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultPTY_resize, __pyx_k_DefaultPTY_resize, sizeof(__pyx_k_DefaultPTY_resize), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultPTY_restore_term, __pyx_k_DefaultPTY_restore_term, sizeof(__pyx_k_DefaultPTY_restore_term), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultPTY_stdin_fileno, __pyx_k_DefaultPTY_stdin_fileno, sizeof(__pyx_k_DefaultPTY_stdin_fileno), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultPTY_write, __pyx_k_DefaultPTY_write, sizeof(__pyx_k_DefaultPTY_write), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultPTY_xoff, __pyx_k_DefaultPTY_xoff, sizeof(__pyx_k_DefaultPTY_xoff), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultPTY_xon, __pyx_k_DefaultPTY_xon, sizeof(__pyx_k_DefaultPTY_xon), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultParser, __pyx_k_DefaultParser, sizeof(__pyx_k_DefaultParser), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultParser___init, __pyx_k_DefaultParser___init, sizeof(__pyx_k_DefaultParser___init), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultParser__context, __pyx_k_DefaultParser__context, sizeof(__pyx_k_DefaultParser__context), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultParser__ibytes, __pyx_k_DefaultParser__ibytes, sizeof(__pyx_k_DefaultParser__ibytes), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultParser__pbytes, __pyx_k_DefaultParser__pbytes, sizeof(__pyx_k_DefaultParser__pbytes), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultParser__state, __pyx_k_DefaultParser__state, sizeof(__pyx_k_DefaultParser__state), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultParser_flush, __pyx_k_DefaultParser_flush, sizeof(__pyx_k_DefaultParser_flush), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultParser_init, __pyx_k_DefaultParser_init, sizeof(__pyx_k_DefaultParser_init), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultParser_parse, __pyx_k_DefaultParser_parse, sizeof(__pyx_k_DefaultParser_parse), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultParser_reset, __pyx_k_DefaultParser_reset, sizeof(__pyx_k_DefaultParser_reset), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultParser_state_is_esc, __pyx_k_DefaultParser_state_is_esc, sizeof(__pyx_k_DefaultParser_state_is_esc), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultScanner, __pyx_k_DefaultScanner, sizeof(__pyx_k_DefaultScanner), 0, 0, 1, 1},
  {&__pyx_n_s_DefaultScanner___init, __pyx_k_DefaultScanner___init, sizeof(__pyx_k_DefaultScanner___init), 0, 0, 1, 1},
  {&__pyx_kp_u_DefaultScanner___init___line_601, __pyx_k_DefaultScanner___init___line_601, sizeof(__pyx_k_DefaultScanner___init___line_601), 0, 1, 0, 0},
  {&__pyx_n_s_DefaultScanner___iter, __pyx_k_DefaultScanner___iter, sizeof(__pyx_k_DefaultScanner___iter), 0, 0, 1, 1},
  {&__pyx_kp_u_DefaultScanner___iter___line_638, __pyx_k_DefaultScanner___iter___line_638, sizeof(__pyx_k_DefaultScanner___iter___line_638), 0, 1, 0, 0},
  {&__pyx_n_s_DefaultScanner_assign, __pyx_k_DefaultScanner_assign, sizeof(__pyx_k_DefaultScanner_assign), 0, 0, 1, 1},
  {&__pyx_kp_u_DefaultScanner_assign_line_617, __pyx_k_DefaultScanner_assign_line_617, sizeof(__pyx_k_DefaultScanner_assign_line_617), 0, 1, 0, 0},
  {&__pyx_n_s_DefaultScanner_continuous_assign, __pyx_k_DefaultScanner_continuous_assign, sizeof(__pyx_k_DefaultScanner_continuous_assign), 0, 0, 1, 1},
  {&__pyx_kp_u_DefaultScanner_continuous_assign_2, __pyx_k_DefaultScanner_continuous_assign_2, sizeof(__pyx_k_DefaultScanner_continuous_assign_2), 0, 1, 0, 0},
  {&__pyx_kp_s_Dispatch_interface_of_terminal, __pyx_k_Dispatch_interface_of_terminal, sizeof(__pyx_k_Dispatch_interface_of_terminal), 0, 0, 1, 0},
  {&__pyx_n_s_EBADF, __pyx_k_EBADF, sizeof(__pyx_k_EBADF), 0, 0, 1, 1},
  {&__pyx_n_s_ECHO, __pyx_k_ECHO, sizeof(__pyx_k_ECHO), 0, 0, 1, 1},
  {&__pyx_n_s_ECHONL, __pyx_k_ECHONL, sizeof(__pyx_k_ECHONL), 0, 0, 1, 1},
  {&__pyx_n_s_EINTR, __pyx_k_EINTR, sizeof(__pyx_k_EINTR), 0, 0, 1, 1},
  {&__pyx_n_s_EIO, __pyx_k_EIO, sizeof(__pyx_k_EIO), 0, 0, 1, 1},
  {&__pyx_n_s_ESC_TIMEOUT, __pyx_k_ESC_TIMEOUT, sizeof(__pyx_k_ESC_TIMEOUT), 0, 0, 1, 1},
  {&__pyx_n_s_EventDispatcher, __pyx_k_EventDispatcher, sizeof(__pyx_k_EventDispatcher), 0, 0, 1, 1},
  {&__pyx_kp_s_EventDispatcher_dispatch_char, __pyx_k_EventDispatcher_dispatch_char, sizeof(__pyx_k_EventDispatcher_dispatch_char), 0, 0, 1, 0},
  {&__pyx_n_s_EventDispatcher_dispatch_char_2, __pyx_k_EventDispatcher_dispatch_char_2, sizeof(__pyx_k_EventDispatcher_dispatch_char_2), 0, 0, 1, 1},
  {&__pyx_kp_s_EventDispatcher_dispatch_control, __pyx_k_EventDispatcher_dispatch_control, sizeof(__pyx_k_EventDispatcher_dispatch_control), 0, 0, 1, 0},
  {&__pyx_n_s_EventDispatcher_dispatch_control_2, __pyx_k_EventDispatcher_dispatch_control_2, sizeof(__pyx_k_EventDispatcher_dispatch_control_2), 0, 0, 1, 1},
  {&__pyx_kp_s_EventDispatcher_dispatch_csi, __pyx_k_EventDispatcher_dispatch_csi, sizeof(__pyx_k_EventDispatcher_dispatch_csi), 0, 0, 1, 0},
  {&__pyx_n_s_EventDispatcher_dispatch_csi_2, __pyx_k_EventDispatcher_dispatch_csi_2, sizeof(__pyx_k_EventDispatcher_dispatch_csi_2), 0, 0, 1, 1},
  {&__pyx_kp_s_EventDispatcher_dispatch_esc, __pyx_k_EventDispatcher_dispatch_esc, sizeof(__pyx_k_EventDispatcher_dispatch_esc), 0, 0, 1, 0},
  {&__pyx_n_s_EventDispatcher_dispatch_esc_2, __pyx_k_EventDispatcher_dispatch_esc_2, sizeof(__pyx_k_EventDispatcher_dispatch_esc_2), 0, 0, 1, 1},
  {&__pyx_n_s_EventObserver, __pyx_k_EventObserver, sizeof(__pyx_k_EventObserver), 0, 0, 1, 1},
  {&__pyx_kp_s_EventObserver_handle_char, __pyx_k_EventObserver_handle_char, sizeof(__pyx_k_EventObserver_handle_char), 0, 0, 1, 0},
  {&__pyx_n_s_EventObserver_handle_char_2, __pyx_k_EventObserver_handle_char_2, sizeof(__pyx_k_EventObserver_handle_char_2), 0, 0, 1, 1},
  {&__pyx_kp_s_EventObserver_handle_control_str, __pyx_k_EventObserver_handle_control_str, sizeof(__pyx_k_EventObserver_handle_control_str), 0, 0, 1, 0},
  {&__pyx_n_s_EventObserver_handle_control_str_2, __pyx_k_EventObserver_handle_control_str_2, sizeof(__pyx_k_EventObserver_handle_control_str_2), 0, 0, 1, 1},
  {&__pyx_kp_s_EventObserver_handle_csi, __pyx_k_EventObserver_handle_csi, sizeof(__pyx_k_EventObserver_handle_csi), 0, 0, 1, 0},
  {&__pyx_n_s_EventObserver_handle_csi_2, __pyx_k_EventObserver_handle_csi_2, sizeof(__pyx_k_EventObserver_handle_csi_2), 0, 0, 1, 1},
  {&__pyx_kp_s_EventObserver_handle_draw, __pyx_k_EventObserver_handle_draw, sizeof(__pyx_k_EventObserver_handle_draw), 0, 0, 1, 0},
  {&__pyx_n_s_EventObserver_handle_draw_2, __pyx_k_EventObserver_handle_draw_2, sizeof(__pyx_k_EventObserver_handle_draw_2), 0, 0, 1, 1},
  {&__pyx_kp_s_EventObserver_handle_end, __pyx_k_EventObserver_handle_end, sizeof(__pyx_k_EventObserver_handle_end), 0, 0, 1, 0},
  {&__pyx_n_s_EventObserver_handle_end_2, __pyx_k_EventObserver_handle_end_2, sizeof(__pyx_k_EventObserver_handle_end_2), 0, 0, 1, 1},
  {&__pyx_kp_s_EventObserver_handle_esc, __pyx_k_EventObserver_handle_esc, sizeof(__pyx_k_EventObserver_handle_esc), 0, 0, 1, 0},
  {&__pyx_n_s_EventObserver_handle_esc_2, __pyx_k_EventObserver_handle_esc_2, sizeof(__pyx_k_EventObserver_handle_esc_2), 0, 0, 1, 1},
  {&__pyx_kp_s_EventObserver_handle_invalid, __pyx_k_EventObserver_handle_invalid, sizeof(__pyx_k_EventObserver_handle_invalid), 0, 0, 1, 0},
  {&__pyx_n_s_EventObserver_handle_invalid_2, __pyx_k_EventObserver_handle_invalid_2, sizeof(__pyx_k_EventObserver_handle_invalid_2), 0, 0, 1, 1},
  {&__pyx_kp_s_EventObserver_handle_resize, __pyx_k_EventObserver_handle_resize, sizeof(__pyx_k_EventObserver_handle_resize), 0, 0, 1, 0},
  {&__pyx_n_s_EventObserver_handle_resize_2, __pyx_k_EventObserver_handle_resize_2, sizeof(__pyx_k_EventObserver_handle_resize_2), 0, 0, 1, 1},
  {&__pyx_kp_s_EventObserver_handle_ss2, __pyx_k_EventObserver_handle_ss2, sizeof(__pyx_k_EventObserver_handle_ss2), 0, 0, 1, 0},
  {&__pyx_n_s_EventObserver_handle_ss2_2, __pyx_k_EventObserver_handle_ss2_2, sizeof(__pyx_k_EventObserver_handle_ss2_2), 0, 0, 1, 1},
  {&__pyx_kp_s_EventObserver_handle_ss3, __pyx_k_EventObserver_handle_ss3, sizeof(__pyx_k_EventObserver_handle_ss3), 0, 0, 1, 0},
  {&__pyx_n_s_EventObserver_handle_ss3_2, __pyx_k_EventObserver_handle_ss3_2, sizeof(__pyx_k_EventObserver_handle_ss3_2), 0, 0, 1, 1},
  {&__pyx_kp_s_EventObserver_handle_start, __pyx_k_EventObserver_handle_start, sizeof(__pyx_k_EventObserver_handle_start), 0, 0, 1, 0},
  {&__pyx_n_s_EventObserver_handle_start_2, __pyx_k_EventObserver_handle_start_2, sizeof(__pyx_k_EventObserver_handle_start_2), 0, 0, 1, 1},
  {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1},
  {&__pyx_n_s_FilterMultiplexer, __pyx_k_FilterMultiplexer, sizeof(__pyx_k_FilterMultiplexer), 0, 0, 1, 1},
  {&__pyx_n_s_FilterMultiplexer___init, __pyx_k_FilterMultiplexer___init, sizeof(__pyx_k_FilterMultiplexer___init), 0, 0, 1, 1},
  {&__pyx_n_s_FilterMultiplexer__lhs, __pyx_k_FilterMultiplexer__lhs, sizeof(__pyx_k_FilterMultiplexer__lhs), 0, 0, 1, 1},
  {&__pyx_n_s_FilterMultiplexer__rhs, __pyx_k_FilterMultiplexer__rhs, sizeof(__pyx_k_FilterMultiplexer__rhs), 0, 0, 1, 1},
  {&__pyx_n_s_FilterMultiplexer_get_lhs, __pyx_k_FilterMultiplexer_get_lhs, sizeof(__pyx_k_FilterMultiplexer_get_lhs), 0, 0, 1, 1},
  {&__pyx_n_s_FilterMultiplexer_get_rhs, __pyx_k_FilterMultiplexer_get_rhs, sizeof(__pyx_k_FilterMultiplexer_get_rhs), 0, 0, 1, 1},
  {&__pyx_n_s_FilterMultiplexer_handle_char, __pyx_k_FilterMultiplexer_handle_char, sizeof(__pyx_k_FilterMultiplexer_handle_char), 0, 0, 1, 1},
  {&__pyx_n_s_FilterMultiplexer_handle_control, __pyx_k_FilterMultiplexer_handle_control, sizeof(__pyx_k_FilterMultiplexer_handle_control), 0, 0, 1, 1},
  {&__pyx_n_s_FilterMultiplexer_handle_csi, __pyx_k_FilterMultiplexer_handle_csi, sizeof(__pyx_k_FilterMultiplexer_handle_csi), 0, 0, 1, 1},
  {&__pyx_n_s_FilterMultiplexer_handle_draw, __pyx_k_FilterMultiplexer_handle_draw, sizeof(__pyx_k_FilterMultiplexer_handle_draw), 0, 0, 1, 1},
  {&__pyx_n_s_FilterMultiplexer_handle_end, __pyx_k_FilterMultiplexer_handle_end, sizeof(__pyx_k_FilterMultiplexer_handle_end), 0, 0, 1, 1},
  {&__pyx_n_s_FilterMultiplexer_handle_esc, __pyx_k_FilterMultiplexer_handle_esc, sizeof(__pyx_k_FilterMultiplexer_handle_esc), 0, 0, 1, 1},
  {&__pyx_n_s_FilterMultiplexer_handle_flush, __pyx_k_FilterMultiplexer_handle_flush, sizeof(__pyx_k_FilterMultiplexer_handle_flush), 0, 0, 1, 1},
  {&__pyx_n_s_FilterMultiplexer_handle_invalid, __pyx_k_FilterMultiplexer_handle_invalid, sizeof(__pyx_k_FilterMultiplexer_handle_invalid), 0, 0, 1, 1},
  {&__pyx_n_s_FilterMultiplexer_handle_resize, __pyx_k_FilterMultiplexer_handle_resize, sizeof(__pyx_k_FilterMultiplexer_handle_resize), 0, 0, 1, 1},
  {&__pyx_n_s_FilterMultiplexer_handle_ss2, __pyx_k_FilterMultiplexer_handle_ss2, sizeof(__pyx_k_FilterMultiplexer_handle_ss2), 0, 0, 1, 1},
  {&__pyx_n_s_FilterMultiplexer_handle_ss3, __pyx_k_FilterMultiplexer_handle_ss3, sizeof(__pyx_k_FilterMultiplexer_handle_ss3), 0, 0, 1, 1},
  {&__pyx_n_s_FilterMultiplexer_handle_start, __pyx_k_FilterMultiplexer_handle_start, sizeof(__pyx_k_FilterMultiplexer_handle_start), 0, 0, 1, 1},
  {&__pyx_n_s_HHHH, __pyx_k_HHHH, sizeof(__pyx_k_HHHH), 0, 0, 1, 1},
  {&__pyx_kp_s_Hayaki_Saito_user_zuse_jp, __pyx_k_Hayaki_Saito_user_zuse_jp, sizeof(__pyx_k_Hayaki_Saito_user_zuse_jp), 0, 0, 1, 0},
  {&__pyx_n_s_ICANON, __pyx_k_ICANON, sizeof(__pyx_k_ICANON), 0, 0, 1, 1},
  {&__pyx_n_s_ICRNL, __pyx_k_ICRNL, sizeof(__pyx_k_ICRNL), 0, 0, 1, 1},
  {&__pyx_n_s_IEXTEN, __pyx_k_IEXTEN, sizeof(__pyx_k_IEXTEN), 0, 0, 1, 1},
  {&__pyx_n_s_IGNBRK, __pyx_k_IGNBRK, sizeof(__pyx_k_IGNBRK), 0, 0, 1, 1},
  {&__pyx_n_s_IGNCR, __pyx_k_IGNCR, sizeof(__pyx_k_IGNCR), 0, 0, 1, 1},
  {&__pyx_n_s_INLCR, __pyx_k_INLCR, sizeof(__pyx_k_INLCR), 0, 0, 1, 1},
  {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1},
  {&__pyx_n_s_ISIG, __pyx_k_ISIG, sizeof(__pyx_k_ISIG), 0, 0, 1, 1},
  {&__pyx_n_s_ISTRIP, __pyx_k_ISTRIP, sizeof(__pyx_k_ISTRIP), 0, 0, 1, 1},
  {&__pyx_n_s_IXON, __pyx_k_IXON, sizeof(__pyx_k_IXON), 0, 0, 1, 1},
  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
  {&__pyx_n_s_LANG, __pyx_k_LANG, sizeof(__pyx_k_LANG), 0, 0, 1, 1},
  {&__pyx_n_s_MIT, __pyx_k_MIT, sizeof(__pyx_k_MIT), 0, 0, 1, 1},
  {&__pyx_n_s_MockContext, __pyx_k_MockContext, sizeof(__pyx_k_MockContext), 0, 0, 1, 1},
  {&__pyx_n_s_MockHandler, __pyx_k_MockHandler, sizeof(__pyx_k_MockHandler), 0, 0, 1, 1},
  {&__pyx_n_s_MockHandler_handle_char, __pyx_k_MockHandler_handle_char, sizeof(__pyx_k_MockHandler_handle_char), 0, 0, 1, 1},
  {&__pyx_n_s_MockHandler_handle_control_stri, __pyx_k_MockHandler_handle_control_stri, sizeof(__pyx_k_MockHandler_handle_control_stri), 0, 0, 1, 1},
  {&__pyx_n_s_MockHandler_handle_csi, __pyx_k_MockHandler_handle_csi, sizeof(__pyx_k_MockHandler_handle_csi), 0, 0, 1, 1},
  {&__pyx_n_s_MockHandler_handle_esc, __pyx_k_MockHandler_handle_esc, sizeof(__pyx_k_MockHandler_handle_esc), 0, 0, 1, 1},
  {&__pyx_n_s_MockParseContext, __pyx_k_MockParseContext, sizeof(__pyx_k_MockParseContext), 0, 0, 1, 1},
  {&__pyx_n_s_MockParseContext___init, __pyx_k_MockParseContext___init, sizeof(__pyx_k_MockParseContext___init), 0, 0, 1, 1},
  {&__pyx_n_s_NotHandledException, __pyx_k_NotHandledException, sizeof(__pyx_k_NotHandledException), 0, 0, 1, 1},
  {&__pyx_n_s_NotHandledException___init, __pyx_k_NotHandledException___init, sizeof(__pyx_k_NotHandledException___init), 0, 0, 1, 1},
  {&__pyx_kp_u_NotHandledException___init___lin, __pyx_k_NotHandledException___init___lin, sizeof(__pyx_k_NotHandledException___init___lin), 0, 1, 0, 0},
  {&__pyx_n_s_NotHandledException___str, __pyx_k_NotHandledException___str, sizeof(__pyx_k_NotHandledException___str), 0, 0, 1, 1},
  {&__pyx_kp_u_NotHandledException___str___line, __pyx_k_NotHandledException___str___line, sizeof(__pyx_k_NotHandledException___str___line), 0, 1, 0, 0},
  {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
  {&__pyx_n_s_ONLCR, __pyx_k_ONLCR, sizeof(__pyx_k_ONLCR), 0, 0, 1, 1},
  {&__pyx_n_s_OPOST, __pyx_k_OPOST, sizeof(__pyx_k_OPOST), 0, 0, 1, 1},
  {&__pyx_n_s_OSError, __pyx_k_OSError, sizeof(__pyx_k_OSError), 0, 0, 1, 1},
  {&__pyx_n_s_OutputStream, __pyx_k_OutputStream, sizeof(__pyx_k_OutputStream), 0, 0, 1, 1},
  {&__pyx_kp_s_OutputStream_flush, __pyx_k_OutputStream_flush, sizeof(__pyx_k_OutputStream_flush), 0, 0, 1, 0},
  {&__pyx_n_s_OutputStream_flush_2, __pyx_k_OutputStream_flush_2, sizeof(__pyx_k_OutputStream_flush_2), 0, 0, 1, 1},
  {&__pyx_kp_s_OutputStream_write, __pyx_k_OutputStream_write, sizeof(__pyx_k_OutputStream_write), 0, 0, 1, 0},
  {&__pyx_n_s_OutputStream_write_2, __pyx_k_OutputStream_write_2, sizeof(__pyx_k_OutputStream_write_2), 0, 0, 1, 1},
  {&__pyx_n_s_PARENB, __pyx_k_PARENB, sizeof(__pyx_k_PARENB), 0, 0, 1, 1},
  {&__pyx_n_s_PARMRK, __pyx_k_PARMRK, sizeof(__pyx_k_PARMRK), 0, 0, 1, 1},
  {&__pyx_n_s_PC_VDISABLE, __pyx_k_PC_VDISABLE, sizeof(__pyx_k_PC_VDISABLE), 0, 0, 1, 1},
  {&__pyx_n_s_PTY, __pyx_k_PTY, sizeof(__pyx_k_PTY), 0, 0, 1, 1},
  {&__pyx_kp_s_PTY_drive, __pyx_k_PTY_drive, sizeof(__pyx_k_PTY_drive), 0, 0, 1, 0},
  {&__pyx_n_s_PTY_drive_2, __pyx_k_PTY_drive_2, sizeof(__pyx_k_PTY_drive_2), 0, 0, 1, 1},
  {&__pyx_kp_s_PTY_fitsize, __pyx_k_PTY_fitsize, sizeof(__pyx_k_PTY_fitsize), 0, 0, 1, 0},
  {&__pyx_n_s_PTY_fitsize_2, __pyx_k_PTY_fitsize_2, sizeof(__pyx_k_PTY_fitsize_2), 0, 0, 1, 1},
  {&__pyx_kp_s_PTY_read, __pyx_k_PTY_read, sizeof(__pyx_k_PTY_read), 0, 0, 1, 0},
  {&__pyx_n_s_PTY_read_2, __pyx_k_PTY_read_2, sizeof(__pyx_k_PTY_read_2), 0, 0, 1, 1},
  {&__pyx_kp_s_PTY_resize, __pyx_k_PTY_resize, sizeof(__pyx_k_PTY_resize), 0, 0, 1, 0},
  {&__pyx_n_s_PTY_resize_2, __pyx_k_PTY_resize_2, sizeof(__pyx_k_PTY_resize_2), 0, 0, 1, 1},
  {&__pyx_kp_s_PTY_write, __pyx_k_PTY_write, sizeof(__pyx_k_PTY_write), 0, 0, 1, 0},
  {&__pyx_n_s_PTY_write_2, __pyx_k_PTY_write_2, sizeof(__pyx_k_PTY_write_2), 0, 0, 1, 1},
  {&__pyx_kp_s_PTY_xoff, __pyx_k_PTY_xoff, sizeof(__pyx_k_PTY_xoff), 0, 0, 1, 0},
  {&__pyx_n_s_PTY_xoff_2, __pyx_k_PTY_xoff_2, sizeof(__pyx_k_PTY_xoff_2), 0, 0, 1, 1},
  {&__pyx_kp_s_PTY_xon, __pyx_k_PTY_xon, sizeof(__pyx_k_PTY_xon), 0, 0, 1, 0},
  {&__pyx_n_s_PTY_xon_2, __pyx_k_PTY_xon_2, sizeof(__pyx_k_PTY_xon_2), 0, 0, 1, 1},
  {&__pyx_n_s_ParseContext, __pyx_k_ParseContext, sizeof(__pyx_k_ParseContext), 0, 0, 1, 1},
  {&__pyx_n_s_ParseContext___init, __pyx_k_ParseContext___init, sizeof(__pyx_k_ParseContext___init), 0, 0, 1, 1},
  {&__pyx_n_s_ParseContext___iter, __pyx_k_ParseContext___iter, sizeof(__pyx_k_ParseContext___iter), 0, 0, 1, 1},
  {&__pyx_n_s_ParseContext__handler, __pyx_k_ParseContext__handler, sizeof(__pyx_k_ParseContext__handler), 0, 0, 1, 1},
  {&__pyx_n_s_ParseContext__scanner, __pyx_k_ParseContext__scanner, sizeof(__pyx_k_ParseContext__scanner), 0, 0, 1, 1},
  {&__pyx_n_s_ParseContext__termenc, __pyx_k_ParseContext__termenc, sizeof(__pyx_k_ParseContext__termenc), 0, 0, 1, 1},
  {&__pyx_n_s_ParseContext_assign, __pyx_k_ParseContext_assign, sizeof(__pyx_k_ParseContext_assign), 0, 0, 1, 1},
  {&__pyx_n_s_ParseContext_dispatch_char, __pyx_k_ParseContext_dispatch_char, sizeof(__pyx_k_ParseContext_dispatch_char), 0, 0, 1, 1},
  {&__pyx_n_s_ParseContext_dispatch_control_st, __pyx_k_ParseContext_dispatch_control_st, sizeof(__pyx_k_ParseContext_dispatch_control_st), 0, 0, 1, 1},
  {&__pyx_n_s_ParseContext_dispatch_csi, __pyx_k_ParseContext_dispatch_csi, sizeof(__pyx_k_ParseContext_dispatch_csi), 0, 0, 1, 1},
  {&__pyx_n_s_ParseContext_dispatch_esc, __pyx_k_ParseContext_dispatch_esc, sizeof(__pyx_k_ParseContext_dispatch_esc), 0, 0, 1, 1},
  {&__pyx_n_s_ParseContext_dispatch_invalid, __pyx_k_ParseContext_dispatch_invalid, sizeof(__pyx_k_ParseContext_dispatch_invalid), 0, 0, 1, 1},
  {&__pyx_n_s_ParseContext_dispatch_ss2, __pyx_k_ParseContext_dispatch_ss2, sizeof(__pyx_k_ParseContext_dispatch_ss2), 0, 0, 1, 1},
  {&__pyx_n_s_ParseContext_dispatch_ss3, __pyx_k_ParseContext_dispatch_ss3, sizeof(__pyx_k_ParseContext_dispatch_ss3), 0, 0, 1, 1},
  {&__pyx_n_s_ParseContext_flush, __pyx_k_ParseContext_flush, sizeof(__pyx_k_ParseContext_flush), 0, 0, 1, 1},
  {&__pyx_n_s_ParseContext_put, __pyx_k_ParseContext_put, sizeof(__pyx_k_ParseContext_put), 0, 0, 1, 1},
  {&__pyx_n_s_ParseContext_puts, __pyx_k_ParseContext_puts, sizeof(__pyx_k_ParseContext_puts), 0, 0, 1, 1},
  {&__pyx_n_s_ParseContext_putu, __pyx_k_ParseContext_putu, sizeof(__pyx_k_ParseContext_putu), 0, 0, 1, 1},
  {&__pyx_n_s_ParseContext_sethandler, __pyx_k_ParseContext_sethandler, sizeof(__pyx_k_ParseContext_sethandler), 0, 0, 1, 1},
  {&__pyx_n_s_ParseContext_write, __pyx_k_ParseContext_write, sizeof(__pyx_k_ParseContext_write), 0, 0, 1, 1},
  {&__pyx_n_s_ParseContext_writestring, __pyx_k_ParseContext_writestring, sizeof(__pyx_k_ParseContext_writestring), 0, 0, 1, 1},
  {&__pyx_n_s_ParseException, __pyx_k_ParseException, sizeof(__pyx_k_ParseException), 0, 0, 1, 1},
  {&__pyx_n_s_ParseException___init, __pyx_k_ParseException___init, sizeof(__pyx_k_ParseException___init), 0, 0, 1, 1},
  {&__pyx_kp_u_ParseException___init___line_77, __pyx_k_ParseException___init___line_77, sizeof(__pyx_k_ParseException___init___line_77), 0, 1, 0, 0},
  {&__pyx_n_s_ParseException___str, __pyx_k_ParseException___str, sizeof(__pyx_k_ParseException___str), 0, 0, 1, 1},
  {&__pyx_kp_u_ParseException___str___line_85, __pyx_k_ParseException___str___line_85, sizeof(__pyx_k_ParseException___str___line_85), 0, 1, 0, 0},
  {&__pyx_n_s_Parser, __pyx_k_Parser, sizeof(__pyx_k_Parser), 0, 0, 1, 1},
  {&__pyx_kp_s_Parser_parse, __pyx_k_Parser_parse, sizeof(__pyx_k_Parser_parse), 0, 0, 1, 0},
  {&__pyx_n_s_Parser_parse_2, __pyx_k_Parser_parse_2, sizeof(__pyx_k_Parser_parse_2), 0, 0, 1, 1},
  {&__pyx_n_s_Process, __pyx_k_Process, sizeof(__pyx_k_Process), 0, 0, 1, 1},
  {&__pyx_n_s_Process___init, __pyx_k_Process___init, sizeof(__pyx_k_Process___init), 0, 0, 1, 1},
  {&__pyx_n_s_Process_close, __pyx_k_Process_close, sizeof(__pyx_k_Process_close), 0, 0, 1, 1},
  {&__pyx_n_s_Process_drain, __pyx_k_Process_drain, sizeof(__pyx_k_Process_drain), 0, 0, 1, 1},
  {&__pyx_n_s_Process_end, __pyx_k_Process_end, sizeof(__pyx_k_Process_end), 0, 0, 1, 1},
  {&__pyx_n_s_Process_fileno, __pyx_k_Process_fileno, sizeof(__pyx_k_Process_fileno), 0, 0, 1, 1},
  {&__pyx_n_s_Process_fitsize, __pyx_k_Process_fitsize, sizeof(__pyx_k_Process_fitsize), 0, 0, 1, 1},
  {&__pyx_n_s_Process_getpid, __pyx_k_Process_getpid, sizeof(__pyx_k_Process_getpid), 0, 0, 1, 1},
  {&__pyx_n_s_Process_is_alive, __pyx_k_Process_is_alive, sizeof(__pyx_k_Process_is_alive), 0, 0, 1, 1},
  {&__pyx_n_s_Process_on_read, __pyx_k_Process_on_read, sizeof(__pyx_k_Process_on_read), 0, 0, 1, 1},
  {&__pyx_n_s_Process_on_write, __pyx_k_Process_on_write, sizeof(__pyx_k_Process_on_write), 0, 0, 1, 1},
  {&__pyx_n_s_Process_process_end, __pyx_k_Process_process_end, sizeof(__pyx_k_Process_process_end), 0, 0, 1, 1},
  {&__pyx_n_s_Process_process_input, __pyx_k_Process_process_input, sizeof(__pyx_k_Process_process_input), 0, 0, 1, 1},
  {&__pyx_n_s_Process_process_input_locals_dis, __pyx_k_Process_process_input_locals_dis, sizeof(__pyx_k_Process_process_input_locals_dis), 0, 0, 1, 1},
  {&__pyx_n_s_Process_process_output, __pyx_k_Process_process_output, sizeof(__pyx_k_Process_process_output), 0, 0, 1, 1},
  {&__pyx_n_s_Process_process_resize, __pyx_k_Process_process_resize, sizeof(__pyx_k_Process_process_resize), 0, 0, 1, 1},
  {&__pyx_n_s_Process_process_start, __pyx_k_Process_process_start, sizeof(__pyx_k_Process_process_start), 0, 0, 1, 1},
  {&__pyx_n_s_Process_read, __pyx_k_Process_read, sizeof(__pyx_k_Process_read), 0, 0, 1, 1},
  {&__pyx_n_s_Process_resize, __pyx_k_Process_resize, sizeof(__pyx_k_Process_resize), 0, 0, 1, 1},
  {&__pyx_n_s_Process_start, __pyx_k_Process_start, sizeof(__pyx_k_Process_start), 0, 0, 1, 1},
  {&__pyx_n_s_Process_stdin_fileno, __pyx_k_Process_stdin_fileno, sizeof(__pyx_k_Process_stdin_fileno), 0, 0, 1, 1},
  {&__pyx_n_s_Process_write, __pyx_k_Process_write, sizeof(__pyx_k_Process_write), 0, 0, 1, 1},
  {&__pyx_n_s_SIGCHLD, __pyx_k_SIGCHLD, sizeof(__pyx_k_SIGCHLD), 0, 0, 1, 1},
  {&__pyx_n_s_SIGWINCH, __pyx_k_SIGWINCH, sizeof(__pyx_k_SIGWINCH), 0, 0, 1, 1},
  {&__pyx_n_s_STATE_CSI_INTERMEDIATE, __pyx_k_STATE_CSI_INTERMEDIATE, sizeof(__pyx_k_STATE_CSI_INTERMEDIATE), 0, 0, 1, 1},
  {&__pyx_n_s_STATE_CSI_PARAMETER, __pyx_k_STATE_CSI_PARAMETER, sizeof(__pyx_k_STATE_CSI_PARAMETER), 0, 0, 1, 1},
  {&__pyx_n_s_STATE_ESC, __pyx_k_STATE_ESC, sizeof(__pyx_k_STATE_ESC), 0, 0, 1, 1},
  {&__pyx_n_s_STATE_ESC_INTERMEDIATE, __pyx_k_STATE_ESC_INTERMEDIATE, sizeof(__pyx_k_STATE_ESC_INTERMEDIATE), 0, 0, 1, 1},
  {&__pyx_n_s_STATE_GROUND, __pyx_k_STATE_GROUND, sizeof(__pyx_k_STATE_GROUND), 0, 0, 1, 1},
  {&__pyx_n_s_STATE_OSC, __pyx_k_STATE_OSC, sizeof(__pyx_k_STATE_OSC), 0, 0, 1, 1},
  {&__pyx_n_s_STATE_OSC_ESC, __pyx_k_STATE_OSC_ESC, sizeof(__pyx_k_STATE_OSC_ESC), 0, 0, 1, 1},
  {&__pyx_n_s_STATE_SS2, __pyx_k_STATE_SS2, sizeof(__pyx_k_STATE_SS2), 0, 0, 1, 1},
  {&__pyx_n_s_STATE_SS3, __pyx_k_STATE_SS3, sizeof(__pyx_k_STATE_SS3), 0, 0, 1, 1},
  {&__pyx_n_s_STATE_STR, __pyx_k_STATE_STR, sizeof(__pyx_k_STATE_STR), 0, 0, 1, 1},
  {&__pyx_n_s_STATE_STR_ESC, __pyx_k_STATE_STR_ESC, sizeof(__pyx_k_STATE_STR_ESC), 0, 0, 1, 1},
  {&__pyx_n_s_Scanner, __pyx_k_Scanner, sizeof(__pyx_k_Scanner), 0, 0, 1, 1},
  {&__pyx_kp_s_Scanner___iter, __pyx_k_Scanner___iter, sizeof(__pyx_k_Scanner___iter), 0, 0, 1, 0},
  {&__pyx_n_s_Scanner___iter_2, __pyx_k_Scanner___iter_2, sizeof(__pyx_k_Scanner___iter_2), 0, 0, 1, 1},
  {&__pyx_kp_s_Scanner_assign, __pyx_k_Scanner_assign, sizeof(__pyx_k_Scanner_assign), 0, 0, 1, 0},
  {&__pyx_n_s_Scanner_assign_2, __pyx_k_Scanner_assign_2, sizeof(__pyx_k_Scanner_assign_2), 0, 0, 1, 1},
  {&__pyx_kp_s_Scanner_continuous_assign, __pyx_k_Scanner_continuous_assign, sizeof(__pyx_k_Scanner_continuous_assign), 0, 0, 1, 0},
  {&__pyx_n_s_Scanner_continuous_assign_2, __pyx_k_Scanner_continuous_assign_2, sizeof(__pyx_k_Scanner_continuous_assign_2), 0, 0, 1, 1},
  {&__pyx_n_s_Session, __pyx_k_Session, sizeof(__pyx_k_Session), 0, 0, 1, 1},
  {&__pyx_n_s_Session___init, __pyx_k_Session___init, sizeof(__pyx_k_Session___init), 0, 0, 1, 1},
  {&__pyx_n_s_Session__init_process, __pyx_k_Session__init_process, sizeof(__pyx_k_Session__init_process), 0, 0, 1, 1},
  {&__pyx_n_s_Session_add_subtty, __pyx_k_Session_add_subtty, sizeof(__pyx_k_Session_add_subtty), 0, 0, 1, 1},
  {&__pyx_n_s_Session_blur_process, __pyx_k_Session_blur_process, sizeof(__pyx_k_Session_blur_process), 0, 0, 1, 1},
  {&__pyx_n_s_Session_create_process, __pyx_k_Session_create_process, sizeof(__pyx_k_Session_create_process), 0, 0, 1, 1},
  {&__pyx_n_s_Session_destruct_process, __pyx_k_Session_destruct_process, sizeof(__pyx_k_Session_destruct_process), 0, 0, 1, 1},
  {&__pyx_n_s_Session_drive, __pyx_k_Session_drive, sizeof(__pyx_k_Session_drive), 0, 0, 1, 1},
  {&__pyx_n_s_Session_drive_locals_onresize, __pyx_k_Session_drive_locals_onresize, sizeof(__pyx_k_Session_drive_locals_onresize), 0, 0, 1, 1},
  {&__pyx_n_s_Session_focus_process, __pyx_k_Session_focus_process, sizeof(__pyx_k_Session_focus_process), 0, 0, 1, 1},
  {&__pyx_n_s_Session_getactiveprocess, __pyx_k_Session_getactiveprocess, sizeof(__pyx_k_Session_getactiveprocess), 0, 0, 1, 1},
  {&__pyx_n_s_Session_process_is_active, __pyx_k_Session_process_is_active, sizeof(__pyx_k_Session_process_is_active), 0, 0, 1, 1},
  {&__pyx_n_s_Session_start, __pyx_k_Session_start, sizeof(__pyx_k_Session_start), 0, 0, 1, 1},
  {&__pyx_n_s_Session_start_locals_onclose, __pyx_k_Session_start_locals_onclose, sizeof(__pyx_k_Session_start_locals_onclose), 0, 0, 1, 1},
  {&__pyx_n_s_SimpleParser, __pyx_k_SimpleParser, sizeof(__pyx_k_SimpleParser), 0, 0, 1, 1},
  {&__pyx_n_s_SimpleParser__MockContext, __pyx_k_SimpleParser__MockContext, sizeof(__pyx_k_SimpleParser__MockContext), 0, 0, 1, 1},
  {&__pyx_n_s_SimpleParser__MockContext___init, __pyx_k_SimpleParser__MockContext___init, sizeof(__pyx_k_SimpleParser__MockContext___init), 0, 0, 1, 1},
  {&__pyx_n_s_SimpleParser__MockContext___iter, __pyx_k_SimpleParser__MockContext___iter, sizeof(__pyx_k_SimpleParser__MockContext___iter), 0, 0, 1, 1},
  {&__pyx_n_s_SimpleParser__MockContext_dispat, __pyx_k_SimpleParser__MockContext_dispat, sizeof(__pyx_k_SimpleParser__MockContext_dispat), 0, 0, 1, 1},
  {&__pyx_n_s_SimpleParser_parse, __pyx_k_SimpleParser_parse, sizeof(__pyx_k_SimpleParser_parse), 0, 0, 1, 1},
  {&__pyx_kp_u_SimpleParser_parse_line_239, __pyx_k_SimpleParser_parse_line_239, sizeof(__pyx_k_SimpleParser_parse_line_239), 0, 1, 0, 0},
  {&__pyx_n_s_StringIO, __pyx_k_StringIO, sizeof(__pyx_k_StringIO), 0, 0, 1, 1},
  {&__pyx_kp_s_Switching_focus_fileno_d, __pyx_k_Switching_focus_fileno_d, sizeof(__pyx_k_Switching_focus_fileno_d), 0, 0, 1, 0},
  {&__pyx_kp_s_Switching_focus_fileno_d_main_pr, __pyx_k_Switching_focus_fileno_d_main_pr, sizeof(__pyx_k_Switching_focus_fileno_d_main_pr), 0, 0, 1, 0},
  {&__pyx_n_s_TCOOFF, __pyx_k_TCOOFF, sizeof(__pyx_k_TCOOFF), 0, 0, 1, 1},
  {&__pyx_n_s_TCOON, __pyx_k_TCOON, sizeof(__pyx_k_TCOON), 0, 0, 1, 1},
  {&__pyx_n_s_TCSANOW, __pyx_k_TCSANOW, sizeof(__pyx_k_TCSANOW), 0, 0, 1, 1},
  {&__pyx_n_s_TERM, __pyx_k_TERM, sizeof(__pyx_k_TERM), 0, 0, 1, 1},
  {&__pyx_n_s_TIOCGWINSZ, __pyx_k_TIOCGWINSZ, sizeof(__pyx_k_TIOCGWINSZ), 0, 0, 1, 1},
  {&__pyx_n_s_TIOCSWINSZ, __pyx_k_TIOCSWINSZ, sizeof(__pyx_k_TIOCSWINSZ), 0, 0, 1, 1},
  {&__pyx_n_s_Timer, __pyx_k_Timer, sizeof(__pyx_k_Timer), 0, 0, 1, 1},
  {&__pyx_kp_s_UTF_8, __pyx_k_UTF_8, sizeof(__pyx_k_UTF_8), 0, 0, 1, 0},
  {&__pyx_n_s_VDSUSP, __pyx_k_VDSUSP, sizeof(__pyx_k_VDSUSP), 0, 0, 1, 1},
  {&__pyx_n_s_VEOF, __pyx_k_VEOF, sizeof(__pyx_k_VEOF), 0, 0, 1, 1},
  {&__pyx_n_s_VINTR, __pyx_k_VINTR, sizeof(__pyx_k_VINTR), 0, 0, 1, 1},
  {&__pyx_n_s_VKILL, __pyx_k_VKILL, sizeof(__pyx_k_VKILL), 0, 0, 1, 1},
  {&__pyx_n_s_VLNEXT, __pyx_k_VLNEXT, sizeof(__pyx_k_VLNEXT), 0, 0, 1, 1},
  {&__pyx_n_s_VQUIT, __pyx_k_VQUIT, sizeof(__pyx_k_VQUIT), 0, 0, 1, 1},
  {&__pyx_n_s_VREPRINT, __pyx_k_VREPRINT, sizeof(__pyx_k_VREPRINT), 0, 0, 1, 1},
  {&__pyx_n_s_VSTART, __pyx_k_VSTART, sizeof(__pyx_k_VSTART), 0, 0, 1, 1},
  {&__pyx_n_s_VSTOP, __pyx_k_VSTOP, sizeof(__pyx_k_VSTOP), 0, 0, 1, 1},
  {&__pyx_n_s_VSUSP, __pyx_k_VSUSP, sizeof(__pyx_k_VSUSP), 0, 0, 1, 1},
  {&__pyx_n_s_VWERASE, __pyx_k_VWERASE, sizeof(__pyx_k_VWERASE), 0, 0, 1, 1},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_n_s__336, __pyx_k__336, sizeof(__pyx_k__336), 0, 0, 1, 1},
  {&__pyx_n_s__337, __pyx_k__337, sizeof(__pyx_k__337), 0, 0, 1, 1},
  {&__pyx_kp_s__43, __pyx_k__43, sizeof(__pyx_k__43), 0, 0, 1, 0},
  {&__pyx_kp_s_abstruct_PTY_device, __pyx_k_abstruct_PTY_device, sizeof(__pyx_k_abstruct_PTY_device), 0, 0, 1, 0},
  {&__pyx_kp_s_abstruct_Parser, __pyx_k_abstruct_Parser, sizeof(__pyx_k_abstruct_Parser), 0, 0, 1, 0},
  {&__pyx_kp_s_abstruct_TTY_output_stream, __pyx_k_abstruct_TTY_output_stream, sizeof(__pyx_k_abstruct_TTY_output_stream), 0, 0, 1, 0},
  {&__pyx_kp_s_adapt_to_event_driven_ECMA_35_4, __pyx_k_adapt_to_event_driven_ECMA_35_4, sizeof(__pyx_k_adapt_to_event_driven_ECMA_35_4), 0, 0, 1, 0},
  {&__pyx_n_s_add_subtty, __pyx_k_add_subtty, sizeof(__pyx_k_add_subtty), 0, 0, 1, 1},
  {&__pyx_n_s_alive, __pyx_k_alive, sizeof(__pyx_k_alive), 0, 0, 1, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
  {&__pyx_n_s_argspec, __pyx_k_argspec, sizeof(__pyx_k_argspec), 0, 0, 1, 1},
  {&__pyx_n_s_assign, __pyx_k_assign, sizeof(__pyx_k_assign), 0, 0, 1, 1},
  {&__pyx_n_s_author, __pyx_k_author, sizeof(__pyx_k_author), 0, 0, 1, 1},
  {&__pyx_n_s_b87c36758a4c3d666c74490b383f483b, __pyx_k_b87c36758a4c3d666c74490b383f483b, sizeof(__pyx_k_b87c36758a4c3d666c74490b383f483b), 0, 0, 1, 1},
  {&__pyx_n_s_backup, __pyx_k_backup, sizeof(__pyx_k_backup), 0, 0, 1, 1},
  {&__pyx_n_s_backup_termios, __pyx_k_backup_termios, sizeof(__pyx_k_backup_termios), 0, 0, 1, 1},
  {&__pyx_kp_s_bin_sh, __pyx_k_bin_sh, sizeof(__pyx_k_bin_sh), 0, 0, 1, 0},
  {&__pyx_n_s_blur_process, __pyx_k_blur_process, sizeof(__pyx_k_blur_process), 0, 0, 1, 1},
  {&__pyx_n_s_buffering, __pyx_k_buffering, sizeof(__pyx_k_buffering), 0, 0, 1, 1},
  {&__pyx_n_s_buffering_2, __pyx_k_buffering_2, sizeof(__pyx_k_buffering_2), 0, 0, 1, 1},
  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
  {&__pyx_n_s_c1, __pyx_k_c1, sizeof(__pyx_k_c1), 0, 0, 1, 1},
  {&__pyx_n_s_c1_2, __pyx_k_c1_2, sizeof(__pyx_k_c1_2), 0, 0, 1, 1},
  {&__pyx_n_s_c2, __pyx_k_c2, sizeof(__pyx_k_c2), 0, 0, 1, 1},
  {&__pyx_n_s_cStringIO, __pyx_k_cStringIO, sizeof(__pyx_k_cStringIO), 0, 0, 1, 1},
  {&__pyx_kp_s_c_2, __pyx_k_c_2, sizeof(__pyx_k_c_2), 0, 0, 1, 0},
  {&__pyx_n_s_c_cc, __pyx_k_c_cc, sizeof(__pyx_k_c_cc), 0, 0, 1, 1},
  {&__pyx_n_s_c_cflag, __pyx_k_c_cflag, sizeof(__pyx_k_c_cflag), 0, 0, 1, 1},
  {&__pyx_n_s_c_lflag, __pyx_k_c_lflag, sizeof(__pyx_k_c_lflag), 0, 0, 1, 1},
  {&__pyx_n_s_cancel, __pyx_k_cancel, sizeof(__pyx_k_cancel), 0, 0, 1, 1},
  {&__pyx_n_s_chr, __pyx_k_chr, sizeof(__pyx_k_chr), 0, 0, 1, 1},
  {&__pyx_n_s_classname, __pyx_k_classname, sizeof(__pyx_k_classname), 0, 0, 1, 1},
  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
  {&__pyx_n_s_codecs, __pyx_k_codecs, sizeof(__pyx_k_codecs), 0, 0, 1, 1},
  {&__pyx_n_s_col, __pyx_k_col, sizeof(__pyx_k_col), 0, 0, 1, 1},
  {&__pyx_n_s_command, __pyx_k_command, sizeof(__pyx_k_command), 0, 0, 1, 1},
  {&__pyx_n_s_context, __pyx_k_context, sizeof(__pyx_k_context), 0, 0, 1, 1},
  {&__pyx_n_s_continuous_assign, __pyx_k_continuous_assign, sizeof(__pyx_k_continuous_assign), 0, 0, 1, 1},
  {&__pyx_n_s_create_process, __pyx_k_create_process, sizeof(__pyx_k_create_process), 0, 0, 1, 1},
  {&__pyx_n_s_ctff, __pyx_k_ctff, sizeof(__pyx_k_ctff), 0, 0, 1, 1},
  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
  {&__pyx_n_s_data_2, __pyx_k_data_2, sizeof(__pyx_k_data_2), 0, 0, 1, 1},
  {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
  {&__pyx_n_s_decoder, __pyx_k_decoder, sizeof(__pyx_k_decoder), 0, 0, 1, 1},
  {&__pyx_kp_s_default_handler_pass_through_al, __pyx_k_default_handler_pass_through_al, sizeof(__pyx_k_default_handler_pass_through_al), 0, 0, 1, 0},
  {&__pyx_n_s_defaultvalue, __pyx_k_defaultvalue, sizeof(__pyx_k_defaultvalue), 0, 0, 1, 1},
  {&__pyx_n_s_destruct_process, __pyx_k_destruct_process, sizeof(__pyx_k_destruct_process), 0, 0, 1, 1},
  {&__pyx_n_s_dispatch_char, __pyx_k_dispatch_char, sizeof(__pyx_k_dispatch_char), 0, 0, 1, 1},
  {&__pyx_n_s_dispatch_control_string, __pyx_k_dispatch_control_string, sizeof(__pyx_k_dispatch_control_string), 0, 0, 1, 1},
  {&__pyx_n_s_dispatch_csi, __pyx_k_dispatch_csi, sizeof(__pyx_k_dispatch_csi), 0, 0, 1, 1},
  {&__pyx_n_s_dispatch_esc, __pyx_k_dispatch_esc, sizeof(__pyx_k_dispatch_esc), 0, 0, 1, 1},
  {&__pyx_n_s_dispatch_invalid, __pyx_k_dispatch_invalid, sizeof(__pyx_k_dispatch_invalid), 0, 0, 1, 1},
  {&__pyx_n_s_dispatch_ss2, __pyx_k_dispatch_ss2, sizeof(__pyx_k_dispatch_ss2), 0, 0, 1, 1},
  {&__pyx_n_s_dispatch_ss3, __pyx_k_dispatch_ss3, sizeof(__pyx_k_dispatch_ss3), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_doctest, __pyx_k_doctest, sizeof(__pyx_k_doctest), 0, 0, 1, 1},
  {&__pyx_n_s_drain, __pyx_k_drain, sizeof(__pyx_k_drain), 0, 0, 1, 1},
  {&__pyx_n_s_drive, __pyx_k_drive, sizeof(__pyx_k_drive), 0, 0, 1, 1},
  {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1},
  {&__pyx_kp_u_e_NotHandledException_test1_e_v, __pyx_k_e_NotHandledException_test1_e_v, sizeof(__pyx_k_e_NotHandledException_test1_e_v), 0, 1, 0, 0},
  {&__pyx_kp_u_e_NotHandledException_test2_e_v, __pyx_k_e_NotHandledException_test2_e_v, sizeof(__pyx_k_e_NotHandledException_test2_e_v), 0, 1, 0, 0},
  {&__pyx_kp_u_e_ParseException_test2_e_value, __pyx_k_e_ParseException_test2_e_value, sizeof(__pyx_k_e_ParseException_test2_e_value), 0, 1, 0, 0},
  {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
  {&__pyx_n_s_environ, __pyx_k_environ, sizeof(__pyx_k_environ), 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_esc_timer, __pyx_k_esc_timer, sizeof(__pyx_k_esc_timer), 0, 0, 1, 1},
  {&__pyx_n_s_exception, __pyx_k_exception, sizeof(__pyx_k_exception), 0, 0, 1, 1},
  {&__pyx_kp_s_exec_s, __pyx_k_exec_s, sizeof(__pyx_k_exec_s), 0, 0, 1, 0},
  {&__pyx_n_s_execlp, __pyx_k_execlp, sizeof(__pyx_k_execlp), 0, 0, 1, 1},
  {&__pyx_n_s_fcntl, __pyx_k_fcntl, sizeof(__pyx_k_fcntl), 0, 0, 1, 1},
  {&__pyx_n_s_fd, __pyx_k_fd, sizeof(__pyx_k_fd), 0, 0, 1, 1},
  {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
  {&__pyx_n_s_fileno, __pyx_k_fileno, sizeof(__pyx_k_fileno), 0, 0, 1, 1},
  {&__pyx_n_s_final, __pyx_k_final, sizeof(__pyx_k_final), 0, 0, 1, 1},
  {&__pyx_n_s_fitsize, __pyx_k_fitsize, sizeof(__pyx_k_fitsize), 0, 0, 1, 1},
  {&__pyx_n_s_flush, __pyx_k_flush, sizeof(__pyx_k_flush), 0, 0, 1, 1},
  {&__pyx_n_s_focus_process, __pyx_k_focus_process, sizeof(__pyx_k_focus_process), 0, 0, 1, 1},
  {&__pyx_n_s_fork, __pyx_k_fork, sizeof(__pyx_k_fork), 0, 0, 1, 1},
  {&__pyx_kp_s_forward_input_iterator, __pyx_k_forward_input_iterator, sizeof(__pyx_k_forward_input_iterator), 0, 0, 1, 0},
  {&__pyx_n_s_fpathconf, __pyx_k_fpathconf, sizeof(__pyx_k_fpathconf), 0, 0, 1, 1},
  {&__pyx_n_s_frame, __pyx_k_frame, sizeof(__pyx_k_frame), 0, 0, 1, 1},
  {&__pyx_n_s_get_lhs, __pyx_k_get_lhs, sizeof(__pyx_k_get_lhs), 0, 0, 1, 1},
  {&__pyx_n_s_get_rhs, __pyx_k_get_rhs, sizeof(__pyx_k_get_rhs), 0, 0, 1, 1},
  {&__pyx_n_s_getactiveprocess, __pyx_k_getactiveprocess, sizeof(__pyx_k_getactiveprocess), 0, 0, 1, 1},
  {&__pyx_n_s_getargspec, __pyx_k_getargspec, sizeof(__pyx_k_getargspec), 0, 0, 1, 1},
  {&__pyx_n_s_getincrementaldecoder, __pyx_k_getincrementaldecoder, sizeof(__pyx_k_getincrementaldecoder), 0, 0, 1, 1},
  {&__pyx_n_s_getmembers, __pyx_k_getmembers, sizeof(__pyx_k_getmembers), 0, 0, 1, 1},
  {&__pyx_n_s_getpid, __pyx_k_getpid, sizeof(__pyx_k_getpid), 0, 0, 1, 1},
  {&__pyx_n_s_getwriter, __pyx_k_getwriter, sizeof(__pyx_k_getwriter), 0, 0, 1, 1},
  {&__pyx_n_s_handle_char, __pyx_k_handle_char, sizeof(__pyx_k_handle_char), 0, 0, 1, 1},
  {&__pyx_n_s_handle_control_string, __pyx_k_handle_control_string, sizeof(__pyx_k_handle_control_string), 0, 0, 1, 1},
  {&__pyx_n_s_handle_csi, __pyx_k_handle_csi, sizeof(__pyx_k_handle_csi), 0, 0, 1, 1},
  {&__pyx_n_s_handle_draw, __pyx_k_handle_draw, sizeof(__pyx_k_handle_draw), 0, 0, 1, 1},
  {&__pyx_n_s_handle_end, __pyx_k_handle_end, sizeof(__pyx_k_handle_end), 0, 0, 1, 1},
  {&__pyx_n_s_handle_esc, __pyx_k_handle_esc, sizeof(__pyx_k_handle_esc), 0, 0, 1, 1},
  {&__pyx_n_s_handle_flush, __pyx_k_handle_flush, sizeof(__pyx_k_handle_flush), 0, 0, 1, 1},
  {&__pyx_n_s_handle_invalid, __pyx_k_handle_invalid, sizeof(__pyx_k_handle_invalid), 0, 0, 1, 1},
  {&__pyx_n_s_handle_resize, __pyx_k_handle_resize, sizeof(__pyx_k_handle_resize), 0, 0, 1, 1},
  {&__pyx_n_s_handle_ss2, __pyx_k_handle_ss2, sizeof(__pyx_k_handle_ss2), 0, 0, 1, 1},
  {&__pyx_n_s_handle_ss3, __pyx_k_handle_ss3, sizeof(__pyx_k_handle_ss3), 0, 0, 1, 1},
  {&__pyx_n_s_handle_start, __pyx_k_handle_start, sizeof(__pyx_k_handle_start), 0, 0, 1, 1},
  {&__pyx_n_s_handled_lhs, __pyx_k_handled_lhs, sizeof(__pyx_k_handled_lhs), 0, 0, 1, 1},
  {&__pyx_n_s_handled_rhs, __pyx_k_handled_rhs, sizeof(__pyx_k_handled_rhs), 0, 0, 1, 1},
  {&__pyx_n_s_handler, __pyx_k_handler, sizeof(__pyx_k_handler), 0, 0, 1, 1},
  {&__pyx_n_s_hashlib, __pyx_k_hashlib, sizeof(__pyx_k_hashlib), 0, 0, 1, 1},
  {&__pyx_n_s_height, __pyx_k_height, sizeof(__pyx_k_height), 0, 0, 1, 1},
  {&__pyx_n_s_hexdigest, __pyx_k_hexdigest, sizeof(__pyx_k_hexdigest), 0, 0, 1, 1},
  {&__pyx_n_s_hh, __pyx_k_hh, sizeof(__pyx_k_hh), 0, 0, 1, 1},
  {&__pyx_n_s_hhhh, __pyx_k_hhhh, sizeof(__pyx_k_hhhh), 0, 0, 1, 1},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {&__pyx_n_s_ibytes, __pyx_k_ibytes, sizeof(__pyx_k_ibytes), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_info, __pyx_k_info, sizeof(__pyx_k_info), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_s_init_2, __pyx_k_init_2, sizeof(__pyx_k_init_2), 0, 0, 1, 1},
  {&__pyx_n_s_init_process, __pyx_k_init_process, sizeof(__pyx_k_init_process), 0, 0, 1, 1},
  {&__pyx_n_s_input_target, __pyx_k_input_target, sizeof(__pyx_k_input_target), 0, 0, 1, 1},
  {&__pyx_n_s_inputcontext, __pyx_k_inputcontext, sizeof(__pyx_k_inputcontext), 0, 0, 1, 1},
  {&__pyx_n_s_inputcontext_2, __pyx_k_inputcontext_2, sizeof(__pyx_k_inputcontext_2), 0, 0, 1, 1},
  {&__pyx_n_s_inputhandler, __pyx_k_inputhandler, sizeof(__pyx_k_inputhandler), 0, 0, 1, 1},
  {&__pyx_n_s_inputhandler_2, __pyx_k_inputhandler_2, sizeof(__pyx_k_inputhandler_2), 0, 0, 1, 1},
  {&__pyx_n_s_inputparser, __pyx_k_inputparser, sizeof(__pyx_k_inputparser), 0, 0, 1, 1},
  {&__pyx_n_s_inputparser_2, __pyx_k_inputparser_2, sizeof(__pyx_k_inputparser_2), 0, 0, 1, 1},
  {&__pyx_n_s_inputscanner, __pyx_k_inputscanner, sizeof(__pyx_k_inputscanner), 0, 0, 1, 1},
  {&__pyx_n_s_inspect, __pyx_k_inspect, sizeof(__pyx_k_inspect), 0, 0, 1, 1},
  {&__pyx_n_s_intermediate, __pyx_k_intermediate, sizeof(__pyx_k_intermediate), 0, 0, 1, 1},
  {&__pyx_n_s_io, __pyx_k_io, sizeof(__pyx_k_io), 0, 0, 1, 1},
  {&__pyx_n_s_ioctl, __pyx_k_ioctl, sizeof(__pyx_k_ioctl), 0, 0, 1, 1},
  {&__pyx_n_s_is_alive, __pyx_k_is_alive, sizeof(__pyx_k_is_alive), 0, 0, 1, 1},
  {&__pyx_n_s_isclass, __pyx_k_isclass, sizeof(__pyx_k_isclass), 0, 0, 1, 1},
  {&__pyx_n_s_ismethod, __pyx_k_ismethod, sizeof(__pyx_k_ismethod), 0, 0, 1, 1},
  {&__pyx_n_s_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 0, 1, 1},
  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
  {&__pyx_n_s_keywords, __pyx_k_keywords, sizeof(__pyx_k_keywords), 0, 0, 1, 1},
  {&__pyx_n_s_kill, __pyx_k_kill, sizeof(__pyx_k_kill), 0, 0, 1, 1},
  {&__pyx_n_s_lang, __pyx_k_lang, sizeof(__pyx_k_lang), 0, 0, 1, 1},
  {&__pyx_n_s_lhs, __pyx_k_lhs, sizeof(__pyx_k_lhs), 0, 0, 1, 1},
  {&__pyx_n_s_license, __pyx_k_license, sizeof(__pyx_k_license), 0, 0, 1, 1},
  {&__pyx_n_s_logging, __pyx_k_logging, sizeof(__pyx_k_logging), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_mainprocess, __pyx_k_mainprocess, sizeof(__pyx_k_mainprocess), 0, 0, 1, 1},
  {&__pyx_n_s_mainprocess_2, __pyx_k_mainprocess_2, sizeof(__pyx_k_mainprocess_2), 0, 0, 1, 1},
  {&__pyx_n_s_master, __pyx_k_master, sizeof(__pyx_k_master), 0, 0, 1, 1},
  {&__pyx_n_s_master_2, __pyx_k_master_2, sizeof(__pyx_k_master_2), 0, 0, 1, 1},
  {&__pyx_n_s_md5, __pyx_k_md5, sizeof(__pyx_k_md5), 0, 0, 1, 1},
  {&__pyx_n_s_member, __pyx_k_member, sizeof(__pyx_k_member), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_modules, __pyx_k_modules, sizeof(__pyx_k_modules), 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_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
  {&__pyx_n_s_no, __pyx_k_no, sizeof(__pyx_k_no), 0, 0, 1, 1},
  {&__pyx_n_s_on_read, __pyx_k_on_read, sizeof(__pyx_k_on_read), 0, 0, 1, 1},
  {&__pyx_n_s_on_write, __pyx_k_on_write, sizeof(__pyx_k_on_write), 0, 0, 1, 1},
  {&__pyx_n_s_onclose, __pyx_k_onclose, sizeof(__pyx_k_onclose), 0, 0, 1, 1},
  {&__pyx_n_s_onresize, __pyx_k_onresize, sizeof(__pyx_k_onresize), 0, 0, 1, 1},
  {&__pyx_n_s_ord, __pyx_k_ord, sizeof(__pyx_k_ord), 0, 0, 1, 1},
  {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
  {&__pyx_n_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 1},
  {&__pyx_n_s_output_2, __pyx_k_output_2, sizeof(__pyx_k_output_2), 0, 0, 1, 1},
  {&__pyx_n_s_outputcontext, __pyx_k_outputcontext, sizeof(__pyx_k_outputcontext), 0, 0, 1, 1},
  {&__pyx_n_s_outputcontext_2, __pyx_k_outputcontext_2, sizeof(__pyx_k_outputcontext_2), 0, 0, 1, 1},
  {&__pyx_n_s_outputhandler, __pyx_k_outputhandler, sizeof(__pyx_k_outputhandler), 0, 0, 1, 1},
  {&__pyx_n_s_outputhandler_2, __pyx_k_outputhandler_2, sizeof(__pyx_k_outputhandler_2), 0, 0, 1, 1},
  {&__pyx_n_s_outputparser, __pyx_k_outputparser, sizeof(__pyx_k_outputparser), 0, 0, 1, 1},
  {&__pyx_n_s_outputparser_2, __pyx_k_outputparser_2, sizeof(__pyx_k_outputparser_2), 0, 0, 1, 1},
  {&__pyx_n_s_outputscanner, __pyx_k_outputscanner, sizeof(__pyx_k_outputscanner), 0, 0, 1, 1},
  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
  {&__pyx_n_s_parameter, __pyx_k_parameter, sizeof(__pyx_k_parameter), 0, 0, 1, 1},
  {&__pyx_n_s_params, __pyx_k_params, sizeof(__pyx_k_params), 0, 0, 1, 1},
  {&__pyx_n_s_parse, __pyx_k_parse, sizeof(__pyx_k_parse), 0, 0, 1, 1},
  {&__pyx_kp_s_parse_ESC_CSI_string_seqneces, __pyx_k_parse_ESC_CSI_string_seqneces, sizeof(__pyx_k_parse_ESC_CSI_string_seqneces), 0, 0, 1, 0},
  {&__pyx_kp_u_parser_SimpleParser_context_Sim, __pyx_k_parser_SimpleParser_context_Sim, sizeof(__pyx_k_parser_SimpleParser_context_Sim), 0, 1, 0, 0},
  {&__pyx_n_s_pbytes, __pyx_k_pbytes, sizeof(__pyx_k_pbytes), 0, 0, 1, 1},
  {&__pyx_n_s_pid, __pyx_k_pid, sizeof(__pyx_k_pid), 0, 0, 1, 1},
  {&__pyx_n_s_prefix, __pyx_k_prefix, sizeof(__pyx_k_prefix), 0, 0, 1, 1},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
  {&__pyx_n_s_process, __pyx_k_process, sizeof(__pyx_k_process), 0, 0, 1, 1},
  {&__pyx_n_s_process_end, __pyx_k_process_end, sizeof(__pyx_k_process_end), 0, 0, 1, 1},
  {&__pyx_n_s_process_input, __pyx_k_process_input, sizeof(__pyx_k_process_input), 0, 0, 1, 1},
  {&__pyx_n_s_process_is_active, __pyx_k_process_is_active, sizeof(__pyx_k_process_is_active), 0, 0, 1, 1},
  {&__pyx_n_s_process_map, __pyx_k_process_map, sizeof(__pyx_k_process_map), 0, 0, 1, 1},
  {&__pyx_n_s_process_map_2, __pyx_k_process_map_2, sizeof(__pyx_k_process_map_2), 0, 0, 1, 1},
  {&__pyx_n_s_process_output, __pyx_k_process_output, sizeof(__pyx_k_process_output), 0, 0, 1, 1},
  {&__pyx_n_s_process_resize, __pyx_k_process_resize, sizeof(__pyx_k_process_resize), 0, 0, 1, 1},
  {&__pyx_n_s_process_start, __pyx_k_process_start, sizeof(__pyx_k_process_start), 0, 0, 1, 1},
  {&__pyx_n_s_pty, __pyx_k_pty, sizeof(__pyx_k_pty), 0, 0, 1, 1},
  {&__pyx_n_s_put, __pyx_k_put, sizeof(__pyx_k_put), 0, 0, 1, 1},
  {&__pyx_n_s_puts, __pyx_k_puts, sizeof(__pyx_k_puts), 0, 0, 1, 1},
  {&__pyx_n_s_putu, __pyx_k_putu, sizeof(__pyx_k_putu), 0, 0, 1, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1},
  {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1},
  {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1},
  {&__pyx_n_s_reset, __pyx_k_reset, sizeof(__pyx_k_reset), 0, 0, 1, 1},
  {&__pyx_n_s_resize, __pyx_k_resize, sizeof(__pyx_k_resize), 0, 0, 1, 1},
  {&__pyx_n_s_resize_impl, __pyx_k_resize_impl, sizeof(__pyx_k_resize_impl), 0, 0, 1, 1},
  {&__pyx_n_s_resized, __pyx_k_resized, sizeof(__pyx_k_resized), 0, 0, 1, 1},
  {&__pyx_n_s_restore_term, __pyx_k_restore_term, sizeof(__pyx_k_restore_term), 0, 0, 1, 1},
  {&__pyx_n_s_rfd, __pyx_k_rfd, sizeof(__pyx_k_rfd), 0, 0, 1, 1},
  {&__pyx_n_s_rfds, __pyx_k_rfds, sizeof(__pyx_k_rfds), 0, 0, 1, 1},
  {&__pyx_n_s_rhs, __pyx_k_rhs, sizeof(__pyx_k_rhs), 0, 0, 1, 1},
  {&__pyx_n_s_row, __pyx_k_row, sizeof(__pyx_k_row), 0, 0, 1, 1},
  {&__pyx_kp_s_s_s_s, __pyx_k_s_s_s, sizeof(__pyx_k_s_s_s), 0, 0, 1, 0},
  {&__pyx_kp_s_scan_input_stream_and_iterate_U, __pyx_k_scan_input_stream_and_iterate_U, sizeof(__pyx_k_scan_input_stream_and_iterate_U), 0, 0, 1, 0},
  {&__pyx_n_s_scanner, __pyx_k_scanner, sizeof(__pyx_k_scanner), 0, 0, 1, 1},
  {&__pyx_kp_u_scanner_DefaultScanner_scanner, __pyx_k_scanner_DefaultScanner_scanner, sizeof(__pyx_k_scanner_DefaultScanner_scanner), 0, 1, 0, 0},
  {&__pyx_kp_u_scanner_DefaultScanner_scanner_2, __pyx_k_scanner_DefaultScanner_scanner_2, sizeof(__pyx_k_scanner_DefaultScanner_scanner_2), 0, 1, 0, 0},
  {&__pyx_kp_u_scanner_DefaultScanner_scanner_3, __pyx_k_scanner_DefaultScanner_scanner_3, sizeof(__pyx_k_scanner_DefaultScanner_scanner_3), 0, 1, 0, 0},
  {&__pyx_kp_u_scanner_DefaultScanner_termenc, __pyx_k_scanner_DefaultScanner_termenc, sizeof(__pyx_k_scanner_DefaultScanner_termenc), 0, 1, 0, 0},
  {&__pyx_n_s_select, __pyx_k_select, sizeof(__pyx_k_select), 0, 0, 1, 1},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
  {&__pyx_n_s_seq, __pyx_k_seq, sizeof(__pyx_k_seq), 0, 0, 1, 1},
  {&__pyx_n_s_sethandler, __pyx_k_sethandler, sizeof(__pyx_k_sethandler), 0, 0, 1, 1},
  {&__pyx_n_s_setupterm, __pyx_k_setupterm, sizeof(__pyx_k_setupterm), 0, 0, 1, 1},
  {&__pyx_n_s_signal, __pyx_k_signal, sizeof(__pyx_k_signal), 0, 0, 1, 1},
  {&__pyx_n_s_signature, __pyx_k_signature, sizeof(__pyx_k_signature), 0, 0, 1, 1},
  {&__pyx_kp_s_simple_parser_don_t_parse_ESC_C, __pyx_k_simple_parser_don_t_parse_ESC_C, sizeof(__pyx_k_simple_parser_don_t_parse_ESC_C), 0, 0, 1, 0},
  {&__pyx_n_s_sort, __pyx_k_sort, sizeof(__pyx_k_sort), 0, 0, 1, 1},
  {&__pyx_n_s_specs, __pyx_k_specs, sizeof(__pyx_k_specs), 0, 0, 1, 1},
  {&__pyx_n_s_specstr, __pyx_k_specstr, sizeof(__pyx_k_specstr), 0, 0, 1, 1},
  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
  {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1},
  {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
  {&__pyx_n_s_state_is_esc, __pyx_k_state_is_esc, sizeof(__pyx_k_state_is_esc), 0, 0, 1, 1},
  {&__pyx_n_s_status, __pyx_k_status, sizeof(__pyx_k_status), 0, 0, 1, 1},
  {&__pyx_n_s_stdin, __pyx_k_stdin, sizeof(__pyx_k_stdin), 0, 0, 1, 1},
  {&__pyx_n_s_stdin_fileno, __pyx_k_stdin_fileno, sizeof(__pyx_k_stdin_fileno), 0, 0, 1, 1},
  {&__pyx_n_s_stdin_fileno_2, __pyx_k_stdin_fileno_2, sizeof(__pyx_k_stdin_fileno_2), 0, 0, 1, 1},
  {&__pyx_n_s_stdout, __pyx_k_stdout, sizeof(__pyx_k_stdout), 0, 0, 1, 1},
  {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1},
  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
  {&__pyx_n_s_target_fd, __pyx_k_target_fd, sizeof(__pyx_k_target_fd), 0, 0, 1, 1},
  {&__pyx_n_s_target_output, __pyx_k_target_output, sizeof(__pyx_k_target_output), 0, 0, 1, 1},
  {&__pyx_n_s_tcflow, __pyx_k_tcflow, sizeof(__pyx_k_tcflow), 0, 0, 1, 1},
  {&__pyx_n_s_tcgetattr, __pyx_k_tcgetattr, sizeof(__pyx_k_tcgetattr), 0, 0, 1, 1},
  {&__pyx_n_s_tcsetattr, __pyx_k_tcsetattr, sizeof(__pyx_k_tcsetattr), 0, 0, 1, 1},
  {&__pyx_n_s_template, __pyx_k_template, sizeof(__pyx_k_template), 0, 0, 1, 1},
  {&__pyx_n_s_term, __pyx_k_term, sizeof(__pyx_k_term), 0, 0, 1, 1},
  {&__pyx_n_s_termenc, __pyx_k_termenc, sizeof(__pyx_k_termenc), 0, 0, 1, 1},
  {&__pyx_n_s_termenc_2, __pyx_k_termenc_2, sizeof(__pyx_k_termenc_2), 0, 0, 1, 1},
  {&__pyx_n_s_termios, __pyx_k_termios, sizeof(__pyx_k_termios), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_test_2, __pyx_k_test_2, sizeof(__pyx_k_test_2), 0, 0, 1, 1},
  {&__pyx_n_s_testmod, __pyx_k_testmod, sizeof(__pyx_k_testmod), 0, 0, 1, 1},
  {&__pyx_n_s_thismodule, __pyx_k_thismodule, sizeof(__pyx_k_thismodule), 0, 0, 1, 1},
  {&__pyx_n_s_threading, __pyx_k_threading, sizeof(__pyx_k_threading), 0, 0, 1, 1},
  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
  {&__pyx_kp_s_thrown_when_a_parse_error_is_de, __pyx_k_thrown_when_a_parse_error_is_de, sizeof(__pyx_k_thrown_when_a_parse_error_is_de), 0, 0, 1, 0},
  {&__pyx_kp_s_thrown_when_an_unknown_seqnence, __pyx_k_thrown_when_an_unknown_seqnence, sizeof(__pyx_k_thrown_when_an_unknown_seqnence), 0, 0, 1, 0},
  {&__pyx_kp_s_tmp_ctff_pyx, __pyx_k_tmp_ctff_pyx, sizeof(__pyx_k_tmp_ctff_pyx), 0, 0, 1, 0},
  {&__pyx_n_s_truncate, __pyx_k_truncate, sizeof(__pyx_k_truncate), 0, 0, 1, 1},
  {&__pyx_n_s_tty, __pyx_k_tty, sizeof(__pyx_k_tty), 0, 0, 1, 1},
  {&__pyx_n_s_tty_2, __pyx_k_tty_2, sizeof(__pyx_k_tty_2), 0, 0, 1, 1},
  {&__pyx_n_s_ucs4, __pyx_k_ucs4, sizeof(__pyx_k_ucs4), 0, 0, 1, 1},
  {&__pyx_n_s_ucs4_2, __pyx_k_ucs4_2, sizeof(__pyx_k_ucs4_2), 0, 0, 1, 1},
  {&__pyx_n_s_unichr, __pyx_k_unichr, sizeof(__pyx_k_unichr), 0, 0, 1, 1},
  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  {&__pyx_n_s_varargs, __pyx_k_varargs, sizeof(__pyx_k_varargs), 0, 0, 1, 1},
  {&__pyx_n_s_vdisable, __pyx_k_vdisable, sizeof(__pyx_k_vdisable), 0, 0, 1, 1},
  {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1},
  {&__pyx_n_s_wait, __pyx_k_wait, sizeof(__pyx_k_wait), 0, 0, 1, 1},
  {&__pyx_n_s_wfd, __pyx_k_wfd, sizeof(__pyx_k_wfd), 0, 0, 1, 1},
  {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1},
  {&__pyx_n_s_winsize, __pyx_k_winsize, sizeof(__pyx_k_winsize), 0, 0, 1, 1},
  {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
  {&__pyx_n_s_writestring, __pyx_k_writestring, sizeof(__pyx_k_writestring), 0, 0, 1, 1},
  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  {&__pyx_n_s_xfd, __pyx_k_xfd, sizeof(__pyx_k_xfd), 0, 0, 1, 1},
  {&__pyx_n_s_xfds, __pyx_k_xfds, sizeof(__pyx_k_xfds), 0, 0, 1, 1},
  {&__pyx_n_s_xoff, __pyx_k_xoff, sizeof(__pyx_k_xoff), 0, 0, 1, 1},
  {&__pyx_n_s_xon, __pyx_k_xon, sizeof(__pyx_k_xon), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ord = __Pyx_GetBuiltinName(__pyx_n_s_ord); if (!__pyx_builtin_ord) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_unichr = __Pyx_GetBuiltinName(__pyx_n_s_unichr); if (!__pyx_builtin_unichr) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_OSError = __Pyx_GetBuiltinName(__pyx_n_s_OSError); if (!__pyx_builtin_OSError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "ctff.pyx":109
 * 
 *     def handle_start(self, context):
 *         raise NotImplementedError("EventObserver::handle_start")             # <<<<<<<<<<<<<<
 * 
 *     def handle_end(self, context):
 */
  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_EventObserver_handle_start); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "ctff.pyx":112
 * 
 *     def handle_end(self, context):
 *         raise NotImplementedError("EventObserver::handle_end")             # <<<<<<<<<<<<<<
 * 
 *     def handle_csi(self, context, params, intermediate, final):
 */
  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_EventObserver_handle_end); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "ctff.pyx":115
 * 
 *     def handle_csi(self, context, params, intermediate, final):
 *         raise NotImplementedError("EventObserver::handle_csi")             # <<<<<<<<<<<<<<
 * 
 *     def handle_esc(self, context, prefix, final):
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_EventObserver_handle_csi); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "ctff.pyx":118
 * 
 *     def handle_esc(self, context, prefix, final):
 *         raise NotImplementedError("EventObserver::handle_esc")             # <<<<<<<<<<<<<<
 * 
 *     def handle_ss2(self, context, final):
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_EventObserver_handle_esc); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "ctff.pyx":121
 * 
 *     def handle_ss2(self, context, final):
 *         raise NotImplementedError("EventObserver::handle_ss2")             # <<<<<<<<<<<<<<
 * 
 *     def handle_ss3(self, context, final):
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_EventObserver_handle_ss2); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "ctff.pyx":124
 * 
 *     def handle_ss3(self, context, final):
 *         raise NotImplementedError("EventObserver::handle_ss3")             # <<<<<<<<<<<<<<
 * 
 *     def handle_control_string(self, context, prefix, value):
 */
  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_EventObserver_handle_ss3); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "ctff.pyx":127
 * 
 *     def handle_control_string(self, context, prefix, value):
 *         raise NotImplementedError("EventObserver::handle_control_string")             # <<<<<<<<<<<<<<
 * 
 *     def handle_char(self, context, c):
 */
  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_EventObserver_handle_control_str); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "ctff.pyx":130
 * 
 *     def handle_char(self, context, c):
 *         raise NotImplementedError("EventObserver::handle_char")             # <<<<<<<<<<<<<<
 * 
 *     def handle_invalid(self, context, seq):
 */
  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_EventObserver_handle_char); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "ctff.pyx":133
 * 
 *     def handle_invalid(self, context, seq):
 *         raise NotImplementedError("EventObserver::handle_invalid")             # <<<<<<<<<<<<<<
 * 
 *     def handle_draw(self, context):
 */
  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_EventObserver_handle_invalid); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);

  /* "ctff.pyx":136
 * 
 *     def handle_draw(self, context):
 *         raise NotImplementedError("EventObserver::handle_draw")             # <<<<<<<<<<<<<<
 * 
 *     def handle_resize(self, context, row, col):
 */
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_EventObserver_handle_draw); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "ctff.pyx":139
 * 
 *     def handle_resize(self, context, row, col):
 *         raise NotImplementedError("EventObserver::handle_resize")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_EventObserver_handle_resize); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "ctff.pyx":147
 * 
 *     def __iter__(self):
 *         raise NotImplementedError("Scanner::__iter__")             # <<<<<<<<<<<<<<
 * 
 *     # deprecated
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Scanner___iter); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "ctff.pyx":151
 *     # deprecated
 *     def assign(self, value, termenc):
 *         raise NotImplementedError("Scanner::assign")             # <<<<<<<<<<<<<<
 * 
 *     def continuous_assign(self, value, termenc):
 */
  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Scanner_assign); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "ctff.pyx":154
 * 
 *     def continuous_assign(self, value, termenc):
 *         raise NotImplementedError("Scanner::continuous_assign")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Scanner_continuous_assign); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "ctff.pyx":162
 * 
 *     def write(self, c):
 *         raise NotImplementedError("OutputStream::write")             # <<<<<<<<<<<<<<
 * 
 *     def flush(self):
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_OutputStream_write); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "ctff.pyx":165
 * 
 *     def flush(self):
 *         raise NotImplementedError("OutputStream::flush")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_OutputStream_flush); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "ctff.pyx":173
 * 
 *     def dispatch_esc(self, prefix, final):
 *         raise NotImplementedError("EventDispatcher::dispatch_esc")             # <<<<<<<<<<<<<<
 * 
 *     def dispatch_csi(self, prefix, params, final):
 */
  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_EventDispatcher_dispatch_esc); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "ctff.pyx":176
 * 
 *     def dispatch_csi(self, prefix, params, final):
 *         raise NotImplementedError("EventDispatcher::dispatch_csi")             # <<<<<<<<<<<<<<
 * 
 *     def dispatch_control_string(self, prefix, value):
 */
  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_EventDispatcher_dispatch_csi); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "ctff.pyx":179
 * 
 *     def dispatch_control_string(self, prefix, value):
 *         raise NotImplementedError("EventDispatcher::dispatch_control_string")             # <<<<<<<<<<<<<<
 * 
 *     def dispatch_char(self, c):
 */
  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_EventDispatcher_dispatch_control); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "ctff.pyx":182
 * 
 *     def dispatch_char(self, c):
 *         raise NotImplementedError("EventDispatcher::dispatch_char")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_EventDispatcher_dispatch_char); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "ctff.pyx":190
 * 
 *     def parse(self, context):
 *         raise NotImplementedError("Parser::parse")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Parser_parse); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "ctff.pyx":198
 * 
 *     def fitsize(self):
 *         raise NotImplementedError("PTY::fitsize")             # <<<<<<<<<<<<<<
 * 
 *     def resize(self, height, width):
 */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_PTY_fitsize); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "ctff.pyx":201
 * 
 *     def resize(self, height, width):
 *         raise NotImplementedError("PTY::resize")             # <<<<<<<<<<<<<<
 * 
 *     def read(self):
 */
  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_PTY_resize); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "ctff.pyx":204
 * 
 *     def read(self):
 *         raise NotImplementedError("PTY::read")             # <<<<<<<<<<<<<<
 * 
 *     def write(self, data):
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_PTY_read); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "ctff.pyx":207
 * 
 *     def write(self, data):
 *         raise NotImplementedError("PTY::write")             # <<<<<<<<<<<<<<
 * 
 *     def xon(self):
 */
  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_PTY_write); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "ctff.pyx":210
 * 
 *     def xon(self):
 *         raise NotImplementedError("PTY::xon")             # <<<<<<<<<<<<<<
 * 
 *     def xoff(self):
 */
  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_PTY_xon); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "ctff.pyx":213
 * 
 *     def xoff(self):
 *         raise NotImplementedError("PTY::xoff")             # <<<<<<<<<<<<<<
 * 
 *     def drive(self):
 */
  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_PTY_xoff); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "ctff.pyx":216
 * 
 *     def drive(self):
 *         raise NotImplementedError("PTY::drive")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_PTY_drive); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "ctff.pyx":233
 * 
 *         def __iter__(self):
 *             for i in [1, 2, 3, 4, 5]:             # <<<<<<<<<<<<<<
 *                 yield i
 * 
 */
  __pyx_tuple__29 = PyTuple_Pack(5, __pyx_int_1, __pyx_int_2, __pyx_int_3, __pyx_int_4, __pyx_int_5); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "ctff.pyx":302
 *         context = self.__context
 *         if state == _STATE_ESC:
 *             context.dispatch_char(0x1b)             # <<<<<<<<<<<<<<
 *         elif state == _STATE_ESC_INTERMEDIATE:
 *             context.dispatch_invalid([0x1b] + ibytes)
 */
  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_int_27); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);

  /* "ctff.pyx":825
 *         self.__scanner.assign(data, self.__termenc)
 *         if self._buffering:
 *             self._output.truncate(0)             # <<<<<<<<<<<<<<
 * 
 *     def sethandler(self, handler):
 */
  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);

  /* "ctff.pyx":876
 *     def dispatch_esc(self, intermediate, final):
 *         if not self.__handler.handle_esc(self, intermediate, final):
 *             self.put(0x1b)  # ESC             # <<<<<<<<<<<<<<
 *             for c in intermediate:
 *                 self.put(c)
 */
  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_int_27); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);

  /* "ctff.pyx":883
 *     def dispatch_csi(self, parameter, intermediate, final):
 *         if not self.__handler.handle_csi(self, parameter, intermediate, final):
 *             self.put(0x1b)  # ESC             # <<<<<<<<<<<<<<
 *             self.put(0x5b)  # [
 *             for c in parameter:
 */
  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_int_27); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);

  /* "ctff.pyx":884
 *         if not self.__handler.handle_csi(self, parameter, intermediate, final):
 *             self.put(0x1b)  # ESC
 *             self.put(0x5b)  # [             # <<<<<<<<<<<<<<
 *             for c in parameter:
 *                 self.put(c)
 */
  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_int_91); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);

  /* "ctff.pyx":893
 *     def dispatch_ss2(self, final):
 *         if not self.__handler.handle_ss2(self, final):
 *             self.put(0x1b)  # ESC             # <<<<<<<<<<<<<<
 *             self.put(0x4e)  # N
 *             self.put(final)
 */
  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_int_27); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);

  /* "ctff.pyx":894
 *         if not self.__handler.handle_ss2(self, final):
 *             self.put(0x1b)  # ESC
 *             self.put(0x4e)  # N             # <<<<<<<<<<<<<<
 *             self.put(final)
 * 
 */
  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_int_78); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);

  /* "ctff.pyx":899
 *     def dispatch_ss3(self, final):
 *         if not self.__handler.handle_ss3(self, final):
 *             self.put(0x1b)  # ESC             # <<<<<<<<<<<<<<
 *             self.put(0x4f)  # O
 *             self.put(final)
 */
  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_int_27); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);

  /* "ctff.pyx":900
 *         if not self.__handler.handle_ss3(self, final):
 *             self.put(0x1b)  # ESC
 *             self.put(0x4f)  # O             # <<<<<<<<<<<<<<
 *             self.put(final)
 * 
 */
  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_int_79); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);

  /* "ctff.pyx":905
 *     def dispatch_control_string(self, prefix, value):
 *         if not self.__handler.handle_control_string(self, prefix, value):
 *             self.put(0x1b)  # ESC             # <<<<<<<<<<<<<<
 *             self.put(prefix)
 *             for c in value:
 */
  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_int_27); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);

  /* "ctff.pyx":909
 *             for c in value:
 *                 self.put(c)
 *             self.put(0x1b)  # ESC             # <<<<<<<<<<<<<<
 *             self.put(0x5c)  # \
 * 
 */
  __pyx_tuple__40 = PyTuple_Pack(1, __pyx_int_27); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);

  /* "ctff.pyx":910
 *                 self.put(c)
 *             self.put(0x1b)  # ESC
 *             self.put(0x5c)  # \             # <<<<<<<<<<<<<<
 * 
 *     def dispatch_char(self, c):
 */
  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_int_92); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);

  /* "ctff.pyx":1170
 *             self._outputcontext.flush()
 *         else:
 *             def dispatch_esc():             # <<<<<<<<<<<<<<
 *                 self._inputparser.flush()
 *                 self._inputparser.reset()
 */
  __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_dispatch_esc, 1170, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1193
 *     def drain(self):
 *         self._inputparser.reset()
 *         self._inputcontext.assign('')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s__43); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);

  /* "ctff.pyx":1275
 * 
 *         self.focus_process(self._mainprocess)
 *         self._mainprocess.process_output("")             # <<<<<<<<<<<<<<
 * 
 *     def drive(self):
 */
  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s__43); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "ctff.pyx":1279
 *     def drive(self):
 * 
 *         def onresize(no, frame):             # <<<<<<<<<<<<<<
 *             ''' handle resize '''
 *             self._resized = True
 */
  __pyx_tuple__46 = PyTuple_Pack(2, __pyx_n_s_no, __pyx_n_s_frame); if (unlikely(!__pyx_tuple__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);
  __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_onresize, 1279, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1311
 *                                     process = self._process_map[target_fd]
 *                                     process.process_input(data)
 *                                     self._mainprocess.process_input("")             # <<<<<<<<<<<<<<
 *                             elif self._process_map:
 *                                 process_map = self._process_map
 */
  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s__43); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);

  /* "ctff.pyx":1320
 *                                             data = process.read()
 *                                             process.on_read(data)
 *                                             self._mainprocess.process_output("")             # <<<<<<<<<<<<<<
 *                     else:
 *                         pass
 */
  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s__43); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);

  /* "ctff.pyx":1381
 *         self._resized = False
 * 
 *         def onclose(no, frame):             # <<<<<<<<<<<<<<
 *             pid, status = os.wait()
 *             if not mainprocess.is_alive():
 */
  __pyx_tuple__50 = PyTuple_Pack(4, __pyx_n_s_no, __pyx_n_s_frame, __pyx_n_s_pid, __pyx_n_s_status); if (unlikely(!__pyx_tuple__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);
  __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_onclose, 1381, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":56
 *     ''' thrown when an unknown seqnence is detected '''
 * 
 *     def __init__(self, value):             # <<<<<<<<<<<<<<
 *         """
 *         >>> e = NotHandledException("test1")
 */
  __pyx_tuple__52 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);
  __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_init, 56, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":64
 *         self.value = value
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         """
 *         >>> e = NotHandledException("test2")
 */
  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);
  __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_str, 64, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":77
 *     ''' thrown when a parse error is detected '''
 * 
 *     def __init__(self, value):             # <<<<<<<<<<<<<<
 *         """
 *         >>> e = ParseException("test2")
 */
  __pyx_tuple__56 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__56);
  __Pyx_GIVEREF(__pyx_tuple__56);
  __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_init, 77, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":85
 *         self.value = value
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         """
 *         >>> e = ParseException("test2")
 */
  __pyx_tuple__58 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);
  __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_str, 85, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":108
 *     ''' adapt to event driven ECMA-35/48 parser model '''
 * 
 *     def handle_start(self, context):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_start")
 * 
 */
  __pyx_tuple__60 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_context); if (unlikely(!__pyx_tuple__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__60);
  __Pyx_GIVEREF(__pyx_tuple__60);
  __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_start, 108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":111
 *         raise NotImplementedError("EventObserver::handle_start")
 * 
 *     def handle_end(self, context):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_end")
 * 
 */
  __pyx_tuple__62 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_context); if (unlikely(!__pyx_tuple__62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);
  __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_end, 111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":114
 *         raise NotImplementedError("EventObserver::handle_end")
 * 
 *     def handle_csi(self, context, params, intermediate, final):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_csi")
 * 
 */
  __pyx_tuple__64 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_params, __pyx_n_s_intermediate, __pyx_n_s_final); if (unlikely(!__pyx_tuple__64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);
  __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_csi, 114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":117
 *         raise NotImplementedError("EventObserver::handle_csi")
 * 
 *     def handle_esc(self, context, prefix, final):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_esc")
 * 
 */
  __pyx_tuple__66 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_prefix, __pyx_n_s_final); if (unlikely(!__pyx_tuple__66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__66);
  __Pyx_GIVEREF(__pyx_tuple__66);
  __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_esc, 117, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":120
 *         raise NotImplementedError("EventObserver::handle_esc")
 * 
 *     def handle_ss2(self, context, final):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_ss2")
 * 
 */
  __pyx_tuple__68 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_final); if (unlikely(!__pyx_tuple__68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);
  __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_ss2, 120, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":123
 *         raise NotImplementedError("EventObserver::handle_ss2")
 * 
 *     def handle_ss3(self, context, final):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_ss3")
 * 
 */
  __pyx_tuple__70 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_final); if (unlikely(!__pyx_tuple__70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__70);
  __Pyx_GIVEREF(__pyx_tuple__70);
  __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_ss3, 123, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":126
 *         raise NotImplementedError("EventObserver::handle_ss3")
 * 
 *     def handle_control_string(self, context, prefix, value):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_control_string")
 * 
 */
  __pyx_tuple__72 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_prefix, __pyx_n_s_value); if (unlikely(!__pyx_tuple__72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__72);
  __Pyx_GIVEREF(__pyx_tuple__72);
  __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_control_string, 126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":129
 *         raise NotImplementedError("EventObserver::handle_control_string")
 * 
 *     def handle_char(self, context, c):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_char")
 * 
 */
  __pyx_tuple__74 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_c); if (unlikely(!__pyx_tuple__74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__74);
  __Pyx_GIVEREF(__pyx_tuple__74);
  __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_char, 129, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":132
 *         raise NotImplementedError("EventObserver::handle_char")
 * 
 *     def handle_invalid(self, context, seq):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_invalid")
 * 
 */
  __pyx_tuple__76 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_seq); if (unlikely(!__pyx_tuple__76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);
  __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_invalid, 132, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":135
 *         raise NotImplementedError("EventObserver::handle_invalid")
 * 
 *     def handle_draw(self, context):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_draw")
 * 
 */
  __pyx_tuple__78 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_context); if (unlikely(!__pyx_tuple__78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__78);
  __Pyx_GIVEREF(__pyx_tuple__78);
  __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_draw, 135, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":138
 *         raise NotImplementedError("EventObserver::handle_draw")
 * 
 *     def handle_resize(self, context, row, col):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_resize")
 * 
 */
  __pyx_tuple__80 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_row, __pyx_n_s_col); if (unlikely(!__pyx_tuple__80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__80);
  __Pyx_GIVEREF(__pyx_tuple__80);
  __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_resize, 138, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":146
 *     ''' forward input iterator '''
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("Scanner::__iter__")
 * 
 */
  __pyx_tuple__82 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__82);
  __Pyx_GIVEREF(__pyx_tuple__82);
  __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_iter, 146, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":150
 * 
 *     # deprecated
 *     def assign(self, value, termenc):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("Scanner::assign")
 * 
 */
  __pyx_tuple__84 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_value, __pyx_n_s_termenc); if (unlikely(!__pyx_tuple__84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__84);
  __Pyx_GIVEREF(__pyx_tuple__84);
  __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_assign, 150, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":153
 *         raise NotImplementedError("Scanner::assign")
 * 
 *     def continuous_assign(self, value, termenc):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("Scanner::continuous_assign")
 * 
 */
  __pyx_tuple__86 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_value, __pyx_n_s_termenc); if (unlikely(!__pyx_tuple__86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__86);
  __Pyx_GIVEREF(__pyx_tuple__86);
  __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_continuous_assign, 153, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":161
 *     ''' abstruct TTY output stream '''
 * 
 *     def write(self, c):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("OutputStream::write")
 * 
 */
  __pyx_tuple__88 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_c); if (unlikely(!__pyx_tuple__88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__88);
  __Pyx_GIVEREF(__pyx_tuple__88);
  __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_write, 161, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":164
 *         raise NotImplementedError("OutputStream::write")
 * 
 *     def flush(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("OutputStream::flush")
 * 
 */
  __pyx_tuple__90 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);
  __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_flush, 164, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":172
 *     ''' Dispatch interface of terminal sequence event oriented parser '''
 * 
 *     def dispatch_esc(self, prefix, final):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventDispatcher::dispatch_esc")
 * 
 */
  __pyx_tuple__92 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_prefix, __pyx_n_s_final); if (unlikely(!__pyx_tuple__92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);
  __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_dispatch_esc, 172, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":175
 *         raise NotImplementedError("EventDispatcher::dispatch_esc")
 * 
 *     def dispatch_csi(self, prefix, params, final):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventDispatcher::dispatch_csi")
 * 
 */
  __pyx_tuple__94 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_prefix, __pyx_n_s_params, __pyx_n_s_final); if (unlikely(!__pyx_tuple__94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__94);
  __Pyx_GIVEREF(__pyx_tuple__94);
  __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_dispatch_csi, 175, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":178
 *         raise NotImplementedError("EventDispatcher::dispatch_csi")
 * 
 *     def dispatch_control_string(self, prefix, value):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventDispatcher::dispatch_control_string")
 * 
 */
  __pyx_tuple__96 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_prefix, __pyx_n_s_value); if (unlikely(!__pyx_tuple__96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__96);
  __Pyx_GIVEREF(__pyx_tuple__96);
  __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_dispatch_control_string, 178, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":181
 *         raise NotImplementedError("EventDispatcher::dispatch_control_string")
 * 
 *     def dispatch_char(self, c):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventDispatcher::dispatch_char")
 * 
 */
  __pyx_tuple__98 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_c); if (unlikely(!__pyx_tuple__98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__98);
  __Pyx_GIVEREF(__pyx_tuple__98);
  __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_dispatch_char, 181, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":189
 *     ''' abstruct Parser '''
 * 
 *     def parse(self, context):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("Parser::parse")
 * 
 */
  __pyx_tuple__100 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_context); if (unlikely(!__pyx_tuple__100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__100);
  __Pyx_GIVEREF(__pyx_tuple__100);
  __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_parse, 189, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":197
 *     ''' abstruct PTY device '''
 * 
 *     def fitsize(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("PTY::fitsize")
 * 
 */
  __pyx_tuple__102 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__102);
  __Pyx_GIVEREF(__pyx_tuple__102);
  __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__102, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_fitsize, 197, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":200
 *         raise NotImplementedError("PTY::fitsize")
 * 
 *     def resize(self, height, width):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("PTY::resize")
 * 
 */
  __pyx_tuple__104 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_height, __pyx_n_s_width); if (unlikely(!__pyx_tuple__104)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__104);
  __Pyx_GIVEREF(__pyx_tuple__104);
  __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__104, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_resize, 200, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":203
 *         raise NotImplementedError("PTY::resize")
 * 
 *     def read(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("PTY::read")
 * 
 */
  __pyx_tuple__106 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__106)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__106);
  __Pyx_GIVEREF(__pyx_tuple__106);
  __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__106, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_read, 203, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":206
 *         raise NotImplementedError("PTY::read")
 * 
 *     def write(self, data):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("PTY::write")
 * 
 */
  __pyx_tuple__108 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__108)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__108);
  __Pyx_GIVEREF(__pyx_tuple__108);
  __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_write, 206, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":209
 *         raise NotImplementedError("PTY::write")
 * 
 *     def xon(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("PTY::xon")
 * 
 */
  __pyx_tuple__110 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__110)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__110);
  __Pyx_GIVEREF(__pyx_tuple__110);
  __pyx_codeobj__111 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__110, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_xon, 209, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__111)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":212
 *         raise NotImplementedError("PTY::xon")
 * 
 *     def xoff(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("PTY::xoff")
 * 
 */
  __pyx_tuple__112 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__112)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__112);
  __Pyx_GIVEREF(__pyx_tuple__112);
  __pyx_codeobj__113 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__112, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_xoff, 212, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__113)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":215
 *         raise NotImplementedError("PTY::xoff")
 * 
 *     def drive(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("PTY::drive")
 * 
 */
  __pyx_tuple__114 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__114)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__114);
  __Pyx_GIVEREF(__pyx_tuple__114);
  __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_drive, 215, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":229
 *     class _MockContext:
 * 
 *         def __init__(self):             # <<<<<<<<<<<<<<
 *             self.output = []
 * 
 */
  __pyx_tuple__116 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__116)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__116);
  __Pyx_GIVEREF(__pyx_tuple__116);
  __pyx_codeobj__117 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__116, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_init, 229, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":232
 *             self.output = []
 * 
 *         def __iter__(self):             # <<<<<<<<<<<<<<
 *             for i in [1, 2, 3, 4, 5]:
 *                 yield i
 */
  __pyx_tuple__118 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_i); if (unlikely(!__pyx_tuple__118)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__118);
  __Pyx_GIVEREF(__pyx_tuple__118);
  __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__118, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_iter, 232, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":236
 *                 yield i
 * 
 *         def dispatch_char(self, c):             # <<<<<<<<<<<<<<
 *             self.output.append(c)
 * 
 */
  __pyx_tuple__120 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_c); if (unlikely(!__pyx_tuple__120)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__120);
  __Pyx_GIVEREF(__pyx_tuple__120);
  __pyx_codeobj__121 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__120, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_dispatch_char, 236, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__121)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":239
 *             self.output.append(c)
 * 
 *     def parse(self, context):             # <<<<<<<<<<<<<<
 *         """
 *         >>> parser = SimpleParser()
 */
  __pyx_tuple__122 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_c); if (unlikely(!__pyx_tuple__122)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__122);
  __Pyx_GIVEREF(__pyx_tuple__122);
  __pyx_codeobj__123 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__122, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_parse, 239, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__123)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":270
 * class _MockHandler:
 * 
 *     def handle_csi(self, context, parameter, intermediate, final):             # <<<<<<<<<<<<<<
 *         print (parameter, intermediate, final)
 * 
 */
  __pyx_tuple__124 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_parameter, __pyx_n_s_intermediate, __pyx_n_s_final); if (unlikely(!__pyx_tuple__124)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__124);
  __Pyx_GIVEREF(__pyx_tuple__124);
  __pyx_codeobj__125 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__124, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_csi, 270, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__125)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":273
 *         print (parameter, intermediate, final)
 * 
 *     def handle_esc(self, context, intermediate, final):             # <<<<<<<<<<<<<<
 *         print (intermediate, final)
 * 
 */
  __pyx_tuple__126 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_intermediate, __pyx_n_s_final); if (unlikely(!__pyx_tuple__126)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__126);
  __Pyx_GIVEREF(__pyx_tuple__126);
  __pyx_codeobj__127 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__126, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_esc, 273, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__127)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":276
 *         print (intermediate, final)
 * 
 *     def handle_control_string(self, context, prefix, value):             # <<<<<<<<<<<<<<
 *         print (prefix, value)
 * 
 */
  __pyx_tuple__128 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_prefix, __pyx_n_s_value); if (unlikely(!__pyx_tuple__128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__128);
  __Pyx_GIVEREF(__pyx_tuple__128);
  __pyx_codeobj__129 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__128, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_control_string, 276, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__129)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":279
 *         print (prefix, value)
 * 
 *     def handle_char(self, context, c):             # <<<<<<<<<<<<<<
 *         print (c)
 * 
 */
  __pyx_tuple__130 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_c); if (unlikely(!__pyx_tuple__130)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__130);
  __Pyx_GIVEREF(__pyx_tuple__130);
  __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_char, 279, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":287
 *     ''' parse ESC/CSI/string seqneces '''
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.reset()
 * 
 */
  __pyx_tuple__132 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__132)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__132);
  __Pyx_GIVEREF(__pyx_tuple__132);
  __pyx_codeobj__133 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_init, 287, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__133)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":290
 *         self.reset()
 * 
 *     def init(self, context):             # <<<<<<<<<<<<<<
 *         self.__context = context
 * 
 */
  __pyx_tuple__134 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_context); if (unlikely(!__pyx_tuple__134)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__134);
  __Pyx_GIVEREF(__pyx_tuple__134);
  __pyx_codeobj__135 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_init_2, 290, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__135)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":293
 *         self.__context = context
 * 
 *     def state_is_esc(self):             # <<<<<<<<<<<<<<
 *         return self.__state != _STATE_GROUND
 * 
 */
  __pyx_tuple__136 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__136)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__136);
  __Pyx_GIVEREF(__pyx_tuple__136);
  __pyx_codeobj__137 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__136, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_state_is_esc, 293, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__137)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":296
 *         return self.__state != _STATE_GROUND
 * 
 *     def flush(self):             # <<<<<<<<<<<<<<
 *         pbytes = self.__pbytes
 *         ibytes = self.__ibytes
 */
  __pyx_tuple__138 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_pbytes, __pyx_n_s_ibytes, __pyx_n_s_state, __pyx_n_s_context); if (unlikely(!__pyx_tuple__138)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__138);
  __Pyx_GIVEREF(__pyx_tuple__138);
  __pyx_codeobj__139 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__138, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_flush, 296, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__139)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":310
 *             context.dispatch_invalid([0x1b, 0x5b] + ibytes + pbytes)
 * 
 *     def reset(self):             # <<<<<<<<<<<<<<
 *         self.__state = _STATE_GROUND
 *         self.__pbytes = []
 */
  __pyx_tuple__140 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__140)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__140);
  __Pyx_GIVEREF(__pyx_tuple__140);
  __pyx_codeobj__141 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__140, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_reset, 310, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__141)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":315
 *         self.__ibytes = []
 * 
 *     def parse(self, data):             # <<<<<<<<<<<<<<
 * 
 *         context = self.__context
 */
  __pyx_tuple__142 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_data, __pyx_n_s_context, __pyx_n_s_pbytes, __pyx_n_s_ibytes, __pyx_n_s_state, __pyx_n_s_c, __pyx_n_s_seq); if (unlikely(!__pyx_tuple__142)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__142);
  __Pyx_GIVEREF(__pyx_tuple__142);
  __pyx_codeobj__143 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__142, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_parse, 315, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__143)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":601
 *     ''' scan input stream and iterate UCS code points '''
 * 
 *     def __init__(self, ucs4=True, termenc=None):             # <<<<<<<<<<<<<<
 *         """
 *         >>> scanner = DefaultScanner()
 */
  __pyx_tuple__144 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_ucs4, __pyx_n_s_termenc); if (unlikely(!__pyx_tuple__144)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__144);
  __Pyx_GIVEREF(__pyx_tuple__144);
  __pyx_codeobj__145 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__144, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_init, 601, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__145)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_tuple__146 = PyTuple_Pack(2, ((PyObject *)Py_True), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__146)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__146);
  __Pyx_GIVEREF(__pyx_tuple__146);

  /* "ctff.pyx":617
 * 
 *     # deprecated
 *     def assign(self, value, termenc):             # <<<<<<<<<<<<<<
 *         """
 *         >>> scanner = DefaultScanner()
 */
  __pyx_tuple__147 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_value, __pyx_n_s_termenc); if (unlikely(!__pyx_tuple__147)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__147);
  __Pyx_GIVEREF(__pyx_tuple__147);
  __pyx_codeobj__148 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__147, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_assign, 617, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__148)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":629
 *         self._data = self._decoder.decode(value)
 * 
 *     def continuous_assign(self, value):             # <<<<<<<<<<<<<<
 *         """
 *         >>> scanner = DefaultScanner(termenc="utf-8")
 */
  __pyx_tuple__149 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__149)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__149);
  __Pyx_GIVEREF(__pyx_tuple__149);
  __pyx_codeobj__150 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__149, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_continuous_assign, 629, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__150)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":638
 *         self._data = self._decoder.decode(value)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         >>> scanner = DefaultScanner()
 */
  __pyx_tuple__151 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_c1_2, __pyx_n_s_x, __pyx_n_s_c); if (unlikely(!__pyx_tuple__151)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__151);
  __Pyx_GIVEREF(__pyx_tuple__151);
  __pyx_codeobj__152 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__151, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_iter, 638, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__152)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":669
 *     ''' default handler, pass through all ESC/CSI/string seqnceses '''
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
  __pyx_tuple__153 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__153)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__153);
  __Pyx_GIVEREF(__pyx_tuple__153);
  __pyx_codeobj__154 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_init, 669, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__154)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":673
 * 
 * # EventObserver
 *     def handle_start(self, context):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
  __pyx_tuple__155 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_context); if (unlikely(!__pyx_tuple__155)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__155);
  __Pyx_GIVEREF(__pyx_tuple__155);
  __pyx_codeobj__156 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_start, 673, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__156)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":676
 *         pass
 * 
 *     def handle_end(self, context):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
  __pyx_tuple__157 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_context); if (unlikely(!__pyx_tuple__157)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__157);
  __Pyx_GIVEREF(__pyx_tuple__157);
  __pyx_codeobj__158 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__157, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_end, 676, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__158)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":679
 *         pass
 * 
 *     def handle_esc(self, context, intermediate, final):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
  __pyx_tuple__159 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_intermediate, __pyx_n_s_final); if (unlikely(!__pyx_tuple__159)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__159);
  __Pyx_GIVEREF(__pyx_tuple__159);
  __pyx_codeobj__160 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__159, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_esc, 679, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__160)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":682
 *         return False
 * 
 *     def handle_csi(self, context, parameter, intermediate, final):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
  __pyx_tuple__161 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_parameter, __pyx_n_s_intermediate, __pyx_n_s_final); if (unlikely(!__pyx_tuple__161)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__161);
  __Pyx_GIVEREF(__pyx_tuple__161);
  __pyx_codeobj__162 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__161, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_csi, 682, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__162)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":685
 *         return False
 * 
 *     def handle_ss2(self, context, final):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
  __pyx_tuple__163 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_final); if (unlikely(!__pyx_tuple__163)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__163);
  __Pyx_GIVEREF(__pyx_tuple__163);
  __pyx_codeobj__164 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__163, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_ss2, 685, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__164)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":688
 *         return False
 * 
 *     def handle_ss3(self, context, final):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
  __pyx_tuple__165 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_final); if (unlikely(!__pyx_tuple__165)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__165);
  __Pyx_GIVEREF(__pyx_tuple__165);
  __pyx_codeobj__166 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__165, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_ss3, 688, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__166)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":691
 *         return False
 * 
 *     def handle_control_string(self, context, prefix, value):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
  __pyx_tuple__167 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_prefix, __pyx_n_s_value); if (unlikely(!__pyx_tuple__167)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__167);
  __Pyx_GIVEREF(__pyx_tuple__167);
  __pyx_codeobj__168 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__167, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_control_string, 691, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__168)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":694
 *         return False
 * 
 *     def handle_char(self, context, c):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
  __pyx_tuple__169 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_c); if (unlikely(!__pyx_tuple__169)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__169);
  __Pyx_GIVEREF(__pyx_tuple__169);
  __pyx_codeobj__170 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__169, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_char, 694, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__170)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":697
 *         return False
 * 
 *     def handle_invalid(self, context, seq):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
  __pyx_tuple__171 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_seq); if (unlikely(!__pyx_tuple__171)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__171);
  __Pyx_GIVEREF(__pyx_tuple__171);
  __pyx_codeobj__172 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__171, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_invalid, 697, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__172)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":700
 *         return False
 * 
 *     def handle_draw(self, context):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
  __pyx_tuple__173 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_context); if (unlikely(!__pyx_tuple__173)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__173);
  __Pyx_GIVEREF(__pyx_tuple__173);
  __pyx_codeobj__174 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__173, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_draw, 700, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__174)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":703
 *         pass
 * 
 *     def handle_resize(self, context, row, col):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
  __pyx_tuple__175 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_row, __pyx_n_s_col); if (unlikely(!__pyx_tuple__175)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__175);
  __Pyx_GIVEREF(__pyx_tuple__175);
  __pyx_codeobj__176 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__175, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_resize, 703, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__176)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":713
 * class FilterMultiplexer(EventObserver):
 * 
 *     def __init__(self, lhs, rhs):             # <<<<<<<<<<<<<<
 *         self.__lhs = lhs
 *         self.__rhs = rhs
 */
  __pyx_tuple__177 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_lhs, __pyx_n_s_rhs); if (unlikely(!__pyx_tuple__177)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__177);
  __Pyx_GIVEREF(__pyx_tuple__177);
  __pyx_codeobj__178 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__177, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_init, 713, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__178)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":717
 *         self.__rhs = rhs
 * 
 *     def get_lhs(self):             # <<<<<<<<<<<<<<
 *         return self.__lhs
 * 
 */
  __pyx_tuple__179 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__179)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__179);
  __Pyx_GIVEREF(__pyx_tuple__179);
  __pyx_codeobj__180 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__179, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_get_lhs, 717, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__180)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":720
 *         return self.__lhs
 * 
 *     def get_rhs(self):             # <<<<<<<<<<<<<<
 *         return self.__rhs
 * 
 */
  __pyx_tuple__181 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__181)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__181);
  __Pyx_GIVEREF(__pyx_tuple__181);
  __pyx_codeobj__182 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__181, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_get_rhs, 720, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__182)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":723
 *         return self.__rhs
 * 
 *     def handle_start(self, context):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_start(context)
 *         handled_rhs = self.__rhs.handle_start(context)
 */
  __pyx_tuple__183 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_handled_lhs, __pyx_n_s_handled_rhs); if (unlikely(!__pyx_tuple__183)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__183);
  __Pyx_GIVEREF(__pyx_tuple__183);
  __pyx_codeobj__184 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__183, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_start, 723, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__184)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":728
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_end(self, context):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_end(context)
 *         handled_rhs = self.__rhs.handle_end(context)
 */
  __pyx_tuple__185 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_handled_lhs, __pyx_n_s_handled_rhs); if (unlikely(!__pyx_tuple__185)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__185);
  __Pyx_GIVEREF(__pyx_tuple__185);
  __pyx_codeobj__186 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__185, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_end, 728, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__186)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":733
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_flush(self, context):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_flush(context)
 *         handled_rhs = self.__rhs.handle_flush(context)
 */
  __pyx_tuple__187 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_handled_lhs, __pyx_n_s_handled_rhs); if (unlikely(!__pyx_tuple__187)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__187);
  __Pyx_GIVEREF(__pyx_tuple__187);
  __pyx_codeobj__188 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__187, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_flush, 733, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__188)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":738
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_csi(self, context, params, intermediate, final):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_csi(context, params,
 *                                             intermediate, final)
 */
  __pyx_tuple__189 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_params, __pyx_n_s_intermediate, __pyx_n_s_final, __pyx_n_s_handled_lhs, __pyx_n_s_handled_rhs); if (unlikely(!__pyx_tuple__189)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__189);
  __Pyx_GIVEREF(__pyx_tuple__189);
  __pyx_codeobj__190 = (PyObject*)__Pyx_PyCode_New(5, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__189, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_csi, 738, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__190)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":745
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_esc(self, context, intermediate, final):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_esc(context, intermediate, final)
 *         handled_rhs = self.__rhs.handle_esc(context, intermediate, final)
 */
  __pyx_tuple__191 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_intermediate, __pyx_n_s_final, __pyx_n_s_handled_lhs, __pyx_n_s_handled_rhs); if (unlikely(!__pyx_tuple__191)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__191);
  __Pyx_GIVEREF(__pyx_tuple__191);
  __pyx_codeobj__192 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__191, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_esc, 745, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__192)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":750
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_ss2(self, context, final):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_ss2(context, final)
 *         handled_rhs = self.__rhs.handle_ss2(context, final)
 */
  __pyx_tuple__193 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_final, __pyx_n_s_handled_lhs, __pyx_n_s_handled_rhs); if (unlikely(!__pyx_tuple__193)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__193);
  __Pyx_GIVEREF(__pyx_tuple__193);
  __pyx_codeobj__194 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__193, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_ss2, 750, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__194)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":755
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_ss3(self, context, final):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_ss3(context, final)
 *         handled_rhs = self.__rhs.handle_ss3(context, final)
 */
  __pyx_tuple__195 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_final, __pyx_n_s_handled_lhs, __pyx_n_s_handled_rhs); if (unlikely(!__pyx_tuple__195)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__195);
  __Pyx_GIVEREF(__pyx_tuple__195);
  __pyx_codeobj__196 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__195, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_ss3, 755, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__196)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":760
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_control_string(self, context, prefix, value):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_control_string(context, prefix, value)
 *         handled_rhs = self.__rhs.handle_control_string(context, prefix, value)
 */
  __pyx_tuple__197 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_prefix, __pyx_n_s_value, __pyx_n_s_handled_lhs, __pyx_n_s_handled_rhs); if (unlikely(!__pyx_tuple__197)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__197);
  __Pyx_GIVEREF(__pyx_tuple__197);
  __pyx_codeobj__198 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__197, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_control_string, 760, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__198)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":765
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_char(self, context, c):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_char(context, c)
 *         handled_rhs = self.__rhs.handle_char(context, c)
 */
  __pyx_tuple__199 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_c, __pyx_n_s_handled_lhs, __pyx_n_s_handled_rhs); if (unlikely(!__pyx_tuple__199)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__199);
  __Pyx_GIVEREF(__pyx_tuple__199);
  __pyx_codeobj__200 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__199, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_char, 765, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__200)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":770
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_invalid(self, context, seq):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_invalid(context, seq)
 *         handled_rhs = self.__rhs.handle_invalid(context, seq)
 */
  __pyx_tuple__201 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_seq, __pyx_n_s_handled_lhs, __pyx_n_s_handled_rhs); if (unlikely(!__pyx_tuple__201)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__201);
  __Pyx_GIVEREF(__pyx_tuple__201);
  __pyx_codeobj__202 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__201, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_invalid, 770, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__202)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":775
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_draw(self, context):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_draw(context)
 *         handled_rhs = self.__rhs.handle_draw(context)
 */
  __pyx_tuple__203 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_handled_lhs, __pyx_n_s_handled_rhs); if (unlikely(!__pyx_tuple__203)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__203);
  __Pyx_GIVEREF(__pyx_tuple__203);
  __pyx_codeobj__204 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__203, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_draw, 775, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__204)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":780
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_resize(self, context, row, col):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_resize(context, row, col)
 *         handled_rhs = self.__rhs.handle_resize(context, row, col)
 */
  __pyx_tuple__205 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_row, __pyx_n_s_col, __pyx_n_s_handled_lhs, __pyx_n_s_handled_rhs); if (unlikely(!__pyx_tuple__205)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__205);
  __Pyx_GIVEREF(__pyx_tuple__205);
  __pyx_codeobj__206 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__205, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_handle_resize, 780, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__206)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":792
 * class ParseContext(OutputStream, EventDispatcher):
 * 
 *     def __init__(self,             # <<<<<<<<<<<<<<
 *                  output,
 *                  termenc='UTF-8',
 */
  __pyx_tuple__207 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_output, __pyx_n_s_termenc, __pyx_n_s_scanner, __pyx_n_s_handler, __pyx_n_s_buffering, __pyx_n_s_StringIO); if (unlikely(!__pyx_tuple__207)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__207);
  __Pyx_GIVEREF(__pyx_tuple__207);
  __pyx_codeobj__208 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__207, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_init, 792, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__208)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":819
 *         self._buffering = buffering
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self.__scanner.__iter__()
 * 
 */
  __pyx_tuple__209 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__209)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__209);
  __Pyx_GIVEREF(__pyx_tuple__209);
  __pyx_codeobj__210 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__209, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_iter, 819, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__210)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":822
 *         return self.__scanner.__iter__()
 * 
 *     def assign(self, data):             # <<<<<<<<<<<<<<
 *         self.__scanner.assign(data, self.__termenc)
 *         if self._buffering:
 */
  __pyx_tuple__211 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__211)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__211);
  __Pyx_GIVEREF(__pyx_tuple__211);
  __pyx_codeobj__212 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__211, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_assign, 822, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__212)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":827
 *             self._output.truncate(0)
 * 
 *     def sethandler(self, handler):             # <<<<<<<<<<<<<<
 *         self.__handler = handler
 * 
 */
  __pyx_tuple__213 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_handler); if (unlikely(!__pyx_tuple__213)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__213);
  __Pyx_GIVEREF(__pyx_tuple__213);
  __pyx_codeobj__214 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__213, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_sethandler, 827, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__214)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":830
 *         self.__handler = handler
 * 
 *     def putu(self, data):             # <<<<<<<<<<<<<<
 *         self._output.write(data)
 * 
 */
  __pyx_tuple__215 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__215)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__215);
  __Pyx_GIVEREF(__pyx_tuple__215);
  __pyx_codeobj__216 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__215, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_putu, 830, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__216)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":833
 *         self._output.write(data)
 * 
 *     def puts(self, data):             # <<<<<<<<<<<<<<
 *         self._target_output.write(data)
 * 
 */
  __pyx_tuple__217 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__217)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__217);
  __Pyx_GIVEREF(__pyx_tuple__217);
  __pyx_codeobj__218 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__217, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_puts, 833, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__218)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":836
 *         self._target_output.write(data)
 * 
 *     def put(self, c):             # <<<<<<<<<<<<<<
 *         if c < 0x80:
 *             self._output.write(chr(c))
 */
  __pyx_tuple__219 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_c, __pyx_n_s_c1_2, __pyx_n_s_c2); if (unlikely(!__pyx_tuple__219)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__219);
  __Pyx_GIVEREF(__pyx_tuple__219);
  __pyx_codeobj__220 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__219, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_put, 836, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__220)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":854
 * 
 *     # obsoluted!!
 *     def writestring(self, data):             # <<<<<<<<<<<<<<
 *         try:
 *             self._target_output.write(data)
 */
  __pyx_tuple__221 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__221)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__221);
  __Pyx_GIVEREF(__pyx_tuple__221);
  __pyx_codeobj__222 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__221, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_writestring, 854, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__222)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":862
 * # OutputStream
 *     # obsoluted!!
 *     def write(self, c):             # <<<<<<<<<<<<<<
 *         self.put(c)
 * 
 */
  __pyx_tuple__223 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_c); if (unlikely(!__pyx_tuple__223)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__223);
  __Pyx_GIVEREF(__pyx_tuple__223);
  __pyx_codeobj__224 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__223, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_write, 862, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__224)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":865
 *         self.put(c)
 * 
 *     def flush(self):             # <<<<<<<<<<<<<<
 *         if self._buffering:
 *             self._target_output.write(self._output)
 */
  __pyx_tuple__225 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__225)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__225);
  __Pyx_GIVEREF(__pyx_tuple__225);
  __pyx_codeobj__226 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__225, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_flush, 865, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__226)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":874
 * 
 * # EventDispatcher
 *     def dispatch_esc(self, intermediate, final):             # <<<<<<<<<<<<<<
 *         if not self.__handler.handle_esc(self, intermediate, final):
 *             self.put(0x1b)  # ESC
 */
  __pyx_tuple__227 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_intermediate, __pyx_n_s_final, __pyx_n_s_c); if (unlikely(!__pyx_tuple__227)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__227);
  __Pyx_GIVEREF(__pyx_tuple__227);
  __pyx_codeobj__228 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__227, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_dispatch_esc, 874, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__228)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":881
 *             self.put(final)
 * 
 *     def dispatch_csi(self, parameter, intermediate, final):             # <<<<<<<<<<<<<<
 *         if not self.__handler.handle_csi(self, parameter, intermediate, final):
 *             self.put(0x1b)  # ESC
 */
  __pyx_tuple__229 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_parameter, __pyx_n_s_intermediate, __pyx_n_s_final, __pyx_n_s_c); if (unlikely(!__pyx_tuple__229)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__229);
  __Pyx_GIVEREF(__pyx_tuple__229);
  __pyx_codeobj__230 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__229, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_dispatch_csi, 881, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__230)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":891
 *             self.put(final)
 * 
 *     def dispatch_ss2(self, final):             # <<<<<<<<<<<<<<
 *         if not self.__handler.handle_ss2(self, final):
 *             self.put(0x1b)  # ESC
 */
  __pyx_tuple__231 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_final); if (unlikely(!__pyx_tuple__231)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__231);
  __Pyx_GIVEREF(__pyx_tuple__231);
  __pyx_codeobj__232 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__231, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_dispatch_ss2, 891, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__232)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":897
 *             self.put(final)
 * 
 *     def dispatch_ss3(self, final):             # <<<<<<<<<<<<<<
 *         if not self.__handler.handle_ss3(self, final):
 *             self.put(0x1b)  # ESC
 */
  __pyx_tuple__233 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_final); if (unlikely(!__pyx_tuple__233)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__233);
  __Pyx_GIVEREF(__pyx_tuple__233);
  __pyx_codeobj__234 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__233, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_dispatch_ss3, 897, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__234)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":903
 *             self.put(final)
 * 
 *     def dispatch_control_string(self, prefix, value):             # <<<<<<<<<<<<<<
 *         if not self.__handler.handle_control_string(self, prefix, value):
 *             self.put(0x1b)  # ESC
 */
  __pyx_tuple__235 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_prefix, __pyx_n_s_value, __pyx_n_s_c); if (unlikely(!__pyx_tuple__235)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__235);
  __Pyx_GIVEREF(__pyx_tuple__235);
  __pyx_codeobj__236 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__235, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_dispatch_control_string, 903, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__236)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":912
 *             self.put(0x5c)  # \
 * 
 *     def dispatch_char(self, c):             # <<<<<<<<<<<<<<
 *         if not self.__handler.handle_char(self, c):
 *             self.put(c)
 */
  __pyx_tuple__237 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_c); if (unlikely(!__pyx_tuple__237)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__237);
  __Pyx_GIVEREF(__pyx_tuple__237);
  __pyx_codeobj__238 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__237, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_dispatch_char, 912, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__238)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":916
 *             self.put(c)
 * 
 *     def dispatch_invalid(self, seq):             # <<<<<<<<<<<<<<
 *         if not self.__handler.handle_invalid(self, seq):
 *             for c in seq:
 */
  __pyx_tuple__239 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_seq, __pyx_n_s_c); if (unlikely(!__pyx_tuple__239)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__239);
  __Pyx_GIVEREF(__pyx_tuple__239);
  __pyx_codeobj__240 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__239, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_dispatch_invalid, 916, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__240)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":928
 * class DefaultPTY(PTY):
 * 
 *     def __init__(self, term, lang, command, stdin, row=None, col=None):             # <<<<<<<<<<<<<<
 *         self._stdin_fileno = stdin.fileno()
 *         backup = termios.tcgetattr(self._stdin_fileno)
 */
  __pyx_tuple__241 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_term, __pyx_n_s_lang, __pyx_n_s_command, __pyx_n_s_stdin, __pyx_n_s_row, __pyx_n_s_col, __pyx_n_s_backup, __pyx_n_s_pid, __pyx_n_s_master_2); if (unlikely(!__pyx_tuple__241)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__241);
  __Pyx_GIVEREF(__pyx_tuple__241);
  __pyx_codeobj__242 = (PyObject*)__Pyx_PyCode_New(7, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__241, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_init, 928, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__242)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_tuple__243 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__243)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__243);
  __Pyx_GIVEREF(__pyx_tuple__243);

  /* "ctff.pyx":945
 *             self.resize(row, col)
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         #self.restore_term()
 *         try:
 */
  __pyx_tuple__244 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_e); if (unlikely(!__pyx_tuple__244)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__244);
  __Pyx_GIVEREF(__pyx_tuple__244);
  __pyx_codeobj__245 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__244, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_close, 945, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__245)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":953
 *             logging.info("DefaultPTY.close: master=%d" % self._master)
 * 
 *     def restore_term(self):             # <<<<<<<<<<<<<<
 *         termios.tcsetattr(self._stdin_fileno,
 *                           termios.TCSANOW,
 */
  __pyx_tuple__246 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__246)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__246);
  __Pyx_GIVEREF(__pyx_tuple__246);
  __pyx_codeobj__247 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__246, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_restore_term, 953, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__247)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":958
 *                           self._backup_termios)
 * 
 *     def __setupterm(self, fd):             # <<<<<<<<<<<<<<
 *         term = termios.tcgetattr(fd)
 * 
 */
  __pyx_tuple__248 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_fd, __pyx_n_s_term, __pyx_n_s_c_cflag, __pyx_n_s_c_lflag, __pyx_n_s_vdisable, __pyx_n_s_VDSUSP, __pyx_n_s_c_cc); if (unlikely(!__pyx_tuple__248)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__248);
  __Pyx_GIVEREF(__pyx_tuple__248);
  __pyx_codeobj__249 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__248, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_setupterm, 958, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__249)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1009
 *         termios.tcsetattr(fd, termios.TCSANOW, term)
 * 
 *     def __resize_impl(self, winsize):             # <<<<<<<<<<<<<<
 *         fcntl.ioctl(self._master, termios.TIOCSWINSZ, winsize)
 *         # notify Application process that terminal size has been changed.
 */
  __pyx_tuple__250 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_winsize); if (unlikely(!__pyx_tuple__250)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__250);
  __Pyx_GIVEREF(__pyx_tuple__250);
  __pyx_codeobj__251 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__250, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_resize_impl, 1009, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__251)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1014
 *         os.kill(self.pid, signal.SIGWINCH)
 * 
 *     def fitsize(self):             # <<<<<<<<<<<<<<
 *         winsize = fcntl.ioctl(self._stdin_fileno, termios.TIOCGWINSZ, 'hhhh')
 *         height, width = struct.unpack('hh', winsize)
 */
  __pyx_tuple__252 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_winsize, __pyx_n_s_height, __pyx_n_s_width); if (unlikely(!__pyx_tuple__252)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__252);
  __Pyx_GIVEREF(__pyx_tuple__252);
  __pyx_codeobj__253 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__252, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_fitsize, 1014, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__253)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1020
 *         return height, width
 * 
 *     def resize(self, height, width):             # <<<<<<<<<<<<<<
 *         winsize = struct.pack('HHHH', height, width, 0, 0)
 *         self.__resize_impl(winsize)
 */
  __pyx_tuple__254 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_height, __pyx_n_s_width, __pyx_n_s_winsize); if (unlikely(!__pyx_tuple__254)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__254);
  __Pyx_GIVEREF(__pyx_tuple__254);
  __pyx_codeobj__255 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__254, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_resize, 1020, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__255)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1025
 *         return height, width
 * 
 *     def fileno(self):             # <<<<<<<<<<<<<<
 *         return self._master
 * 
 */
  __pyx_tuple__256 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__256)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__256);
  __Pyx_GIVEREF(__pyx_tuple__256);
  __pyx_codeobj__257 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__256, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_fileno, 1025, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__257)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1028
 *         return self._master
 * 
 *     def stdin_fileno(self):             # <<<<<<<<<<<<<<
 *         return self._stdin_fileno
 * 
 */
  __pyx_tuple__258 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__258)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__258);
  __Pyx_GIVEREF(__pyx_tuple__258);
  __pyx_codeobj__259 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__258, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_stdin_fileno_2, 1028, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__259)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1031
 *         return self._stdin_fileno
 * 
 *     def read(self):             # <<<<<<<<<<<<<<
 *         return os.read(self._master, _BUFFER_SIZE)
 * 
 */
  __pyx_tuple__260 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__260)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__260);
  __Pyx_GIVEREF(__pyx_tuple__260);
  __pyx_codeobj__261 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__260, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_read, 1031, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__261)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1034
 *         return os.read(self._master, _BUFFER_SIZE)
 * 
 *     def write(self, data):             # <<<<<<<<<<<<<<
 *         os.write(self._master, data)
 * 
 */
  __pyx_tuple__262 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__262)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__262);
  __Pyx_GIVEREF(__pyx_tuple__262);
  __pyx_codeobj__263 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__262, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_write, 1034, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__263)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1037
 *         os.write(self._master, data)
 * 
 *     def flush(self):             # <<<<<<<<<<<<<<
 *         pass
 *         #os.fsync(self._master)
 */
  __pyx_tuple__264 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__264)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__264);
  __Pyx_GIVEREF(__pyx_tuple__264);
  __pyx_codeobj__265 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__264, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_flush, 1037, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__265)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1041
 *         #os.fsync(self._master)
 * 
 *     def xoff(self):             # <<<<<<<<<<<<<<
 *         #fcntl.ioctl(self._master, termios.TIOCSTOP, 0)
 *         termios.tcflow(self._master, termios.TCOOFF)
 */
  __pyx_tuple__266 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__266)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__266);
  __Pyx_GIVEREF(__pyx_tuple__266);
  __pyx_codeobj__267 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__266, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_xoff, 1041, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__267)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1045
 *         termios.tcflow(self._master, termios.TCOOFF)
 * 
 *     def xon(self):             # <<<<<<<<<<<<<<
 *         #fcntl.ioctl(self._master, termios.TIOCSTART, 0)
 *         termios.tcflow(self._master, termios.TCOON)
 */
  __pyx_tuple__268 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__268)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__268);
  __Pyx_GIVEREF(__pyx_tuple__268);
  __pyx_codeobj__269 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__268, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_xon, 1045, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__269)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1052
 * class MockParseContext(ParseContext):
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         from StringIO import StringIO
 *         output = StringIO()
 */
  __pyx_tuple__270 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_StringIO, __pyx_n_s_output); if (unlikely(!__pyx_tuple__270)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__270);
  __Pyx_GIVEREF(__pyx_tuple__270);
  __pyx_codeobj__271 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__270, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_init, 1052, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__271)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1067
 *     _esc_timer = None
 * 
 *     def __init__(self, tty):             # <<<<<<<<<<<<<<
 *         self._tty = tty
 * 
 */
  __pyx_tuple__272 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_tty); if (unlikely(!__pyx_tuple__272)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__272);
  __Pyx_GIVEREF(__pyx_tuple__272);
  __pyx_codeobj__273 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__272, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_init, 1067, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__273)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1070
 *         self._tty = tty
 * 
 *     def start(self, termenc,             # <<<<<<<<<<<<<<
 *               inputhandler, outputhandler,
 *               inputparser, outputparser,
 */
  __pyx_tuple__274 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_termenc, __pyx_n_s_inputhandler, __pyx_n_s_outputhandler, __pyx_n_s_inputparser, __pyx_n_s_outputparser, __pyx_n_s_inputscanner, __pyx_n_s_outputscanner, __pyx_n_s_buffering, __pyx_n_s_stdout, __pyx_n_s_inputcontext_2, __pyx_n_s_outputcontext_2); if (unlikely(!__pyx_tuple__274)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__274);
  __Pyx_GIVEREF(__pyx_tuple__274);
  __pyx_codeobj__275 = (PyObject*)__Pyx_PyCode_New(10, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__274, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_start, 1070, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__275)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1100
 *         outputhandler.handle_start(outputcontext)
 * 
 *     def getpid(self):             # <<<<<<<<<<<<<<
 *         return self._tty.pid
 * 
 */
  __pyx_tuple__276 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__276)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__276);
  __Pyx_GIVEREF(__pyx_tuple__276);
  __pyx_codeobj__277 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__276, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_getpid, 1100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__277)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1103
 *         return self._tty.pid
 * 
 *     def is_alive(self):             # <<<<<<<<<<<<<<
 *         return self._tty is not None
 * 
 */
  __pyx_tuple__278 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__278)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__278);
  __Pyx_GIVEREF(__pyx_tuple__278);
  __pyx_codeobj__279 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__278, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_is_alive, 1103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__279)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1106
 *         return self._tty is not None
 * 
 *     def fileno(self):             # <<<<<<<<<<<<<<
 *         return self._tty.fileno()
 * 
 */
  __pyx_tuple__280 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__280)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__280);
  __Pyx_GIVEREF(__pyx_tuple__280);
  __pyx_codeobj__281 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__280, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_fileno, 1106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__281)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1109
 *         return self._tty.fileno()
 * 
 *     def stdin_fileno(self):             # <<<<<<<<<<<<<<
 *         return self._tty.stdin_fileno()
 * 
 */
  __pyx_tuple__282 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__282)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__282);
  __Pyx_GIVEREF(__pyx_tuple__282);
  __pyx_codeobj__283 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__282, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_stdin_fileno_2, 1109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__283)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1112
 *         return self._tty.stdin_fileno()
 * 
 *     def read(self):             # <<<<<<<<<<<<<<
 *         return self._tty.read()
 * 
 */
  __pyx_tuple__284 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__284)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__284);
  __Pyx_GIVEREF(__pyx_tuple__284);
  __pyx_codeobj__285 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__284, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_read, 1112, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__285)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1115
 *         return self._tty.read()
 * 
 *     def write(self, data):             # <<<<<<<<<<<<<<
 *         self._tty.write(data)
 * 
 */
  __pyx_tuple__286 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__286)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__286);
  __Pyx_GIVEREF(__pyx_tuple__286);
  __pyx_codeobj__287 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__286, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_write, 1115, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__287)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1118
 *         self._tty.write(data)
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         tty = self._tty
 *         if tty is not None:
 */
  __pyx_tuple__288 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_tty); if (unlikely(!__pyx_tuple__288)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__288);
  __Pyx_GIVEREF(__pyx_tuple__288);
  __pyx_codeobj__289 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__288, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_close, 1118, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__289)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1124
 *             self._tty = None
 * 
 *     def end(self):             # <<<<<<<<<<<<<<
 *         self._inputhandler.handle_end(self._outputcontext)
 *         self._outputhandler.handle_end(self._outputcontext)
 */
  __pyx_tuple__290 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__290)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__290);
  __Pyx_GIVEREF(__pyx_tuple__290);
  __pyx_codeobj__291 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__290, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_end, 1124, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__291)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1128
 *         self._outputhandler.handle_end(self._outputcontext)
 * 
 *     def resize(self, row, col):             # <<<<<<<<<<<<<<
 *         self._tty.resize(row, col)
 * 
 */
  __pyx_tuple__292 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_row, __pyx_n_s_col); if (unlikely(!__pyx_tuple__292)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__292);
  __Pyx_GIVEREF(__pyx_tuple__292);
  __pyx_codeobj__293 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__292, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_resize, 1128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__293)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1131
 *         self._tty.resize(row, col)
 * 
 *     def fitsize(self):             # <<<<<<<<<<<<<<
 *         return self._tty.fitsize()
 * 
 */
  __pyx_tuple__294 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__294)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__294);
  __Pyx_GIVEREF(__pyx_tuple__294);
  __pyx_codeobj__295 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__294, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_fitsize, 1131, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__295)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1134
 *         return self._tty.fitsize()
 * 
 *     def on_write(self, data):             # <<<<<<<<<<<<<<
 *         self._inputparser.parse(data)
 * 
 */
  __pyx_tuple__296 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__296)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__296);
  __Pyx_GIVEREF(__pyx_tuple__296);
  __pyx_codeobj__297 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__296, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_on_write, 1134, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__297)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1137
 *         self._inputparser.parse(data)
 * 
 *     def process_start(self):             # <<<<<<<<<<<<<<
 *         self._inputhandler.handle_start(self._inputcontext)
 *         self._outputhandler.handle_start(self._outputcontext)
 */
  __pyx_tuple__298 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__298)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__298);
  __Pyx_GIVEREF(__pyx_tuple__298);
  __pyx_codeobj__299 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__298, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_process_start, 1137, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__299)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1145
 *         self._outputcontext.flush()
 * 
 *     def process_end(self):             # <<<<<<<<<<<<<<
 *         self._inputhandler.handle_end(self._inputcontext)
 *         self._outputhandler.handle_end(self._outputcontext)
 */
  __pyx_tuple__300 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__300)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__300);
  __Pyx_GIVEREF(__pyx_tuple__300);
  __pyx_codeobj__301 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__300, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_process_end, 1145, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__301)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1149
 *         self._outputhandler.handle_end(self._outputcontext)
 * 
 *     def process_resize(self, row, col):             # <<<<<<<<<<<<<<
 *         try:
 *             self._inputhandler.handle_resize(self._inputcontext, row, col)
 */
  __pyx_tuple__302 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_row, __pyx_n_s_col); if (unlikely(!__pyx_tuple__302)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__302);
  __Pyx_GIVEREF(__pyx_tuple__302);
  __pyx_codeobj__303 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__302, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_process_resize, 1149, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__303)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1156
 *             self._resized = False
 * 
 *     def process_input(self, data):             # <<<<<<<<<<<<<<
 *         if not self._esc_timer is None:
 *             self._esc_timer.cancel()
 */
  __pyx_tuple__304 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_data, __pyx_n_s_dispatch_esc, __pyx_n_s_dispatch_esc); if (unlikely(!__pyx_tuple__304)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__304);
  __Pyx_GIVEREF(__pyx_tuple__304);
  __pyx_codeobj__305 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__304, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_process_input, 1156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__305)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1180
 *             self._esc_timer.start()
 * 
 *     def process_output(self, data):             # <<<<<<<<<<<<<<
 *         self._outputparser.parse(data)
 *         if not self._outputparser.state_is_esc():
 */
  __pyx_tuple__306 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__306)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__306);
  __Pyx_GIVEREF(__pyx_tuple__306);
  __pyx_codeobj__307 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__306, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_process_output, 1180, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__307)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1188
 *             self._outputcontext.flush()
 * 
 *     def on_read(self, data):             # <<<<<<<<<<<<<<
 *         self._outputparser.parse(data)
 * 
 */
  __pyx_tuple__308 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__308)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__308);
  __Pyx_GIVEREF(__pyx_tuple__308);
  __pyx_codeobj__309 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__308, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_on_read, 1188, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__309)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1191
 *         self._outputparser.parse(data)
 * 
 *     def drain(self):             # <<<<<<<<<<<<<<
 *         self._inputparser.reset()
 *         self._inputcontext.assign('')
 */
  __pyx_tuple__310 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__310)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__310);
  __Pyx_GIVEREF(__pyx_tuple__310);
  __pyx_codeobj__311 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__310, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_drain, 1191, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__311)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1202
 * class Session:
 * 
 *     def __init__(self, tty):             # <<<<<<<<<<<<<<
 * 
 *         self._alive = True
 */
  __pyx_tuple__312 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_tty, __pyx_n_s_stdin_fileno_2); if (unlikely(!__pyx_tuple__312)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__312);
  __Pyx_GIVEREF(__pyx_tuple__312);
  __pyx_codeobj__313 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__312, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_init, 1202, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__313)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1214
 * 
 *     # deprecated
 *     def add_subtty(self, term, lang,             # <<<<<<<<<<<<<<
 *                    command, row, col,
 *                    termenc,
 */
  __pyx_tuple__314 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_term, __pyx_n_s_lang, __pyx_n_s_command, __pyx_n_s_row, __pyx_n_s_col, __pyx_n_s_termenc, __pyx_n_s_inputhandler, __pyx_n_s_outputhandler); if (unlikely(!__pyx_tuple__314)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__314);
  __Pyx_GIVEREF(__pyx_tuple__314);
  __pyx_codeobj__315 = (PyObject*)__Pyx_PyCode_New(9, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__314, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_add_subtty, 1214, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__315)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1222
 *                                    termenc, inputhandler, outputhandler)
 * 
 *     def create_process(self, term, lang,             # <<<<<<<<<<<<<<
 *                        command, row, col,
 *                        termenc,
 */
  __pyx_tuple__316 = PyTuple_Pack(16, __pyx_n_s_self, __pyx_n_s_term, __pyx_n_s_lang, __pyx_n_s_command, __pyx_n_s_row, __pyx_n_s_col, __pyx_n_s_termenc, __pyx_n_s_inputhandler, __pyx_n_s_outputhandler, __pyx_n_s_inputparser, __pyx_n_s_outputparser, __pyx_n_s_inputscanner, __pyx_n_s_outputscanner, __pyx_n_s_buffering, __pyx_n_s_tty, __pyx_n_s_process); if (unlikely(!__pyx_tuple__316)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__316);
  __Pyx_GIVEREF(__pyx_tuple__316);
  __pyx_codeobj__317 = (PyObject*)__Pyx_PyCode_New(14, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__316, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_create_process, 1222, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__317)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1244
 *         return process
 * 
 *     def getactiveprocess(self):             # <<<<<<<<<<<<<<
 *         return self._input_target
 * 
 */
  __pyx_tuple__318 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__318)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__318);
  __Pyx_GIVEREF(__pyx_tuple__318);
  __pyx_codeobj__319 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__318, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_getactiveprocess, 1244, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__319)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1247
 *         return self._input_target
 * 
 *     def process_is_active(self, process):             # <<<<<<<<<<<<<<
 *         return self._input_target == process
 * 
 */
  __pyx_tuple__320 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_process); if (unlikely(!__pyx_tuple__320)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__320);
  __Pyx_GIVEREF(__pyx_tuple__320);
  __pyx_codeobj__321 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__320, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_process_is_active, 1247, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__321)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1250
 *         return self._input_target == process
 * 
 *     def focus_process(self, process):             # <<<<<<<<<<<<<<
 *         if process.is_alive():
 *             logging.info("Switching focus: fileno=%d" % process.fileno())
 */
  __pyx_tuple__322 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_process); if (unlikely(!__pyx_tuple__322)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__322);
  __Pyx_GIVEREF(__pyx_tuple__322);
  __pyx_codeobj__323 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__322, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_focus_process, 1250, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__323)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1256
 *             self._input_target = process
 * 
 *     def blur_process(self):             # <<<<<<<<<<<<<<
 *         process = self._mainprocess
 *         if process.is_alive():
 */
  __pyx_tuple__324 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_process, __pyx_n_s_template); if (unlikely(!__pyx_tuple__324)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__324);
  __Pyx_GIVEREF(__pyx_tuple__324);
  __pyx_codeobj__325 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__324, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_blur_process, 1256, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__325)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1264
 *             self._input_target = process
 * 
 *     def destruct_process(self, process):             # <<<<<<<<<<<<<<
 *         fd = process.fileno()
 *         if fd in self._rfds:
 */
  __pyx_tuple__326 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_process, __pyx_n_s_fd); if (unlikely(!__pyx_tuple__326)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__326);
  __Pyx_GIVEREF(__pyx_tuple__326);
  __pyx_codeobj__327 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__326, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_destruct_process, 1264, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__327)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1277
 *         self._mainprocess.process_output("")
 * 
 *     def drive(self):             # <<<<<<<<<<<<<<
 * 
 *         def onresize(no, frame):
 */
  __pyx_tuple__328 = PyTuple_Pack(17, __pyx_n_s_self, __pyx_n_s_onresize, __pyx_n_s_onresize, __pyx_n_s_stdin_fileno_2, __pyx_n_s_rfd, __pyx_n_s_wfd, __pyx_n_s_xfd, __pyx_n_s_fd, __pyx_n_s_process, __pyx_n_s_row, __pyx_n_s_col, __pyx_n_s_data, __pyx_n_s_target_fd, __pyx_n_s_process_map_2, __pyx_n_s_e, __pyx_n_s_no, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__328)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__328);
  __Pyx_GIVEREF(__pyx_tuple__328);
  __pyx_codeobj__329 = (PyObject*)__Pyx_PyCode_New(1, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__328, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_drive, 1277, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__329)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1358
 *                     process.close()
 * 
 *     def start(self,             # <<<<<<<<<<<<<<
 *               termenc,
 *               stdin=sys.stdin,
 */
  __pyx_tuple__330 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_termenc, __pyx_n_s_stdin, __pyx_n_s_stdout, __pyx_n_s_inputscanner, __pyx_n_s_inputparser, __pyx_n_s_inputhandler, __pyx_n_s_outputscanner, __pyx_n_s_outputparser, __pyx_n_s_outputhandler, __pyx_n_s_buffering, __pyx_n_s_mainprocess_2, __pyx_n_s_onclose, __pyx_n_s_onclose); if (unlikely(!__pyx_tuple__330)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__330);
  __Pyx_GIVEREF(__pyx_tuple__330);
  __pyx_codeobj__331 = (PyObject*)__Pyx_PyCode_New(11, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__330, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_start, 1358, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__331)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1394
 *         self.drive()
 * 
 *     def _init_process(self,             # <<<<<<<<<<<<<<
 *                       process,
 *                       termenc,
 */
  __pyx_tuple__332 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_process, __pyx_n_s_termenc, __pyx_n_s_inputhandler, __pyx_n_s_outputhandler, __pyx_n_s_inputparser, __pyx_n_s_outputparser, __pyx_n_s_inputscanner, __pyx_n_s_outputscanner, __pyx_n_s_buffering, __pyx_n_s_fd); if (unlikely(!__pyx_tuple__332)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__332);
  __Pyx_GIVEREF(__pyx_tuple__332);
  __pyx_codeobj__333 = (PyObject*)__Pyx_PyCode_New(10, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__332, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_init_process, 1394, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__333)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1418
 * 
 * 
 * def _test():             # <<<<<<<<<<<<<<
 *     import doctest
 *     doctest.testmod()
 */
  __pyx_tuple__334 = PyTuple_Pack(1, __pyx_n_s_doctest); if (unlikely(!__pyx_tuple__334)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__334);
  __Pyx_GIVEREF(__pyx_tuple__334);
  __pyx_codeobj__335 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__334, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_ctff_pyx, __pyx_n_s_test, 1418, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__335)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1438
 *                 for name, member in inspect.getmembers(member):
 *                     if inspect.ismethod(member):
 *                         if name.startswith("__") or name[0] != "_":             # <<<<<<<<<<<<<<
 *                             argspec = inspect.getargspec(member)
 *                             args, varargs, keywords, defaultvalue = argspec
 */
  __pyx_tuple__338 = PyTuple_Pack(1, __pyx_n_s__337); if (unlikely(!__pyx_tuple__338)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__338);
  __Pyx_GIVEREF(__pyx_tuple__338);
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_float_0_5 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_float_0_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_float_0_6 = PyFloat_FromDouble(0.6); if (unlikely(!__pyx_float_0_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_9 = PyInt_FromLong(9); if (unlikely(!__pyx_int_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_11 = PyInt_FromLong(11); if (unlikely(!__pyx_int_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_14 = PyInt_FromLong(14); if (unlikely(!__pyx_int_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_24 = PyInt_FromLong(24); if (unlikely(!__pyx_int_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_26 = PyInt_FromLong(26); if (unlikely(!__pyx_int_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_27 = PyInt_FromLong(27); if (unlikely(!__pyx_int_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_31 = PyInt_FromLong(31); if (unlikely(!__pyx_int_31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_47 = PyInt_FromLong(47); if (unlikely(!__pyx_int_47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_63 = PyInt_FromLong(63); if (unlikely(!__pyx_int_63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_78 = PyInt_FromLong(78); if (unlikely(!__pyx_int_78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_79 = PyInt_FromLong(79); if (unlikely(!__pyx_int_79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_80 = PyInt_FromLong(80); if (unlikely(!__pyx_int_80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_88 = PyInt_FromLong(88); if (unlikely(!__pyx_int_88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_91 = PyInt_FromLong(91); if (unlikely(!__pyx_int_91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_92 = PyInt_FromLong(92); if (unlikely(!__pyx_int_92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_93 = PyInt_FromLong(93); if (unlikely(!__pyx_int_93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_94 = PyInt_FromLong(94); if (unlikely(!__pyx_int_94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_95 = PyInt_FromLong(95); if (unlikely(!__pyx_int_95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_126 = PyInt_FromLong(126); if (unlikely(!__pyx_int_126)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_127 = PyInt_FromLong(127); if (unlikely(!__pyx_int_127)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_128 = PyInt_FromLong(128); if (unlikely(!__pyx_int_128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_1023 = PyInt_FromLong(1023); if (unlikely(!__pyx_int_1023)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_8192 = PyInt_FromLong(8192); if (unlikely(!__pyx_int_8192)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_55296 = PyInt_FromLong(55296L); if (unlikely(!__pyx_int_55296)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_56319 = PyInt_FromLong(56319L); if (unlikely(!__pyx_int_56319)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_56320 = PyInt_FromLong(56320L); if (unlikely(!__pyx_int_56320)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_57343 = PyInt_FromLong(57343L); if (unlikely(!__pyx_int_57343)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_57344 = PyInt_FromLong(57344L); if (unlikely(!__pyx_int_57344)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_65536 = PyInt_FromLong(65536L); if (unlikely(!__pyx_int_65536)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initctff(void); /*proto*/
PyMODINIT_FUNC initctff(void)
#else
PyMODINIT_FUNC PyInit_ctff(void); /*proto*/
PyMODINIT_FUNC PyInit_ctff(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *(*__pyx_t_10)(PyObject *);
  Py_ssize_t __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  int __pyx_t_13;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #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("PyMODINIT_FUNC PyInit_ctff(void)", 0);
  if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __Pyx_CyFunction_USED
  if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("ctff"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  if (__pyx_module_is_main_ctff) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!PyDict_GetItemString(modules, "ctff")) {
      if (unlikely(PyDict_SetItemString(modules, "ctff", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_4ctff___pyx_scope_struct_2_process_input) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_4ctff___pyx_scope_struct_2_process_input.tp_print = 0;
  __pyx_ptype_4ctff___pyx_scope_struct_2_process_input = &__pyx_type_4ctff___pyx_scope_struct_2_process_input;
  if (PyType_Ready(&__pyx_type_4ctff___pyx_scope_struct_4_start) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_4ctff___pyx_scope_struct_4_start.tp_print = 0;
  __pyx_ptype_4ctff___pyx_scope_struct_4_start = &__pyx_type_4ctff___pyx_scope_struct_4_start;
  if (PyType_Ready(&__pyx_type_4ctff___pyx_scope_struct____iter__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_4ctff___pyx_scope_struct____iter__.tp_print = 0;
  __pyx_ptype_4ctff___pyx_scope_struct____iter__ = &__pyx_type_4ctff___pyx_scope_struct____iter__;
  if (PyType_Ready(&__pyx_type_4ctff___pyx_scope_struct_1___iter__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_4ctff___pyx_scope_struct_1___iter__.tp_print = 0;
  __pyx_ptype_4ctff___pyx_scope_struct_1___iter__ = &__pyx_type_4ctff___pyx_scope_struct_1___iter__;
  if (PyType_Ready(&__pyx_type_4ctff___pyx_scope_struct_3_drive) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_4ctff___pyx_scope_struct_3_drive.tp_print = 0;
  __pyx_ptype_4ctff___pyx_scope_struct_3_drive = &__pyx_type_4ctff___pyx_scope_struct_3_drive;
  /*--- Type import code ---*/
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "ctff.pyx":26
 * # ***** END LICENSE BLOCK *****
 * 
 * __author__ = "Hayaki Saito (user@zuse.jp)"             # <<<<<<<<<<<<<<
 * __version__ = "0.2.10"
 * __license__ = "MIT"
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_author, __pyx_kp_s_Hayaki_Saito_user_zuse_jp) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":27
 * 
 * __author__ = "Hayaki Saito (user@zuse.jp)"
 * __version__ = "0.2.10"             # <<<<<<<<<<<<<<
 * __license__ = "MIT"
 * signature = 'b87c36758a4c3d666c74490b383f483b'
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_kp_s_0_2_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":28
 * __author__ = "Hayaki Saito (user@zuse.jp)"
 * __version__ = "0.2.10"
 * __license__ = "MIT"             # <<<<<<<<<<<<<<
 * signature = 'b87c36758a4c3d666c74490b383f483b'
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_n_s_MIT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":29
 * __version__ = "0.2.10"
 * __license__ = "MIT"
 * signature = 'b87c36758a4c3d666c74490b383f483b'             # <<<<<<<<<<<<<<
 * 
 * import sys
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_signature, __pyx_n_s_b87c36758a4c3d666c74490b383f483b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":31
 * signature = 'b87c36758a4c3d666c74490b383f483b'
 * 
 * import sys             # <<<<<<<<<<<<<<
 * import os
 * import termios
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":32
 * 
 * import sys
 * import os             # <<<<<<<<<<<<<<
 * import termios
 * import pty
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":33
 * import sys
 * import os
 * import termios             # <<<<<<<<<<<<<<
 * import pty
 * import signal
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_termios, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_termios, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":34
 * import os
 * import termios
 * import pty             # <<<<<<<<<<<<<<
 * import signal
 * import fcntl
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pty, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pty, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":35
 * import termios
 * import pty
 * import signal             # <<<<<<<<<<<<<<
 * import fcntl
 * import struct
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_signal, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_signal, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":36
 * import pty
 * import signal
 * import fcntl             # <<<<<<<<<<<<<<
 * import struct
 * import select
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_fcntl, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_fcntl, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":37
 * import signal
 * import fcntl
 * import struct             # <<<<<<<<<<<<<<
 * import select
 * import errno
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_struct, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":38
 * import fcntl
 * import struct
 * import select             # <<<<<<<<<<<<<<
 * import errno
 * import codecs
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_select, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_select, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":39
 * import struct
 * import select
 * import errno             # <<<<<<<<<<<<<<
 * import codecs
 * import threading
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_errno, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_errno, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":40
 * import select
 * import errno
 * import codecs             # <<<<<<<<<<<<<<
 * import threading
 * import logging
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_codecs, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_codecs, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":41
 * import errno
 * import codecs
 * import threading             # <<<<<<<<<<<<<<
 * import logging
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_threading, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_threading, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":42
 * import codecs
 * import threading
 * import logging             # <<<<<<<<<<<<<<
 * 
 * _BUFFER_SIZE = 8192
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_logging, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_logging, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":44
 * import logging
 * 
 * _BUFFER_SIZE = 8192             # <<<<<<<<<<<<<<
 * _ESC_TIMEOUT = 0.5  # sec
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BUFFER_SIZE, __pyx_int_8192) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":45
 * 
 * _BUFFER_SIZE = 8192
 * _ESC_TIMEOUT = 0.5  # sec             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ESC_TIMEOUT, __pyx_float_0_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":52
 * # Exceptions
 * #
 * class NotHandledException(Exception):             # <<<<<<<<<<<<<<
 * 
 *     ''' thrown when an unknown seqnence is detected '''
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_Exception);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_Exception);
  __Pyx_GIVEREF(__pyx_builtin_Exception);
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_NotHandledException, __pyx_n_s_NotHandledException, (PyObject *) NULL, __pyx_n_s_ctff, __pyx_kp_s_thrown_when_an_unknown_seqnence); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);

  /* "ctff.pyx":56
 *     ''' thrown when an unknown seqnence is detected '''
 * 
 *     def __init__(self, value):             # <<<<<<<<<<<<<<
 *         """
 *         >>> e = NotHandledException("test1")
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_19NotHandledException_1__init__, 0, __pyx_n_s_NotHandledException___init, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":64
 *         self.value = value
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         """
 *         >>> e = NotHandledException("test2")
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_19NotHandledException_3__str__, 0, __pyx_n_s_NotHandledException___str, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_str, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":52
 * # Exceptions
 * #
 * class NotHandledException(Exception):             # <<<<<<<<<<<<<<
 * 
 *     ''' thrown when an unknown seqnence is detected '''
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_NotHandledException, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NotHandledException, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":73
 * 
 * 
 * class ParseException(Exception):             # <<<<<<<<<<<<<<
 * 
 *     ''' thrown when a parse error is detected '''
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_Exception);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_Exception);
  __Pyx_GIVEREF(__pyx_builtin_Exception);
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_ParseException, __pyx_n_s_ParseException, (PyObject *) NULL, __pyx_n_s_ctff, __pyx_kp_s_thrown_when_a_parse_error_is_de); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);

  /* "ctff.pyx":77
 *     ''' thrown when a parse error is detected '''
 * 
 *     def __init__(self, value):             # <<<<<<<<<<<<<<
 *         """
 *         >>> e = ParseException("test2")
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_14ParseException_1__init__, 0, __pyx_n_s_ParseException___init, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":85
 *         self.value = value
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         """
 *         >>> e = ParseException("test2")
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_14ParseException_3__str__, 0, __pyx_n_s_ParseException___str, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_str, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":73
 * 
 * 
 * class ParseException(Exception):             # <<<<<<<<<<<<<<
 * 
 *     ''' thrown when a parse error is detected '''
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ParseException, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ParseException, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":104
 * # - PTY
 * #
 * class EventObserver:             # <<<<<<<<<<<<<<
 * 
 *     ''' adapt to event driven ECMA-35/48 parser model '''
 */
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_EventObserver, __pyx_n_s_EventObserver, (PyObject *) NULL, __pyx_n_s_ctff, __pyx_kp_s_adapt_to_event_driven_ECMA_35_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "ctff.pyx":108
 *     ''' adapt to event driven ECMA-35/48 parser model '''
 * 
 *     def handle_start(self, context):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_start")
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_13EventObserver_1handle_start, 0, __pyx_n_s_EventObserver_handle_start_2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_handle_start, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":111
 *         raise NotImplementedError("EventObserver::handle_start")
 * 
 *     def handle_end(self, context):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_end")
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_13EventObserver_3handle_end, 0, __pyx_n_s_EventObserver_handle_end_2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_handle_end, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":114
 *         raise NotImplementedError("EventObserver::handle_end")
 * 
 *     def handle_csi(self, context, params, intermediate, final):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_csi")
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_13EventObserver_5handle_csi, 0, __pyx_n_s_EventObserver_handle_csi_2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_handle_csi, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":117
 *         raise NotImplementedError("EventObserver::handle_csi")
 * 
 *     def handle_esc(self, context, prefix, final):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_esc")
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_13EventObserver_7handle_esc, 0, __pyx_n_s_EventObserver_handle_esc_2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_handle_esc, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":120
 *         raise NotImplementedError("EventObserver::handle_esc")
 * 
 *     def handle_ss2(self, context, final):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_ss2")
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_13EventObserver_9handle_ss2, 0, __pyx_n_s_EventObserver_handle_ss2_2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_handle_ss2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":123
 *         raise NotImplementedError("EventObserver::handle_ss2")
 * 
 *     def handle_ss3(self, context, final):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_ss3")
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_13EventObserver_11handle_ss3, 0, __pyx_n_s_EventObserver_handle_ss3_2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_handle_ss3, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":126
 *         raise NotImplementedError("EventObserver::handle_ss3")
 * 
 *     def handle_control_string(self, context, prefix, value):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_control_string")
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_13EventObserver_13handle_control_string, 0, __pyx_n_s_EventObserver_handle_control_str_2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_handle_control_string, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":129
 *         raise NotImplementedError("EventObserver::handle_control_string")
 * 
 *     def handle_char(self, context, c):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_char")
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_13EventObserver_15handle_char, 0, __pyx_n_s_EventObserver_handle_char_2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_handle_char, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":132
 *         raise NotImplementedError("EventObserver::handle_char")
 * 
 *     def handle_invalid(self, context, seq):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_invalid")
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_13EventObserver_17handle_invalid, 0, __pyx_n_s_EventObserver_handle_invalid_2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_handle_invalid, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":135
 *         raise NotImplementedError("EventObserver::handle_invalid")
 * 
 *     def handle_draw(self, context):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_draw")
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_13EventObserver_19handle_draw, 0, __pyx_n_s_EventObserver_handle_draw_2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_handle_draw, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":138
 *         raise NotImplementedError("EventObserver::handle_draw")
 * 
 *     def handle_resize(self, context, row, col):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventObserver::handle_resize")
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_13EventObserver_21handle_resize, 0, __pyx_n_s_EventObserver_handle_resize_2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_handle_resize, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":104
 * # - PTY
 * #
 * class EventObserver:             # <<<<<<<<<<<<<<
 * 
 *     ''' adapt to event driven ECMA-35/48 parser model '''
 */
  __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_EventObserver, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EventObserver, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":142
 * 
 * 
 * class Scanner:             # <<<<<<<<<<<<<<
 * 
 *     ''' forward input iterator '''
 */
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Scanner, __pyx_n_s_Scanner, (PyObject *) NULL, __pyx_n_s_ctff, __pyx_kp_s_forward_input_iterator); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "ctff.pyx":146
 *     ''' forward input iterator '''
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("Scanner::__iter__")
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Scanner_1__iter__, 0, __pyx_n_s_Scanner___iter_2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_iter, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":150
 * 
 *     # deprecated
 *     def assign(self, value, termenc):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("Scanner::assign")
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Scanner_3assign, 0, __pyx_n_s_Scanner_assign_2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_assign, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":153
 *         raise NotImplementedError("Scanner::assign")
 * 
 *     def continuous_assign(self, value, termenc):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("Scanner::continuous_assign")
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Scanner_5continuous_assign, 0, __pyx_n_s_Scanner_continuous_assign_2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_continuous_assign, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":142
 * 
 * 
 * class Scanner:             # <<<<<<<<<<<<<<
 * 
 *     ''' forward input iterator '''
 */
  __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_Scanner, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Scanner, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":157
 * 
 * 
 * class OutputStream:             # <<<<<<<<<<<<<<
 * 
 *     ''' abstruct TTY output stream '''
 */
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_OutputStream, __pyx_n_s_OutputStream, (PyObject *) NULL, __pyx_n_s_ctff, __pyx_kp_s_abstruct_TTY_output_stream); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "ctff.pyx":161
 *     ''' abstruct TTY output stream '''
 * 
 *     def write(self, c):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("OutputStream::write")
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_12OutputStream_1write, 0, __pyx_n_s_OutputStream_write_2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__89)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_write, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":164
 *         raise NotImplementedError("OutputStream::write")
 * 
 *     def flush(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("OutputStream::flush")
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_12OutputStream_3flush, 0, __pyx_n_s_OutputStream_flush_2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_flush, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":157
 * 
 * 
 * class OutputStream:             # <<<<<<<<<<<<<<
 * 
 *     ''' abstruct TTY output stream '''
 */
  __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_OutputStream, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_OutputStream, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":168
 * 
 * 
 * class EventDispatcher:             # <<<<<<<<<<<<<<
 * 
 *     ''' Dispatch interface of terminal sequence event oriented parser '''
 */
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_EventDispatcher, __pyx_n_s_EventDispatcher, (PyObject *) NULL, __pyx_n_s_ctff, __pyx_kp_s_Dispatch_interface_of_terminal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "ctff.pyx":172
 *     ''' Dispatch interface of terminal sequence event oriented parser '''
 * 
 *     def dispatch_esc(self, prefix, final):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventDispatcher::dispatch_esc")
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_15EventDispatcher_1dispatch_esc, 0, __pyx_n_s_EventDispatcher_dispatch_esc_2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__93)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_dispatch_esc, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":175
 *         raise NotImplementedError("EventDispatcher::dispatch_esc")
 * 
 *     def dispatch_csi(self, prefix, params, final):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventDispatcher::dispatch_csi")
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_15EventDispatcher_3dispatch_csi, 0, __pyx_n_s_EventDispatcher_dispatch_csi_2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__95)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_dispatch_csi, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":178
 *         raise NotImplementedError("EventDispatcher::dispatch_csi")
 * 
 *     def dispatch_control_string(self, prefix, value):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventDispatcher::dispatch_control_string")
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_15EventDispatcher_5dispatch_control_string, 0, __pyx_n_s_EventDispatcher_dispatch_control_2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__97)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_dispatch_control_string, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":181
 *         raise NotImplementedError("EventDispatcher::dispatch_control_string")
 * 
 *     def dispatch_char(self, c):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("EventDispatcher::dispatch_char")
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_15EventDispatcher_7dispatch_char, 0, __pyx_n_s_EventDispatcher_dispatch_char_2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_dispatch_char, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":168
 * 
 * 
 * class EventDispatcher:             # <<<<<<<<<<<<<<
 * 
 *     ''' Dispatch interface of terminal sequence event oriented parser '''
 */
  __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_EventDispatcher, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EventDispatcher, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":185
 * 
 * 
 * class Parser:             # <<<<<<<<<<<<<<
 * 
 *     ''' abstruct Parser '''
 */
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Parser, __pyx_n_s_Parser, (PyObject *) NULL, __pyx_n_s_ctff, __pyx_kp_s_abstruct_Parser); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "ctff.pyx":189
 *     ''' abstruct Parser '''
 * 
 *     def parse(self, context):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("Parser::parse")
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_6Parser_1parse, 0, __pyx_n_s_Parser_parse_2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_parse, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":185
 * 
 * 
 * class Parser:             # <<<<<<<<<<<<<<
 * 
 *     ''' abstruct Parser '''
 */
  __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_Parser, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Parser, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":193
 * 
 * 
 * class PTY:             # <<<<<<<<<<<<<<
 * 
 *     ''' abstruct PTY device '''
 */
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_PTY, __pyx_n_s_PTY, (PyObject *) NULL, __pyx_n_s_ctff, __pyx_kp_s_abstruct_PTY_device); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "ctff.pyx":197
 *     ''' abstruct PTY device '''
 * 
 *     def fitsize(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("PTY::fitsize")
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_3PTY_1fitsize, 0, __pyx_n_s_PTY_fitsize_2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__103)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_fitsize, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":200
 *         raise NotImplementedError("PTY::fitsize")
 * 
 *     def resize(self, height, width):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("PTY::resize")
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_3PTY_3resize, 0, __pyx_n_s_PTY_resize_2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__105)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_resize, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":203
 *         raise NotImplementedError("PTY::resize")
 * 
 *     def read(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("PTY::read")
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_3PTY_5read, 0, __pyx_n_s_PTY_read_2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__107)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_read, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":206
 *         raise NotImplementedError("PTY::read")
 * 
 *     def write(self, data):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("PTY::write")
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_3PTY_7write, 0, __pyx_n_s_PTY_write_2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_write, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":209
 *         raise NotImplementedError("PTY::write")
 * 
 *     def xon(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("PTY::xon")
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_3PTY_9xon, 0, __pyx_n_s_PTY_xon_2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_xon, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":212
 *         raise NotImplementedError("PTY::xon")
 * 
 *     def xoff(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("PTY::xoff")
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_3PTY_11xoff, 0, __pyx_n_s_PTY_xoff_2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_xoff, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":215
 *         raise NotImplementedError("PTY::xoff")
 * 
 *     def drive(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("PTY::drive")
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_3PTY_13drive, 0, __pyx_n_s_PTY_drive_2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__115)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_drive, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":193
 * 
 * 
 * class PTY:             # <<<<<<<<<<<<<<
 * 
 *     ''' abstruct PTY device '''
 */
  __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_PTY, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PTY, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":223
 * # Simple Parser implementation
 * #
 * class SimpleParser(Parser):             # <<<<<<<<<<<<<<
 * 
 *     ''' simple parser, don't parse ESC/CSI/string seqneces '''
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Parser); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_SimpleParser, __pyx_n_s_SimpleParser, (PyObject *) NULL, __pyx_n_s_ctff, __pyx_kp_s_simple_parser_don_t_parse_ESC_C); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);

  /* "ctff.pyx":227
 *     ''' simple parser, don't parse ESC/CSI/string seqneces '''
 * 
 *     class _MockContext:             # <<<<<<<<<<<<<<
 * 
 *         def __init__(self):
 */
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_MockContext, __pyx_n_s_SimpleParser__MockContext, (PyObject *) NULL, __pyx_n_s_ctff, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);

  /* "ctff.pyx":229
 *     class _MockContext:
 * 
 *         def __init__(self):             # <<<<<<<<<<<<<<
 *             self.output = []
 * 
 */
  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_12_MockContext_1__init__, 0, __pyx_n_s_SimpleParser__MockContext___init, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_init, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ctff.pyx":232
 *             self.output = []
 * 
 *         def __iter__(self):             # <<<<<<<<<<<<<<
 *             for i in [1, 2, 3, 4, 5]:
 *                 yield i
 */
  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_12_MockContext_3__iter__, 0, __pyx_n_s_SimpleParser__MockContext___iter, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_iter, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ctff.pyx":236
 *                 yield i
 * 
 *         def dispatch_char(self, c):             # <<<<<<<<<<<<<<
 *             self.output.append(c)
 * 
 */
  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_12_MockContext_6dispatch_char, 0, __pyx_n_s_SimpleParser__MockContext_dispat, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__121)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_dispatch_char, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ctff.pyx":227
 *     ''' simple parser, don't parse ESC/CSI/string seqneces '''
 * 
 *     class _MockContext:             # <<<<<<<<<<<<<<
 * 
 *         def __init__(self):
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_MockContext, __pyx_empty_tuple, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_MockContext, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":239
 *             self.output.append(c)
 * 
 *     def parse(self, context):             # <<<<<<<<<<<<<<
 *         """
 *         >>> parser = SimpleParser()
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_12SimpleParser_1parse, 0, __pyx_n_s_SimpleParser_parse, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__123)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_parse, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":223
 * # Simple Parser implementation
 * #
 * class SimpleParser(Parser):             # <<<<<<<<<<<<<<
 * 
 *     ''' simple parser, don't parse ESC/CSI/string seqneces '''
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_SimpleParser, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SimpleParser, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":255
 * # Default Parser implementation
 * #
 * _STATE_GROUND = 0             # <<<<<<<<<<<<<<
 * _STATE_ESC = 1
 * _STATE_ESC_INTERMEDIATE = 2
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_STATE_GROUND, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":256
 * #
 * _STATE_GROUND = 0
 * _STATE_ESC = 1             # <<<<<<<<<<<<<<
 * _STATE_ESC_INTERMEDIATE = 2
 * _STATE_CSI_PARAMETER = 3
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_STATE_ESC, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":257
 * _STATE_GROUND = 0
 * _STATE_ESC = 1
 * _STATE_ESC_INTERMEDIATE = 2             # <<<<<<<<<<<<<<
 * _STATE_CSI_PARAMETER = 3
 * _STATE_CSI_INTERMEDIATE = 4
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_STATE_ESC_INTERMEDIATE, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":258
 * _STATE_ESC = 1
 * _STATE_ESC_INTERMEDIATE = 2
 * _STATE_CSI_PARAMETER = 3             # <<<<<<<<<<<<<<
 * _STATE_CSI_INTERMEDIATE = 4
 * _STATE_SS2 = 6
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_STATE_CSI_PARAMETER, __pyx_int_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":259
 * _STATE_ESC_INTERMEDIATE = 2
 * _STATE_CSI_PARAMETER = 3
 * _STATE_CSI_INTERMEDIATE = 4             # <<<<<<<<<<<<<<
 * _STATE_SS2 = 6
 * _STATE_SS3 = 7
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_STATE_CSI_INTERMEDIATE, __pyx_int_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":260
 * _STATE_CSI_PARAMETER = 3
 * _STATE_CSI_INTERMEDIATE = 4
 * _STATE_SS2 = 6             # <<<<<<<<<<<<<<
 * _STATE_SS3 = 7
 * _STATE_OSC = 8
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_STATE_SS2, __pyx_int_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":261
 * _STATE_CSI_INTERMEDIATE = 4
 * _STATE_SS2 = 6
 * _STATE_SS3 = 7             # <<<<<<<<<<<<<<
 * _STATE_OSC = 8
 * _STATE_OSC_ESC = 9
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_STATE_SS3, __pyx_int_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":262
 * _STATE_SS2 = 6
 * _STATE_SS3 = 7
 * _STATE_OSC = 8             # <<<<<<<<<<<<<<
 * _STATE_OSC_ESC = 9
 * _STATE_STR = 10
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_STATE_OSC, __pyx_int_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":263
 * _STATE_SS3 = 7
 * _STATE_OSC = 8
 * _STATE_OSC_ESC = 9             # <<<<<<<<<<<<<<
 * _STATE_STR = 10
 * _STATE_STR_ESC = 11
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_STATE_OSC_ESC, __pyx_int_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":264
 * _STATE_OSC = 8
 * _STATE_OSC_ESC = 9
 * _STATE_STR = 10             # <<<<<<<<<<<<<<
 * _STATE_STR_ESC = 11
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_STATE_STR, __pyx_int_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":265
 * _STATE_OSC_ESC = 9
 * _STATE_STR = 10
 * _STATE_STR_ESC = 11             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_STATE_STR_ESC, __pyx_int_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":268
 * 
 * 
 * class _MockHandler:             # <<<<<<<<<<<<<<
 * 
 *     def handle_csi(self, context, parameter, intermediate, final):
 */
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_MockHandler, __pyx_n_s_MockHandler, (PyObject *) NULL, __pyx_n_s_ctff, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);

  /* "ctff.pyx":270
 * class _MockHandler:
 * 
 *     def handle_csi(self, context, parameter, intermediate, final):             # <<<<<<<<<<<<<<
 *         print (parameter, intermediate, final)
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_12_MockHandler_1handle_csi, 0, __pyx_n_s_MockHandler_handle_csi, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__125)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_handle_csi, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":273
 *         print (parameter, intermediate, final)
 * 
 *     def handle_esc(self, context, intermediate, final):             # <<<<<<<<<<<<<<
 *         print (intermediate, final)
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_12_MockHandler_3handle_esc, 0, __pyx_n_s_MockHandler_handle_esc, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__127)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_handle_esc, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":276
 *         print (intermediate, final)
 * 
 *     def handle_control_string(self, context, prefix, value):             # <<<<<<<<<<<<<<
 *         print (prefix, value)
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_12_MockHandler_5handle_control_string, 0, __pyx_n_s_MockHandler_handle_control_stri, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__129)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_handle_control_string, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":279
 *         print (prefix, value)
 * 
 *     def handle_char(self, context, c):             # <<<<<<<<<<<<<<
 *         print (c)
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_12_MockHandler_7handle_char, 0, __pyx_n_s_MockHandler_handle_char, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__131)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_handle_char, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":268
 * 
 * 
 * class _MockHandler:             # <<<<<<<<<<<<<<
 * 
 *     def handle_csi(self, context, parameter, intermediate, final):
 */
  __pyx_t_1 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_MockHandler, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MockHandler, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":283
 * 
 * 
 * class DefaultParser(Parser):             # <<<<<<<<<<<<<<
 * 
 *     ''' parse ESC/CSI/string seqneces '''
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Parser); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_DefaultParser, __pyx_n_s_DefaultParser, (PyObject *) NULL, __pyx_n_s_ctff, __pyx_kp_s_parse_ESC_CSI_string_seqneces); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);

  /* "ctff.pyx":287
 *     ''' parse ESC/CSI/string seqneces '''
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.reset()
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_13DefaultParser_1__init__, 0, __pyx_n_s_DefaultParser___init, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__133)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":290
 *         self.reset()
 * 
 *     def init(self, context):             # <<<<<<<<<<<<<<
 *         self.__context = context
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_13DefaultParser_3init, 0, __pyx_n_s_DefaultParser_init, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__135)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init_2, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":293
 *         self.__context = context
 * 
 *     def state_is_esc(self):             # <<<<<<<<<<<<<<
 *         return self.__state != _STATE_GROUND
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_13DefaultParser_5state_is_esc, 0, __pyx_n_s_DefaultParser_state_is_esc, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__137)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_state_is_esc, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":296
 *         return self.__state != _STATE_GROUND
 * 
 *     def flush(self):             # <<<<<<<<<<<<<<
 *         pbytes = self.__pbytes
 *         ibytes = self.__ibytes
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_13DefaultParser_7flush, 0, __pyx_n_s_DefaultParser_flush, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__139)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_flush, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":310
 *             context.dispatch_invalid([0x1b, 0x5b] + ibytes + pbytes)
 * 
 *     def reset(self):             # <<<<<<<<<<<<<<
 *         self.__state = _STATE_GROUND
 *         self.__pbytes = []
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_13DefaultParser_9reset, 0, __pyx_n_s_DefaultParser_reset, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__141)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_reset, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":315
 *         self.__ibytes = []
 * 
 *     def parse(self, data):             # <<<<<<<<<<<<<<
 * 
 *         context = self.__context
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_13DefaultParser_11parse, 0, __pyx_n_s_DefaultParser_parse, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__143)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_parse, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":283
 * 
 * 
 * class DefaultParser(Parser):             # <<<<<<<<<<<<<<
 * 
 *     ''' parse ESC/CSI/string seqneces '''
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_DefaultParser, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DefaultParser, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":597
 * # Scanner implementation
 * #
 * class DefaultScanner(Scanner):             # <<<<<<<<<<<<<<
 * 
 *     ''' scan input stream and iterate UCS code points '''
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Scanner); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_DefaultScanner, __pyx_n_s_DefaultScanner, (PyObject *) NULL, __pyx_n_s_ctff, __pyx_kp_s_scan_input_stream_and_iterate_U); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);

  /* "ctff.pyx":601
 *     ''' scan input stream and iterate UCS code points '''
 * 
 *     def __init__(self, ucs4=True, termenc=None):             # <<<<<<<<<<<<<<
 *         """
 *         >>> scanner = DefaultScanner()
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_14DefaultScanner_1__init__, 0, __pyx_n_s_DefaultScanner___init, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__145)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__146);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":617
 * 
 *     # deprecated
 *     def assign(self, value, termenc):             # <<<<<<<<<<<<<<
 *         """
 *         >>> scanner = DefaultScanner()
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_14DefaultScanner_3assign, 0, __pyx_n_s_DefaultScanner_assign, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__148)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_assign, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":629
 *         self._data = self._decoder.decode(value)
 * 
 *     def continuous_assign(self, value):             # <<<<<<<<<<<<<<
 *         """
 *         >>> scanner = DefaultScanner(termenc="utf-8")
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_14DefaultScanner_5continuous_assign, 0, __pyx_n_s_DefaultScanner_continuous_assign, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__150)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_continuous_assign, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":638
 *         self._data = self._decoder.decode(value)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         >>> scanner = DefaultScanner()
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_14DefaultScanner_7__iter__, 0, __pyx_n_s_DefaultScanner___iter, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__152)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_iter, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":597
 * # Scanner implementation
 * #
 * class DefaultScanner(Scanner):             # <<<<<<<<<<<<<<
 * 
 *     ''' scan input stream and iterate UCS code points '''
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_DefaultScanner, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DefaultScanner, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":665
 * # Handler implementation
 * #
 * class DefaultHandler(EventObserver):             # <<<<<<<<<<<<<<
 * 
 *     ''' default handler, pass through all ESC/CSI/string seqnceses '''
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventObserver); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_DefaultHandler, __pyx_n_s_DefaultHandler, (PyObject *) NULL, __pyx_n_s_ctff, __pyx_kp_s_default_handler_pass_through_al); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);

  /* "ctff.pyx":669
 *     ''' default handler, pass through all ESC/CSI/string seqnceses '''
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_14DefaultHandler_1__init__, 0, __pyx_n_s_DefaultHandler___init, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__154)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":673
 * 
 * # EventObserver
 *     def handle_start(self, context):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_14DefaultHandler_3handle_start, 0, __pyx_n_s_DefaultHandler_handle_start, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__156)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_handle_start, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":676
 *         pass
 * 
 *     def handle_end(self, context):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_14DefaultHandler_5handle_end, 0, __pyx_n_s_DefaultHandler_handle_end, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__158)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_handle_end, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":679
 *         pass
 * 
 *     def handle_esc(self, context, intermediate, final):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_14DefaultHandler_7handle_esc, 0, __pyx_n_s_DefaultHandler_handle_esc, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__160)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_handle_esc, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":682
 *         return False
 * 
 *     def handle_csi(self, context, parameter, intermediate, final):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_14DefaultHandler_9handle_csi, 0, __pyx_n_s_DefaultHandler_handle_csi, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__162)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_handle_csi, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":685
 *         return False
 * 
 *     def handle_ss2(self, context, final):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_14DefaultHandler_11handle_ss2, 0, __pyx_n_s_DefaultHandler_handle_ss2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__164)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_handle_ss2, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":688
 *         return False
 * 
 *     def handle_ss3(self, context, final):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_14DefaultHandler_13handle_ss3, 0, __pyx_n_s_DefaultHandler_handle_ss3, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__166)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_handle_ss3, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":691
 *         return False
 * 
 *     def handle_control_string(self, context, prefix, value):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_14DefaultHandler_15handle_control_string, 0, __pyx_n_s_DefaultHandler_handle_control_st, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__168)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_handle_control_string, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":694
 *         return False
 * 
 *     def handle_char(self, context, c):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_14DefaultHandler_17handle_char, 0, __pyx_n_s_DefaultHandler_handle_char, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__170)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_handle_char, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":697
 *         return False
 * 
 *     def handle_invalid(self, context, seq):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_14DefaultHandler_19handle_invalid, 0, __pyx_n_s_DefaultHandler_handle_invalid, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__172)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_handle_invalid, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":700
 *         return False
 * 
 *     def handle_draw(self, context):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_14DefaultHandler_21handle_draw, 0, __pyx_n_s_DefaultHandler_handle_draw, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__174)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_handle_draw, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":703
 *         pass
 * 
 *     def handle_resize(self, context, row, col):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_14DefaultHandler_23handle_resize, 0, __pyx_n_s_DefaultHandler_handle_resize, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__176)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_handle_resize, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":665
 * # Handler implementation
 * #
 * class DefaultHandler(EventObserver):             # <<<<<<<<<<<<<<
 * 
 *     ''' default handler, pass through all ESC/CSI/string seqnceses '''
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_DefaultHandler, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DefaultHandler, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":711
 * # Multiplexer implementation
 * #
 * class FilterMultiplexer(EventObserver):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, lhs, rhs):
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventObserver); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_FilterMultiplexer, __pyx_n_s_FilterMultiplexer, (PyObject *) NULL, __pyx_n_s_ctff, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);

  /* "ctff.pyx":713
 * class FilterMultiplexer(EventObserver):
 * 
 *     def __init__(self, lhs, rhs):             # <<<<<<<<<<<<<<
 *         self.__lhs = lhs
 *         self.__rhs = rhs
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_17FilterMultiplexer_1__init__, 0, __pyx_n_s_FilterMultiplexer___init, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__178)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":717
 *         self.__rhs = rhs
 * 
 *     def get_lhs(self):             # <<<<<<<<<<<<<<
 *         return self.__lhs
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_17FilterMultiplexer_3get_lhs, 0, __pyx_n_s_FilterMultiplexer_get_lhs, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__180)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_get_lhs, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":720
 *         return self.__lhs
 * 
 *     def get_rhs(self):             # <<<<<<<<<<<<<<
 *         return self.__rhs
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_17FilterMultiplexer_5get_rhs, 0, __pyx_n_s_FilterMultiplexer_get_rhs, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__182)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_get_rhs, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":723
 *         return self.__rhs
 * 
 *     def handle_start(self, context):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_start(context)
 *         handled_rhs = self.__rhs.handle_start(context)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_17FilterMultiplexer_7handle_start, 0, __pyx_n_s_FilterMultiplexer_handle_start, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__184)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_handle_start, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":728
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_end(self, context):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_end(context)
 *         handled_rhs = self.__rhs.handle_end(context)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_17FilterMultiplexer_9handle_end, 0, __pyx_n_s_FilterMultiplexer_handle_end, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__186)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_handle_end, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":733
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_flush(self, context):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_flush(context)
 *         handled_rhs = self.__rhs.handle_flush(context)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_17FilterMultiplexer_11handle_flush, 0, __pyx_n_s_FilterMultiplexer_handle_flush, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__188)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_handle_flush, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":738
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_csi(self, context, params, intermediate, final):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_csi(context, params,
 *                                             intermediate, final)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_17FilterMultiplexer_13handle_csi, 0, __pyx_n_s_FilterMultiplexer_handle_csi, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__190)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_handle_csi, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":745
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_esc(self, context, intermediate, final):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_esc(context, intermediate, final)
 *         handled_rhs = self.__rhs.handle_esc(context, intermediate, final)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_17FilterMultiplexer_15handle_esc, 0, __pyx_n_s_FilterMultiplexer_handle_esc, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__192)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_handle_esc, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":750
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_ss2(self, context, final):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_ss2(context, final)
 *         handled_rhs = self.__rhs.handle_ss2(context, final)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_17FilterMultiplexer_17handle_ss2, 0, __pyx_n_s_FilterMultiplexer_handle_ss2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__194)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_handle_ss2, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":755
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_ss3(self, context, final):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_ss3(context, final)
 *         handled_rhs = self.__rhs.handle_ss3(context, final)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_17FilterMultiplexer_19handle_ss3, 0, __pyx_n_s_FilterMultiplexer_handle_ss3, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__196)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_handle_ss3, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":760
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_control_string(self, context, prefix, value):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_control_string(context, prefix, value)
 *         handled_rhs = self.__rhs.handle_control_string(context, prefix, value)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_17FilterMultiplexer_21handle_control_string, 0, __pyx_n_s_FilterMultiplexer_handle_control, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__198)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_handle_control_string, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":765
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_char(self, context, c):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_char(context, c)
 *         handled_rhs = self.__rhs.handle_char(context, c)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_17FilterMultiplexer_23handle_char, 0, __pyx_n_s_FilterMultiplexer_handle_char, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__200)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_handle_char, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":770
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_invalid(self, context, seq):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_invalid(context, seq)
 *         handled_rhs = self.__rhs.handle_invalid(context, seq)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_17FilterMultiplexer_25handle_invalid, 0, __pyx_n_s_FilterMultiplexer_handle_invalid, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__202)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_handle_invalid, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":775
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_draw(self, context):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_draw(context)
 *         handled_rhs = self.__rhs.handle_draw(context)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_17FilterMultiplexer_27handle_draw, 0, __pyx_n_s_FilterMultiplexer_handle_draw, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__204)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_handle_draw, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":780
 *         return handled_lhs and handled_rhs
 * 
 *     def handle_resize(self, context, row, col):             # <<<<<<<<<<<<<<
 *         handled_lhs = self.__lhs.handle_resize(context, row, col)
 *         handled_rhs = self.__rhs.handle_resize(context, row, col)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_17FilterMultiplexer_29handle_resize, 0, __pyx_n_s_FilterMultiplexer_handle_resize, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__206)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_handle_resize, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":711
 * # Multiplexer implementation
 * #
 * class FilterMultiplexer(EventObserver):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, lhs, rhs):
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_FilterMultiplexer, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FilterMultiplexer, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ctff.pyx":790
 * # Dispatcher implementation
 * #
 * class ParseContext(OutputStream, EventDispatcher):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self,
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_OutputStream); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventDispatcher); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_3, __pyx_n_s_ParseContext, __pyx_n_s_ParseContext, (PyObject *) NULL, __pyx_n_s_ctff, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);

  /* "ctff.pyx":792
 * class ParseContext(OutputStream, EventDispatcher):
 * 
 *     def __init__(self,             # <<<<<<<<<<<<<<
 *                  output,
 *                  termenc='UTF-8',
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_12ParseContext_1__init__, 0, __pyx_n_s_ParseContext___init, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__208)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults), 2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":795
 *                  output,
 *                  termenc='UTF-8',
 *                  scanner=DefaultScanner(),             # <<<<<<<<<<<<<<
 *                  handler=DefaultHandler(),
 *                  buffering=False):
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DefaultScanner); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_4)->__pyx_arg_scanner = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "ctff.pyx":796
 *                  termenc='UTF-8',
 *                  scanner=DefaultScanner(),
 *                  handler=DefaultHandler(),             # <<<<<<<<<<<<<<
 *                  buffering=False):
 *         self.__termenc = termenc
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_DefaultHandler); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_4)->__pyx_arg_handler = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_4ctff_12ParseContext_34__defaults__);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":819
 *         self._buffering = buffering
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self.__scanner.__iter__()
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_12ParseContext_3__iter__, 0, __pyx_n_s_ParseContext___iter, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__210)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_iter, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":822
 *         return self.__scanner.__iter__()
 * 
 *     def assign(self, data):             # <<<<<<<<<<<<<<
 *         self.__scanner.assign(data, self.__termenc)
 *         if self._buffering:
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_12ParseContext_5assign, 0, __pyx_n_s_ParseContext_assign, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__212)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_assign, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":827
 *             self._output.truncate(0)
 * 
 *     def sethandler(self, handler):             # <<<<<<<<<<<<<<
 *         self.__handler = handler
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_12ParseContext_7sethandler, 0, __pyx_n_s_ParseContext_sethandler, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__214)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_sethandler, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":830
 *         self.__handler = handler
 * 
 *     def putu(self, data):             # <<<<<<<<<<<<<<
 *         self._output.write(data)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_12ParseContext_9putu, 0, __pyx_n_s_ParseContext_putu, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__216)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_putu, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":833
 *         self._output.write(data)
 * 
 *     def puts(self, data):             # <<<<<<<<<<<<<<
 *         self._target_output.write(data)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_12ParseContext_11puts, 0, __pyx_n_s_ParseContext_puts, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__218)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_puts, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":836
 *         self._target_output.write(data)
 * 
 *     def put(self, c):             # <<<<<<<<<<<<<<
 *         if c < 0x80:
 *             self._output.write(chr(c))
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_12ParseContext_13put, 0, __pyx_n_s_ParseContext_put, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__220)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_put, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":854
 * 
 *     # obsoluted!!
 *     def writestring(self, data):             # <<<<<<<<<<<<<<
 *         try:
 *             self._target_output.write(data)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_12ParseContext_15writestring, 0, __pyx_n_s_ParseContext_writestring, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__222)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_writestring, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":862
 * # OutputStream
 *     # obsoluted!!
 *     def write(self, c):             # <<<<<<<<<<<<<<
 *         self.put(c)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_12ParseContext_17write, 0, __pyx_n_s_ParseContext_write, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__224)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_write, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":865
 *         self.put(c)
 * 
 *     def flush(self):             # <<<<<<<<<<<<<<
 *         if self._buffering:
 *             self._target_output.write(self._output)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_12ParseContext_19flush, 0, __pyx_n_s_ParseContext_flush, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__226)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_flush, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":874
 * 
 * # EventDispatcher
 *     def dispatch_esc(self, intermediate, final):             # <<<<<<<<<<<<<<
 *         if not self.__handler.handle_esc(self, intermediate, final):
 *             self.put(0x1b)  # ESC
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_12ParseContext_21dispatch_esc, 0, __pyx_n_s_ParseContext_dispatch_esc, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__228)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_dispatch_esc, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":881
 *             self.put(final)
 * 
 *     def dispatch_csi(self, parameter, intermediate, final):             # <<<<<<<<<<<<<<
 *         if not self.__handler.handle_csi(self, parameter, intermediate, final):
 *             self.put(0x1b)  # ESC
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_12ParseContext_23dispatch_csi, 0, __pyx_n_s_ParseContext_dispatch_csi, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__230)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_dispatch_csi, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":891
 *             self.put(final)
 * 
 *     def dispatch_ss2(self, final):             # <<<<<<<<<<<<<<
 *         if not self.__handler.handle_ss2(self, final):
 *             self.put(0x1b)  # ESC
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_12ParseContext_25dispatch_ss2, 0, __pyx_n_s_ParseContext_dispatch_ss2, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__232)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_dispatch_ss2, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":897
 *             self.put(final)
 * 
 *     def dispatch_ss3(self, final):             # <<<<<<<<<<<<<<
 *         if not self.__handler.handle_ss3(self, final):
 *             self.put(0x1b)  # ESC
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_12ParseContext_27dispatch_ss3, 0, __pyx_n_s_ParseContext_dispatch_ss3, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__234)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_dispatch_ss3, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":903
 *             self.put(final)
 * 
 *     def dispatch_control_string(self, prefix, value):             # <<<<<<<<<<<<<<
 *         if not self.__handler.handle_control_string(self, prefix, value):
 *             self.put(0x1b)  # ESC
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_12ParseContext_29dispatch_control_string, 0, __pyx_n_s_ParseContext_dispatch_control_st, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__236)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_dispatch_control_string, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":912
 *             self.put(0x5c)  # \
 * 
 *     def dispatch_char(self, c):             # <<<<<<<<<<<<<<
 *         if not self.__handler.handle_char(self, c):
 *             self.put(c)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_12ParseContext_31dispatch_char, 0, __pyx_n_s_ParseContext_dispatch_char, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__238)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_dispatch_char, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":916
 *             self.put(c)
 * 
 *     def dispatch_invalid(self, seq):             # <<<<<<<<<<<<<<
 *         if not self.__handler.handle_invalid(self, seq):
 *             for c in seq:
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_12ParseContext_33dispatch_invalid, 0, __pyx_n_s_ParseContext_dispatch_invalid, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__240)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_dispatch_invalid, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":790
 * # Dispatcher implementation
 * #
 * class ParseContext(OutputStream, EventDispatcher):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self,
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ParseContext, __pyx_t_3, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ParseContext, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __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;

  /* "ctff.pyx":926
 * # DefaultPTY
 * #
 * class DefaultPTY(PTY):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, term, lang, command, stdin, row=None, col=None):
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_PTY); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_1, __pyx_n_s_DefaultPTY, __pyx_n_s_DefaultPTY, (PyObject *) NULL, __pyx_n_s_ctff, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);

  /* "ctff.pyx":928
 * class DefaultPTY(PTY):
 * 
 *     def __init__(self, term, lang, command, stdin, row=None, col=None):             # <<<<<<<<<<<<<<
 *         self._stdin_fileno = stdin.fileno()
 *         backup = termios.tcgetattr(self._stdin_fileno)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_10DefaultPTY_1__init__, 0, __pyx_n_s_DefaultPTY___init, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__242)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__243);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":945
 *             self.resize(row, col)
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         #self.restore_term()
 *         try:
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_10DefaultPTY_3close, 0, __pyx_n_s_DefaultPTY_close, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__245)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_close, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":953
 *             logging.info("DefaultPTY.close: master=%d" % self._master)
 * 
 *     def restore_term(self):             # <<<<<<<<<<<<<<
 *         termios.tcsetattr(self._stdin_fileno,
 *                           termios.TCSANOW,
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_10DefaultPTY_5restore_term, 0, __pyx_n_s_DefaultPTY_restore_term, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__247)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_restore_term, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":958
 *                           self._backup_termios)
 * 
 *     def __setupterm(self, fd):             # <<<<<<<<<<<<<<
 *         term = termios.tcgetattr(fd)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_10DefaultPTY_7__setupterm, 0, __pyx_n_s_DefaultPTY___setupterm, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__249)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_DefaultPTY__setupterm, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":1009
 *         termios.tcsetattr(fd, termios.TCSANOW, term)
 * 
 *     def __resize_impl(self, winsize):             # <<<<<<<<<<<<<<
 *         fcntl.ioctl(self._master, termios.TIOCSWINSZ, winsize)
 *         # notify Application process that terminal size has been changed.
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_10DefaultPTY_9__resize_impl, 0, __pyx_n_s_DefaultPTY___resize_impl, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__251)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_DefaultPTY__resize_impl, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":1014
 *         os.kill(self.pid, signal.SIGWINCH)
 * 
 *     def fitsize(self):             # <<<<<<<<<<<<<<
 *         winsize = fcntl.ioctl(self._stdin_fileno, termios.TIOCGWINSZ, 'hhhh')
 *         height, width = struct.unpack('hh', winsize)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_10DefaultPTY_11fitsize, 0, __pyx_n_s_DefaultPTY_fitsize, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__253)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_fitsize, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":1020
 *         return height, width
 * 
 *     def resize(self, height, width):             # <<<<<<<<<<<<<<
 *         winsize = struct.pack('HHHH', height, width, 0, 0)
 *         self.__resize_impl(winsize)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_10DefaultPTY_13resize, 0, __pyx_n_s_DefaultPTY_resize, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__255)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_resize, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":1025
 *         return height, width
 * 
 *     def fileno(self):             # <<<<<<<<<<<<<<
 *         return self._master
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_10DefaultPTY_15fileno, 0, __pyx_n_s_DefaultPTY_fileno, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__257)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_fileno, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":1028
 *         return self._master
 * 
 *     def stdin_fileno(self):             # <<<<<<<<<<<<<<
 *         return self._stdin_fileno
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_10DefaultPTY_17stdin_fileno, 0, __pyx_n_s_DefaultPTY_stdin_fileno, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__259)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_stdin_fileno_2, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":1031
 *         return self._stdin_fileno
 * 
 *     def read(self):             # <<<<<<<<<<<<<<
 *         return os.read(self._master, _BUFFER_SIZE)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_10DefaultPTY_19read, 0, __pyx_n_s_DefaultPTY_read, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__261)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_read, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":1034
 *         return os.read(self._master, _BUFFER_SIZE)
 * 
 *     def write(self, data):             # <<<<<<<<<<<<<<
 *         os.write(self._master, data)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_10DefaultPTY_21write, 0, __pyx_n_s_DefaultPTY_write, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__263)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_write, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":1037
 *         os.write(self._master, data)
 * 
 *     def flush(self):             # <<<<<<<<<<<<<<
 *         pass
 *         #os.fsync(self._master)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_10DefaultPTY_23flush, 0, __pyx_n_s_DefaultPTY_flush, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__265)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_flush, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":1041
 *         #os.fsync(self._master)
 * 
 *     def xoff(self):             # <<<<<<<<<<<<<<
 *         #fcntl.ioctl(self._master, termios.TIOCSTOP, 0)
 *         termios.tcflow(self._master, termios.TCOOFF)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_10DefaultPTY_25xoff, 0, __pyx_n_s_DefaultPTY_xoff, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__267)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_xoff, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":1045
 *         termios.tcflow(self._master, termios.TCOOFF)
 * 
 *     def xon(self):             # <<<<<<<<<<<<<<
 *         #fcntl.ioctl(self._master, termios.TIOCSTART, 0)
 *         termios.tcflow(self._master, termios.TCOON)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_10DefaultPTY_27xon, 0, __pyx_n_s_DefaultPTY_xon, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__269)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_xon, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":926
 * # DefaultPTY
 * #
 * class DefaultPTY(PTY):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, term, lang, command, stdin, row=None, col=None):
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_DefaultPTY, __pyx_t_1, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DefaultPTY, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __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;

  /* "ctff.pyx":1050
 * 
 * 
 * class MockParseContext(ParseContext):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ParseContext); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_3, __pyx_n_s_MockParseContext, __pyx_n_s_MockParseContext, (PyObject *) NULL, __pyx_n_s_ctff, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);

  /* "ctff.pyx":1052
 * class MockParseContext(ParseContext):
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         from StringIO import StringIO
 *         output = StringIO()
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_16MockParseContext_1__init__, 0, __pyx_n_s_MockParseContext___init, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__271)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ctff.pyx":1050
 * 
 * 
 * class MockParseContext(ParseContext):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_MockParseContext, __pyx_t_3, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MockParseContext, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __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;

  /* "ctff.pyx":1062
 * # Process
 * #
 * class Process:             # <<<<<<<<<<<<<<
 * 
 *     _tty = None
 */
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Process, __pyx_n_s_Process, (PyObject *) NULL, __pyx_n_s_ctff, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);

  /* "ctff.pyx":1064
 * class Process:
 * 
 *     _tty = None             # <<<<<<<<<<<<<<
 *     _esc_timer = None
 * 
 */
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_tty_2, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1065
 * 
 *     _tty = None
 *     _esc_timer = None             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, tty):
 */
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_esc_timer, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1067
 *     _esc_timer = None
 * 
 *     def __init__(self, tty):             # <<<<<<<<<<<<<<
 *         self._tty = tty
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Process_1__init__, 0, __pyx_n_s_Process___init, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__273)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1070
 *         self._tty = tty
 * 
 *     def start(self, termenc,             # <<<<<<<<<<<<<<
 *               inputhandler, outputhandler,
 *               inputparser, outputparser,
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Process_3start, 0, __pyx_n_s_Process_start, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__275)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults1), 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1075
 *               inputscanner, outputscanner,
 *               buffering=False,
 *               stdout=sys.stdout):             # <<<<<<<<<<<<<<
 * 
 *         inputcontext = ParseContext(output=self._tty,
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_1)->__pyx_arg_stdout = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_4ctff_7Process_40__defaults__);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_start, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1100
 *         outputhandler.handle_start(outputcontext)
 * 
 *     def getpid(self):             # <<<<<<<<<<<<<<
 *         return self._tty.pid
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Process_5getpid, 0, __pyx_n_s_Process_getpid, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__277)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_getpid, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1103
 *         return self._tty.pid
 * 
 *     def is_alive(self):             # <<<<<<<<<<<<<<
 *         return self._tty is not None
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Process_7is_alive, 0, __pyx_n_s_Process_is_alive, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__279)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_is_alive, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1106
 *         return self._tty is not None
 * 
 *     def fileno(self):             # <<<<<<<<<<<<<<
 *         return self._tty.fileno()
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Process_9fileno, 0, __pyx_n_s_Process_fileno, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__281)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_fileno, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1109
 *         return self._tty.fileno()
 * 
 *     def stdin_fileno(self):             # <<<<<<<<<<<<<<
 *         return self._tty.stdin_fileno()
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Process_11stdin_fileno, 0, __pyx_n_s_Process_stdin_fileno, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__283)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_stdin_fileno_2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1112
 *         return self._tty.stdin_fileno()
 * 
 *     def read(self):             # <<<<<<<<<<<<<<
 *         return self._tty.read()
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Process_13read, 0, __pyx_n_s_Process_read, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__285)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_read, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1115
 *         return self._tty.read()
 * 
 *     def write(self, data):             # <<<<<<<<<<<<<<
 *         self._tty.write(data)
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Process_15write, 0, __pyx_n_s_Process_write, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__287)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_write, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1118
 *         self._tty.write(data)
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         tty = self._tty
 *         if tty is not None:
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Process_17close, 0, __pyx_n_s_Process_close, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__289)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_close, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1124
 *             self._tty = None
 * 
 *     def end(self):             # <<<<<<<<<<<<<<
 *         self._inputhandler.handle_end(self._outputcontext)
 *         self._outputhandler.handle_end(self._outputcontext)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Process_19end, 0, __pyx_n_s_Process_end, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__291)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_end, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1128
 *         self._outputhandler.handle_end(self._outputcontext)
 * 
 *     def resize(self, row, col):             # <<<<<<<<<<<<<<
 *         self._tty.resize(row, col)
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Process_21resize, 0, __pyx_n_s_Process_resize, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__293)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_resize, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1131
 *         self._tty.resize(row, col)
 * 
 *     def fitsize(self):             # <<<<<<<<<<<<<<
 *         return self._tty.fitsize()
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Process_23fitsize, 0, __pyx_n_s_Process_fitsize, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__295)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_fitsize, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1134
 *         return self._tty.fitsize()
 * 
 *     def on_write(self, data):             # <<<<<<<<<<<<<<
 *         self._inputparser.parse(data)
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Process_25on_write, 0, __pyx_n_s_Process_on_write, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__297)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_on_write, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1137
 *         self._inputparser.parse(data)
 * 
 *     def process_start(self):             # <<<<<<<<<<<<<<
 *         self._inputhandler.handle_start(self._inputcontext)
 *         self._outputhandler.handle_start(self._outputcontext)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Process_27process_start, 0, __pyx_n_s_Process_process_start, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__299)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_process_start, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1145
 *         self._outputcontext.flush()
 * 
 *     def process_end(self):             # <<<<<<<<<<<<<<
 *         self._inputhandler.handle_end(self._inputcontext)
 *         self._outputhandler.handle_end(self._outputcontext)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Process_29process_end, 0, __pyx_n_s_Process_process_end, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__301)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_process_end, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1149
 *         self._outputhandler.handle_end(self._outputcontext)
 * 
 *     def process_resize(self, row, col):             # <<<<<<<<<<<<<<
 *         try:
 *             self._inputhandler.handle_resize(self._inputcontext, row, col)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Process_31process_resize, 0, __pyx_n_s_Process_process_resize, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__303)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_process_resize, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1156
 *             self._resized = False
 * 
 *     def process_input(self, data):             # <<<<<<<<<<<<<<
 *         if not self._esc_timer is None:
 *             self._esc_timer.cancel()
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Process_33process_input, 0, __pyx_n_s_Process_process_input, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__305)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_process_input, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1180
 *             self._esc_timer.start()
 * 
 *     def process_output(self, data):             # <<<<<<<<<<<<<<
 *         self._outputparser.parse(data)
 *         if not self._outputparser.state_is_esc():
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Process_35process_output, 0, __pyx_n_s_Process_process_output, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__307)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_process_output, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1188
 *             self._outputcontext.flush()
 * 
 *     def on_read(self, data):             # <<<<<<<<<<<<<<
 *         self._outputparser.parse(data)
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Process_37on_read, 0, __pyx_n_s_Process_on_read, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__309)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_on_read, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1191
 *         self._outputparser.parse(data)
 * 
 *     def drain(self):             # <<<<<<<<<<<<<<
 *         self._inputparser.reset()
 *         self._inputcontext.assign('')
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Process_39drain, 0, __pyx_n_s_Process_drain, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__311)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_drain, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1062
 * # Process
 * #
 * class Process:             # <<<<<<<<<<<<<<
 * 
 *     _tty = None
 */
  __pyx_t_1 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_Process, __pyx_empty_tuple, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Process, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ctff.pyx":1200
 * # Session
 * #
 * class Session:             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, tty):
 */
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Session, __pyx_n_s_Session, (PyObject *) NULL, __pyx_n_s_ctff, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);

  /* "ctff.pyx":1202
 * class Session:
 * 
 *     def __init__(self, tty):             # <<<<<<<<<<<<<<
 * 
 *         self._alive = True
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Session_1__init__, 0, __pyx_n_s_Session___init, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__313)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1214
 * 
 *     # deprecated
 *     def add_subtty(self, term, lang,             # <<<<<<<<<<<<<<
 *                    command, row, col,
 *                    termenc,
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Session_3add_subtty, 0, __pyx_n_s_Session_add_subtty, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__315)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults2), 2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1217
 *                    command, row, col,
 *                    termenc,
 *                    inputhandler=DefaultHandler(),             # <<<<<<<<<<<<<<
 *                    outputhandler=DefaultHandler()):
 *         return self.create_process(term, lang, command, row, col,
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DefaultHandler); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_t_1)->__pyx_arg_inputhandler = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "ctff.pyx":1218
 *                    termenc,
 *                    inputhandler=DefaultHandler(),
 *                    outputhandler=DefaultHandler()):             # <<<<<<<<<<<<<<
 *         return self.create_process(term, lang, command, row, col,
 *                                    termenc, inputhandler, outputhandler)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DefaultHandler); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_t_1)->__pyx_arg_outputhandler = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_4ctff_7Session_22__defaults__);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_add_subtty, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1222
 *                                    termenc, inputhandler, outputhandler)
 * 
 *     def create_process(self, term, lang,             # <<<<<<<<<<<<<<
 *                        command, row, col,
 *                        termenc,
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Session_5create_process, 0, __pyx_n_s_Session_create_process, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__317)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults3), 6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1225
 *                        command, row, col,
 *                        termenc,
 *                        inputhandler=DefaultHandler(),             # <<<<<<<<<<<<<<
 *                        outputhandler=DefaultHandler(),
 *                        inputparser=DefaultParser(),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DefaultHandler); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_t_1)->__pyx_arg_inputhandler = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "ctff.pyx":1226
 *                        termenc,
 *                        inputhandler=DefaultHandler(),
 *                        outputhandler=DefaultHandler(),             # <<<<<<<<<<<<<<
 *                        inputparser=DefaultParser(),
 *                        outputparser=DefaultParser(),
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DefaultHandler); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_t_1)->__pyx_arg_outputhandler = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "ctff.pyx":1227
 *                        inputhandler=DefaultHandler(),
 *                        outputhandler=DefaultHandler(),
 *                        inputparser=DefaultParser(),             # <<<<<<<<<<<<<<
 *                        outputparser=DefaultParser(),
 *                        inputscanner=DefaultScanner(),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DefaultParser); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_t_1)->__pyx_arg_inputparser = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "ctff.pyx":1228
 *                        outputhandler=DefaultHandler(),
 *                        inputparser=DefaultParser(),
 *                        outputparser=DefaultParser(),             # <<<<<<<<<<<<<<
 *                        inputscanner=DefaultScanner(),
 *                        outputscanner=DefaultScanner(),
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DefaultParser); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_t_1)->__pyx_arg_outputparser = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "ctff.pyx":1229
 *                        inputparser=DefaultParser(),
 *                        outputparser=DefaultParser(),
 *                        inputscanner=DefaultScanner(),             # <<<<<<<<<<<<<<
 *                        outputscanner=DefaultScanner(),
 *                        buffering=False):
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DefaultScanner); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_t_1)->__pyx_arg_inputscanner = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "ctff.pyx":1230
 *                        outputparser=DefaultParser(),
 *                        inputscanner=DefaultScanner(),
 *                        outputscanner=DefaultScanner(),             # <<<<<<<<<<<<<<
 *                        buffering=False):
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DefaultScanner); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_t_1)->__pyx_arg_outputscanner = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_4ctff_7Session_24__defaults__);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_create_process, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1244
 *         return process
 * 
 *     def getactiveprocess(self):             # <<<<<<<<<<<<<<
 *         return self._input_target
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Session_7getactiveprocess, 0, __pyx_n_s_Session_getactiveprocess, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__319)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_getactiveprocess, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1247
 *         return self._input_target
 * 
 *     def process_is_active(self, process):             # <<<<<<<<<<<<<<
 *         return self._input_target == process
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Session_9process_is_active, 0, __pyx_n_s_Session_process_is_active, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__321)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_process_is_active, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1250
 *         return self._input_target == process
 * 
 *     def focus_process(self, process):             # <<<<<<<<<<<<<<
 *         if process.is_alive():
 *             logging.info("Switching focus: fileno=%d" % process.fileno())
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Session_11focus_process, 0, __pyx_n_s_Session_focus_process, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__323)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_focus_process, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1256
 *             self._input_target = process
 * 
 *     def blur_process(self):             # <<<<<<<<<<<<<<
 *         process = self._mainprocess
 *         if process.is_alive():
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Session_13blur_process, 0, __pyx_n_s_Session_blur_process, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__325)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_blur_process, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1264
 *             self._input_target = process
 * 
 *     def destruct_process(self, process):             # <<<<<<<<<<<<<<
 *         fd = process.fileno()
 *         if fd in self._rfds:
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Session_15destruct_process, 0, __pyx_n_s_Session_destruct_process, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__327)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_destruct_process, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1277
 *         self._mainprocess.process_output("")
 * 
 *     def drive(self):             # <<<<<<<<<<<<<<
 * 
 *         def onresize(no, frame):
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Session_17drive, 0, __pyx_n_s_Session_drive, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__329)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_drive, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1358
 *                     process.close()
 * 
 *     def start(self,             # <<<<<<<<<<<<<<
 *               termenc,
 *               stdin=sys.stdin,
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Session_19start, 0, __pyx_n_s_Session_start, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__331)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults4), 8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "ctff.pyx":1360
 *     def start(self,
 *               termenc,
 *               stdin=sys.stdin,             # <<<<<<<<<<<<<<
 *               stdout=sys.stdout,
 *               inputscanner=DefaultScanner(),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_stdin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_t_1)->__pyx_arg_stdin = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "ctff.pyx":1361
 *               termenc,
 *               stdin=sys.stdin,
 *               stdout=sys.stdout,             # <<<<<<<<<<<<<<
 *               inputscanner=DefaultScanner(),
 *               inputparser=DefaultParser(),
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_t_1)->__pyx_arg_stdout = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "ctff.pyx":1362
 *               stdin=sys.stdin,
 *               stdout=sys.stdout,
 *               inputscanner=DefaultScanner(),             # <<<<<<<<<<<<<<
 *               inputparser=DefaultParser(),
 *               inputhandler=DefaultHandler(),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DefaultScanner); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_t_1)->__pyx_arg_inputscanner = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "ctff.pyx":1363
 *               stdout=sys.stdout,
 *               inputscanner=DefaultScanner(),
 *               inputparser=DefaultParser(),             # <<<<<<<<<<<<<<
 *               inputhandler=DefaultHandler(),
 *               outputscanner=DefaultScanner(),
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DefaultParser); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_t_1)->__pyx_arg_inputparser = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "ctff.pyx":1364
 *               inputscanner=DefaultScanner(),
 *               inputparser=DefaultParser(),
 *               inputhandler=DefaultHandler(),             # <<<<<<<<<<<<<<
 *               outputscanner=DefaultScanner(),
 *               outputparser=DefaultParser(),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DefaultHandler); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_t_1)->__pyx_arg_inputhandler = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "ctff.pyx":1365
 *               inputparser=DefaultParser(),
 *               inputhandler=DefaultHandler(),
 *               outputscanner=DefaultScanner(),             # <<<<<<<<<<<<<<
 *               outputparser=DefaultParser(),
 *               outputhandler=DefaultHandler(),
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DefaultScanner); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_t_1)->__pyx_arg_outputscanner = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "ctff.pyx":1366
 *               inputhandler=DefaultHandler(),
 *               outputscanner=DefaultScanner(),
 *               outputparser=DefaultParser(),             # <<<<<<<<<<<<<<
 *               outputhandler=DefaultHandler(),
 *               buffering=False):
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DefaultParser); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_t_1)->__pyx_arg_outputparser = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "ctff.pyx":1367
 *               outputscanner=DefaultScanner(),
 *               outputparser=DefaultParser(),
 *               outputhandler=DefaultHandler(),             # <<<<<<<<<<<<<<
 *               buffering=False):
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DefaultHandler); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_t_1)->__pyx_arg_outputhandler = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_4ctff_7Session_26__defaults__);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_start, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1394
 *         self.drive()
 * 
 *     def _init_process(self,             # <<<<<<<<<<<<<<
 *                       process,
 *                       termenc,
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4ctff_7Session_21_init_process, 0, __pyx_n_s_Session__init_process, NULL, __pyx_n_s_ctff, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__333)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init_process, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ctff.pyx":1200
 * # Session
 * #
 * class Session:             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, tty):
 */
  __pyx_t_1 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_Session, __pyx_empty_tuple, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Session, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ctff.pyx":1418
 * 
 * 
 * def _test():             # <<<<<<<<<<<<<<
 *     import doctest
 *     doctest.testmod()
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_4ctff_1_test, NULL, __pyx_n_s_ctff); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ctff.pyx":1423
 * 
 * ''' main '''
 * if __name__ == '__main__':             # <<<<<<<<<<<<<<
 * 
 *     import inspect
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_main, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_7) {

    /* "ctff.pyx":1425
 * if __name__ == '__main__':
 * 
 *     import inspect             # <<<<<<<<<<<<<<
 *     import hashlib
 *     import sys
 */
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_inspect, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_inspect, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "ctff.pyx":1426
 * 
 *     import inspect
 *     import hashlib             # <<<<<<<<<<<<<<
 *     import sys
 * 
 */
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_hashlib, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_hashlib, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "ctff.pyx":1427
 *     import inspect
 *     import hashlib
 *     import sys             # <<<<<<<<<<<<<<
 * 
 *     thismodule = sys.modules[__name__]
 */
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "ctff.pyx":1429
 *     import sys
 * 
 *     thismodule = sys.modules[__name__]             # <<<<<<<<<<<<<<
 *     md5 = hashlib.md5()
 *     specs = []
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_modules); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_GetItem(__pyx_t_1, __pyx_t_3); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_thismodule, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ctff.pyx":1430
 * 
 *     thismodule = sys.modules[__name__]
 *     md5 = hashlib.md5()             # <<<<<<<<<<<<<<
 *     specs = []
 *     for name, member in inspect.getmembers(thismodule):
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_hashlib); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_md5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_md5, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ctff.pyx":1431
 *     thismodule = sys.modules[__name__]
 *     md5 = hashlib.md5()
 *     specs = []             # <<<<<<<<<<<<<<
 *     for name, member in inspect.getmembers(thismodule):
 *         if inspect.isclass(member):
 */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_specs, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ctff.pyx":1432
 *     md5 = hashlib.md5()
 *     specs = []
 *     for name, member in inspect.getmembers(thismodule):             # <<<<<<<<<<<<<<
 *         if inspect.isclass(member):
 *             if name[0] != "_":
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_inspect); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_getmembers); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_thismodule); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
      __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    for (;;) {
      if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_1)) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_1)) {
        if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_4 = __pyx_t_9(__pyx_t_1);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
        PyObject* sequence = __pyx_t_4;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        #else
        __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        #endif
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_10 = Py_TYPE(__pyx_t_5)->tp_iternext;
        index = 0; __pyx_t_3 = __pyx_t_10(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_3);
        index = 1; __pyx_t_2 = __pyx_t_10(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_2);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_10 = NULL;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L6_unpacking_done;
        __pyx_L5_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_10 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L6_unpacking_done:;
      }
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_name_2, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_member, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "ctff.pyx":1433
 *     specs = []
 *     for name, member in inspect.getmembers(thismodule):
 *         if inspect.isclass(member):             # <<<<<<<<<<<<<<
 *             if name[0] != "_":
 *                 classname = name
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_inspect); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_isclass); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_member); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_7) {

        /* "ctff.pyx":1434
 *     for name, member in inspect.getmembers(thismodule):
 *         if inspect.isclass(member):
 *             if name[0] != "_":             # <<<<<<<<<<<<<<
 *                 classname = name
 *                 for name, member in inspect.getmembers(member):
 */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s__336, Py_NE)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (__pyx_t_7) {

          /* "ctff.pyx":1435
 *         if inspect.isclass(member):
 *             if name[0] != "_":
 *                 classname = name             # <<<<<<<<<<<<<<
 *                 for name, member in inspect.getmembers(member):
 *                     if inspect.ismethod(member):
 */
          __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_name_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          if (PyDict_SetItem(__pyx_d, __pyx_n_s_classname, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "ctff.pyx":1436
 *             if name[0] != "_":
 *                 classname = name
 *                 for name, member in inspect.getmembers(member):             # <<<<<<<<<<<<<<
 *                     if inspect.ismethod(member):
 *                         if name.startswith("__") or name[0] != "_":
 */
          __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_inspect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getmembers); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_member); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
            __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_11 = 0;
            __pyx_t_12 = NULL;
          } else {
            __pyx_t_11 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext;
          }
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          for (;;) {
            if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_2)) {
              if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_2)) break;
              #if CYTHON_COMPILING_IN_CPYTHON
              __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              #else
              __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              #endif
            } else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_2)) {
              if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
              #if CYTHON_COMPILING_IN_CPYTHON
              __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              #else
              __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              #endif
            } else {
              __pyx_t_3 = __pyx_t_12(__pyx_t_2);
              if (unlikely(!__pyx_t_3)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                  else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_3);
            }
            if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
              PyObject* sequence = __pyx_t_3;
              #if CYTHON_COMPILING_IN_CPYTHON
              Py_ssize_t size = Py_SIZE(sequence);
              #else
              Py_ssize_t size = PySequence_Size(sequence);
              #endif
              if (unlikely(size != 2)) {
                if (size > 2) __Pyx_RaiseTooManyValuesError(2);
                else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
                {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              }
              #if CYTHON_COMPILING_IN_CPYTHON
              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_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_5);
              #endif
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            } else {
              Py_ssize_t index = -1;
              __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_6);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              __pyx_t_10 = Py_TYPE(__pyx_t_6)->tp_iternext;
              index = 0; __pyx_t_4 = __pyx_t_10(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L11_unpacking_failed;
              __Pyx_GOTREF(__pyx_t_4);
              index = 1; __pyx_t_5 = __pyx_t_10(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L11_unpacking_failed;
              __Pyx_GOTREF(__pyx_t_5);
              if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __pyx_t_10 = NULL;
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              goto __pyx_L12_unpacking_done;
              __pyx_L11_unpacking_failed:;
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __pyx_t_10 = NULL;
              if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __pyx_L12_unpacking_done:;
            }
            if (PyDict_SetItem(__pyx_d, __pyx_n_s_name_2, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (PyDict_SetItem(__pyx_d, __pyx_n_s_member, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

            /* "ctff.pyx":1437
 *                 classname = name
 *                 for name, member in inspect.getmembers(member):
 *                     if inspect.ismethod(member):             # <<<<<<<<<<<<<<
 *                         if name.startswith("__") or name[0] != "_":
 *                             argspec = inspect.getargspec(member)
 */
            __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_inspect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ismethod); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_member); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_3);
            __pyx_t_3 = 0;
            __pyx_t_3 = PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (__pyx_t_7) {

              /* "ctff.pyx":1438
 *                 for name, member in inspect.getmembers(member):
 *                     if inspect.ismethod(member):
 *                         if name.startswith("__") or name[0] != "_":             # <<<<<<<<<<<<<<
 *                             argspec = inspect.getargspec(member)
 *                             args, varargs, keywords, defaultvalue = argspec
 */
              __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_name_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_startswith); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_tuple__338, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              if (!__pyx_t_7) {
                __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_name_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
                __Pyx_GOTREF(__pyx_t_4);
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s__336, Py_NE)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                __pyx_t_14 = __pyx_t_13;
              } else {
                __pyx_t_14 = __pyx_t_7;
              }
              if (__pyx_t_14) {

                /* "ctff.pyx":1439
 *                     if inspect.ismethod(member):
 *                         if name.startswith("__") or name[0] != "_":
 *                             argspec = inspect.getargspec(member)             # <<<<<<<<<<<<<<
 *                             args, varargs, keywords, defaultvalue = argspec
 *                             specstr = "%s.%s.%s" % (classname, name, args)
 */
                __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_inspect); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_4);
                __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_getargspec); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_3);
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_member); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_4);
                __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_5);
                PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
                __Pyx_GIVEREF(__pyx_t_4);
                __pyx_t_4 = 0;
                __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_4);
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                if (PyDict_SetItem(__pyx_d, __pyx_n_s_argspec, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

                /* "ctff.pyx":1440
 *                         if name.startswith("__") or name[0] != "_":
 *                             argspec = inspect.getargspec(member)
 *                             args, varargs, keywords, defaultvalue = argspec             # <<<<<<<<<<<<<<
 *                             specstr = "%s.%s.%s" % (classname, name, args)
 *                             specs.append(specstr)
 */
                __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_argspec); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_4);
                if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
                  PyObject* sequence = __pyx_t_4;
                  #if CYTHON_COMPILING_IN_CPYTHON
                  Py_ssize_t size = Py_SIZE(sequence);
                  #else
                  Py_ssize_t size = PySequence_Size(sequence);
                  #endif
                  if (unlikely(size != 4)) {
                    if (size > 4) __Pyx_RaiseTooManyValuesError(4);
                    else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
                    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  #if CYTHON_COMPILING_IN_CPYTHON
                  if (likely(PyTuple_CheckExact(sequence))) {
                    __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
                    __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
                    __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); 
                    __pyx_t_15 = PyTuple_GET_ITEM(sequence, 3); 
                  } else {
                    __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
                    __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
                    __pyx_t_6 = PyList_GET_ITEM(sequence, 2); 
                    __pyx_t_15 = PyList_GET_ITEM(sequence, 3); 
                  }
                  __Pyx_INCREF(__pyx_t_5);
                  __Pyx_INCREF(__pyx_t_3);
                  __Pyx_INCREF(__pyx_t_6);
                  __Pyx_INCREF(__pyx_t_15);
                  #else
                  {
                    Py_ssize_t i;
                    PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_3,&__pyx_t_6,&__pyx_t_15};
                    for (i=0; i < 4; i++) {
                      PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                      __Pyx_GOTREF(item);
                      *(temps[i]) = item;
                    }
                  }
                  #endif
                  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                } else {
                  Py_ssize_t index = -1;
                  PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_3,&__pyx_t_6,&__pyx_t_15};
                  __pyx_t_16 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_16);
                  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                  __pyx_t_10 = Py_TYPE(__pyx_t_16)->tp_iternext;
                  for (index=0; index < 4; index++) {
                    PyObject* item = __pyx_t_10(__pyx_t_16); if (unlikely(!item)) goto __pyx_L15_unpacking_failed;
                    __Pyx_GOTREF(item);
                    *(temps[index]) = item;
                  }
                  if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_16), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __pyx_t_10 = NULL;
                  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
                  goto __pyx_L16_unpacking_done;
                  __pyx_L15_unpacking_failed:;
                  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
                  __pyx_t_10 = NULL;
                  if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
                  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __pyx_L16_unpacking_done:;
                }
                if (PyDict_SetItem(__pyx_d, __pyx_n_s_args, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                if (PyDict_SetItem(__pyx_d, __pyx_n_s_varargs, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                if (PyDict_SetItem(__pyx_d, __pyx_n_s_keywords, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                if (PyDict_SetItem(__pyx_d, __pyx_n_s_defaultvalue, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

                /* "ctff.pyx":1441
 *                             argspec = inspect.getargspec(member)
 *                             args, varargs, keywords, defaultvalue = argspec
 *                             specstr = "%s.%s.%s" % (classname, name, args)             # <<<<<<<<<<<<<<
 *                             specs.append(specstr)
 *     specs.sort()
 */
                __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_classname); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_4);
                __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_name_2); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_15);
                __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_args); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_6);
                __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_3);
                PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
                __Pyx_GIVEREF(__pyx_t_4);
                PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_15);
                __Pyx_GIVEREF(__pyx_t_15);
                PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_6);
                __Pyx_GIVEREF(__pyx_t_6);
                __pyx_t_4 = 0;
                __pyx_t_15 = 0;
                __pyx_t_6 = 0;
                __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_s_s_s, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_6);
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                if (PyDict_SetItem(__pyx_d, __pyx_n_s_specstr, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

                /* "ctff.pyx":1442
 *                             args, varargs, keywords, defaultvalue = argspec
 *                             specstr = "%s.%s.%s" % (classname, name, args)
 *                             specs.append(specstr)             # <<<<<<<<<<<<<<
 *     specs.sort()
 *     md5.update("".join(specs))
 */
                __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_specs); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_6);
                __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_specstr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_3);
                __pyx_t_17 = __Pyx_PyObject_Append(__pyx_t_6, __pyx_t_3); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                goto __pyx_L14;
              }
              __pyx_L14:;
              goto __pyx_L13;
            }
            __pyx_L13:;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          goto __pyx_L8;
        }
        __pyx_L8:;
        goto __pyx_L7;
      }
      __pyx_L7:;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "ctff.pyx":1443
 *                             specstr = "%s.%s.%s" % (classname, name, args)
 *                             specs.append(specstr)
 *     specs.sort()             # <<<<<<<<<<<<<<
 *     md5.update("".join(specs))
 *     sys.stdout.write(md5.hexdigest())
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_specs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sort); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "ctff.pyx":1444
 *                             specs.append(specstr)
 *     specs.sort()
 *     md5.update("".join(specs))             # <<<<<<<<<<<<<<
 *     sys.stdout.write(md5.hexdigest())
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_md5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_update); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_specs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyString_Join(__pyx_kp_s__43, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "ctff.pyx":1445
 *     specs.sort()
 *     md5.update("".join(specs))
 *     sys.stdout.write(md5.hexdigest())             # <<<<<<<<<<<<<<
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_stdout); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_md5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_hexdigest); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "ctff.pyx":1
 * #!/usr/bin/env python             # <<<<<<<<<<<<<<
 * # -*- coding: utf-8 -*-
 * #
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_NotHandledException___init___lin, __pyx_kp_u_e_NotHandledException_test1_e_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_NotHandledException___str___line, __pyx_kp_u_e_NotHandledException_test2_e_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_ParseException___init___line_77, __pyx_kp_u_e_ParseException_test2_e_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_ParseException___str___line_85, __pyx_kp_u_e_ParseException_test2_e_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_SimpleParser_parse_line_239, __pyx_kp_u_parser_SimpleParser_context_Sim) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_DefaultScanner___init___line_601, __pyx_kp_u_scanner_DefaultScanner_scanner) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_DefaultScanner_assign_line_617, __pyx_kp_u_scanner_DefaultScanner_scanner_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_DefaultScanner_continuous_assign_2, __pyx_kp_u_scanner_DefaultScanner_termenc) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_DefaultScanner___iter___line_638, __pyx_kp_u_scanner_DefaultScanner_scanner_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  if (__pyx_m) {
    __Pyx_AddTraceback("init ctff", __pyx_clineno, __pyx_lineno, __pyx_filename);
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init ctff");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* Runtime support code */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif /* CYTHON_REFNANNY */

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

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

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
}

static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    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);
#else
    PyErr_Restore(type, value, tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(type, value, tb);
#endif
}

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    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 PY_VERSION_HEX < 0x02050000
    if (PyClass_Check(type)) {
    #else
    if (PyType_Check(type)) {
    #endif
#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;
        #if PY_VERSION_HEX < 0x02050000
        if (PyInstance_Check(type)) {
            type = (PyObject*) ((PyInstanceObject*)type)->in_class;
            Py_INCREF(type);
        } else {
            type = 0;
            PyErr_SetString(PyExc_TypeError,
                "raise: exception must be an old-style class or instance");
            goto raise_error;
        }
        #else
        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;
        }
        #endif
    }
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else /* Python 3+ */
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) {
                if (PyObject_IsSubclass(instance_class, type)) {
                    type = instance_class;
                } else {
                    instance_class = NULL;
                }
            }
        }
        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 PY_VERSION_HEX >= 0x03030000
    if (cause) {
#else
    if (cause && cause != Py_None) {
#endif
        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) {
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
    } else {
        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    return 0;
}

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
    PyObject *result;
#if CYTHON_COMPILING_IN_CPYTHON
    result = PyDict_GetItem(__pyx_d, name);
    if (result) {
        Py_INCREF(result);
    } else {
#else
    result = PyObject_GetItem(__pyx_d, name);
    if (!result) {
        PyErr_Clear();
#endif
        result = __Pyx_GetBuiltinName(name);
    }
    return result;
}

static CYTHON_INLINE 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,
                                                              int wraparound, int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, 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,
                                                              int wraparound, int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, 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, int wraparound, int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely((n >= 0) & (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((n >= 0) & (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))
                        PyErr_Clear();
                    else
                        return NULL;
                }
            }
            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));
}

static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
#else
    PyErr_GetExcInfo(type, value, tb);
#endif
}
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    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;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(type, value, tb);
#endif
}

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    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_COMPILING_IN_CPYTHON
    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_COMPILING_IN_CPYTHON
    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;
    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;
}

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

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");
}

static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(exc_type == PyExc_StopIteration) || 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
}

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

static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
    int r;
    if (!j) return -1;
    r = PyObject_SetItem(o, j, v);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
                                               int is_list, int wraparound, int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
        if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
            PyObject* old = PyList_GET_ITEM(o, n);
            Py_INCREF(v);
            PyList_SET_ITEM(o, n, v);
            Py_DECREF(old);
            return 1;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_ass_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (PyErr_ExceptionMatches(PyExc_OverflowError))
                        PyErr_Clear();
                    else
                        return -1;
                }
            }
            return m->sq_ass_item(o, i, v);
        }
    }
#else
#if CYTHON_COMPILING_IN_PYPY
    if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) {
#else
    if (is_list || PySequence_Check(o)) {
#endif
        return PySequence_SetItem(o, i, v);
    }
#endif
    return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}

static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    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;
#else
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
#endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}

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

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

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)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL)
        value = Py_None; /* Mark as deleted */
    Py_INCREF(value);
    op->func_doc = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
{
    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)
{
    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)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
{
    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)
{
    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)
{
    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)
{
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    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);
    Py_DECREF(res);
    return 0;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
    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) {
    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) {
    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) {
    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) {
    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) {
    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}
};
#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */
#define PY_WRITE_RESTRICTED WRITE_RESTRICTED
#endif
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromString(m->func.m_ml->ml_name);
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
    if (op == NULL)
        return NULL;
    op->flags = flags;
    op->func_weakreflist = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    PyObject_GC_Track(op);
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyMem_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    if (m->func_weakreflist != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return PyMethod_New(func,
                            type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
    return 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
}
#if CYTHON_COMPILING_IN_PYPY
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    Py_ssize_t size;
    switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) {
    case METH_VARARGS:
        if (likely(kw == NULL) || PyDict_Size(kw) == 0)
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
            size = PyTuple_GET_SIZE(arg);
            if (size == 0)
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%zd 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 (size == 1)
                return (*meth)(self, PyTuple_GET_ITEM(arg, 0));
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%zd 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;
}
#else
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
	return PyCFunction_Call(func, arg, kw);
}
#endif
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/
    sizeof(__pyx_CyFunctionObject),   /*tp_basicsize*/
    0,                                  /*tp_itemsize*/
    (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/
    0,                                  /*tp_print*/
    0,                                  /*tp_getattr*/
    0,                                  /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
    0,                                  /*tp_compare*/
#else
    0,                                  /*reserved*/
#endif
    (reprfunc) __Pyx_CyFunction_repr,   /*tp_repr*/
    0,                                  /*tp_as_number*/
    0,                                  /*tp_as_sequence*/
    0,                                  /*tp_as_mapping*/
    0,                                  /*tp_hash*/
    __Pyx_CyFunction_Call,              /*tp_call*/
    0,                                  /*tp_str*/
    0,                                  /*tp_getattro*/
    0,                                  /*tp_setattro*/
    0,                                  /*tp_as_buffer*/
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/
    0,                                  /*tp_doc*/
    (traverseproc) __Pyx_CyFunction_traverse,   /*tp_traverse*/
    (inquiry) __Pyx_CyFunction_clear,   /*tp_clear*/
    0,                                  /*tp_richcompare*/
    offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */
    0,                                  /*tp_iter*/
    0,                                  /*tp_iternext*/
    __pyx_CyFunction_methods,           /*tp_methods*/
    __pyx_CyFunction_members,           /*tp_members*/
    __pyx_CyFunction_getsets,           /*tp_getset*/
    0,                                  /*tp_base*/
    0,                                  /*tp_dict*/
    __Pyx_CyFunction_descr_get,         /*tp_descr_get*/
    0,                                  /*tp_descr_set*/
    offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/
    0,                                  /*tp_init*/
    0,                                  /*tp_alloc*/
    0,                                  /*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*/
#if PY_VERSION_HEX >= 0x02060000
    0,                                  /*tp_version_tag*/
#endif
#if PY_VERSION_HEX >= 0x030400a1
    0,                                  /*tp_finalize*/
#endif
};
static int __Pyx_CyFunction_init(void) {
#if !CYTHON_COMPILING_IN_PYPY
    __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
#endif
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
    if (__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 = PyMem_Malloc(size);
    if (!m->defaults)
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

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

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

static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        #if CYTHON_PEP393_ENABLED
        if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0))
            return -1;
        #endif
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, length * kind);
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

#if !CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
    return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL)
}
#endif

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_VERSION_HEX < 0x03030000
    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_VERSION_HEX >= 0x02050000
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                #if PY_VERSION_HEX < 0x03030000
                PyObject *py_level = PyInt_FromLong(1);
                if (!py_level)
                    goto bad;
                module = PyObject_CallFunctionObjArgs(py_import,
                    name, global_dict, empty_dict, list, py_level, NULL);
                Py_DECREF(py_level);
                #else
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                #endif
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0; /* try absolute import on failure */
        }
        #endif
        if (!module) {
            #if PY_VERSION_HEX < 0x03030000
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
    #else
    if (level>0) {
        PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
        goto bad;
    }
    module = PyObject_CallFunctionObjArgs(py_import,
        name, global_dict, empty_dict, list, NULL);
    #endif
bad:
    #if PY_VERSION_HEX < 0x03030000
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(long) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func)             \
    {                                                                     \
        func_type value = func(x);                                        \
        if (sizeof(target_type) < sizeof(func_type)) {                    \
            if (unlikely(value != (func_type) (target_type) value)) {     \
                func_type zero = 0;                                       \
                PyErr_SetString(PyExc_OverflowError,                      \
                    (is_unsigned && unlikely(value < zero)) ?             \
                    "can't convert negative value to " #target_type :     \
                    "value too large to convert to " #target_type);       \
                return (target_type) -1;                                  \
            }                                                             \
        }                                                                 \
        return (target_type) value;                                       \
    }

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
 #endif
#endif
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG)
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to long");
                return (long) -1;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(long)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return (long) ((PyLongObject*)x)->ob_digit[0];
                }
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to long");
                return (long) -1;
            }
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong)
            } else if (sizeof(long) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong)
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(long)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return +(long) ((PyLongObject*)x)->ob_digit[0];
                    case -1: return -(long) ((PyLongObject*)x)->ob_digit[0];
                }
            }
 #endif
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong)
            } else if (sizeof(long) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong)
            }
        }
        {
#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_Int(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_Int(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
static PyObject *__Pyx_GetStdout(void) {
    PyObject *f = PySys_GetObject((char *)"stdout");
    if (!f) {
        PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
    }
    return f;
}
static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) {
    int i;
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    Py_INCREF(f);
    for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
        PyObject* v;
        if (PyFile_SoftSpace(f, 1)) {
            if (PyFile_WriteString(" ", f) < 0)
                goto error;
        }
        v = PyTuple_GET_ITEM(arg_tuple, i);
        if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
            goto error;
        if (PyString_Check(v)) {
            char *s = PyString_AsString(v);
            Py_ssize_t len = PyString_Size(v);
            if (len > 0 &&
                isspace(Py_CHARMASK(s[len-1])) &&
                s[len-1] != ' ')
                    PyFile_SoftSpace(f, 0);
        }
    }
    if (newline) {
        if (PyFile_WriteString("\n", f) < 0)
            goto error;
        PyFile_SoftSpace(f, 0);
    }
    Py_DECREF(f);
    return 0;
error:
    Py_DECREF(f);
    return -1;
}
#else /* Python 3 has a print function */
static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
    PyObject* kwargs = 0;
    PyObject* result = 0;
    PyObject* end_string;
    if (unlikely(!__pyx_print)) {
        __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print);
        if (!__pyx_print)
            return -1;
    }
    if (stream) {
        kwargs = PyDict_New();
        if (unlikely(!kwargs))
            return -1;
        if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0))
            goto bad;
        if (!newline) {
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!end_string))
                goto bad;
            if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) {
                Py_DECREF(end_string);
                goto bad;
            }
            Py_DECREF(end_string);
        }
    } else if (!newline) {
        if (unlikely(!__pyx_print_kwargs)) {
            __pyx_print_kwargs = PyDict_New();
            if (unlikely(!__pyx_print_kwargs))
                return -1;
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!end_string))
                return -1;
            if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) {
                Py_DECREF(end_string);
                return -1;
            }
            Py_DECREF(end_string);
        }
        kwargs = __pyx_print_kwargs;
    }
    result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
    if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
        Py_DECREF(kwargs);
    if (!result)
        return -1;
    Py_DECREF(result);
    return 0;
bad:
    if (kwargs != __pyx_print_kwargs)
        Py_XDECREF(kwargs);
    return -1;
}
#endif

#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    Py_INCREF(f);
    if (PyFile_SoftSpace(f, 0)) {
        if (PyFile_WriteString(" ", f) < 0)
            goto error;
    }
    if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
        goto error;
    if (PyFile_WriteString("\n", f) < 0)
        goto error;
    Py_DECREF(f);
    return 0;
error:
    Py_DECREF(f);
    return -1;
    /* the line below is just to avoid C compiler
     * warnings about unused functions */
    return __Pyx_Print(f, NULL, 0);
}
#else /* Python 3 has a print function */
static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
    int res;
    PyObject* arg_tuple = PyTuple_Pack(1, o);
    if (unlikely(!arg_tuple))
        return -1;
    res = __Pyx_Print(stream, arg_tuple, 1);
    Py_DECREF(arg_tuple);
    return res;
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
 #endif
#endif
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG)
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to int");
                return (int) -1;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(int)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return (int) ((PyLongObject*)x)->ob_digit[0];
                }
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to int");
                return (int) -1;
            }
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong)
            } else if (sizeof(int) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong)
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(int)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return +(int) ((PyLongObject*)x)->ob_digit[0];
                    case -1: return -(int) ((PyLongObject*)x)->ob_digit[0];
                }
            }
 #endif
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong)
            } else if (sizeof(int) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong)
            }
        }
        {
#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_Int(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_Int(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static PyObject *__Pyx_Generator_Next(PyObject *self);
static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value);
static PyObject *__Pyx_Generator_Close(PyObject *self);
static PyObject *__Pyx_Generator_Throw(PyObject *gen, PyObject *args);
static PyTypeObject *__pyx_GeneratorType = 0;
#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
#define __Pyx_Generator_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
#if 1 || PY_VERSION_HEX < 0x030300B0
static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (unlikely(et != PyExc_StopIteration) &&
            unlikely(!PyErr_GivenExceptionMatches(et, PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (likely(!ev) || !PyObject_IsInstance(ev, PyExc_StopIteration)) {
            if (!ev) {
                Py_INCREF(Py_None);
                ev = Py_None;
            }
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = ev;
            return 0;
        }
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_IsInstance(ev, PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if PY_VERSION_HEX >= 0x030300A0
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
    Py_DECREF(ev);
#else
    {
        PyObject* args = PyObject_GetAttr(ev, __pyx_n_s_args);
        Py_DECREF(ev);
        if (likely(args)) {
            value = PyObject_GetItem(args, 0);
            Py_DECREF(args);
        }
        if (unlikely(!value)) {
            __Pyx_ErrRestore(NULL, NULL, NULL);
            Py_INCREF(Py_None);
            value = Py_None;
        }
    }
#endif
    *pvalue = value;
    return 0;
}
#endif
static CYTHON_INLINE
void __Pyx_Generator_ExceptionClear(__pyx_GeneratorObject *self) {
    PyObject *exc_type = self->exc_type;
    PyObject *exc_value = self->exc_value;
    PyObject *exc_traceback = self->exc_traceback;
    self->exc_type = NULL;
    self->exc_value = NULL;
    self->exc_traceback = NULL;
    Py_XDECREF(exc_type);
    Py_XDECREF(exc_value);
    Py_XDECREF(exc_traceback);
}
static CYTHON_INLINE
int __Pyx_Generator_CheckRunning(__pyx_GeneratorObject *gen) {
    if (unlikely(gen->is_running)) {
        PyErr_SetString(PyExc_ValueError,
                        "generator already executing");
        return 1;
    }
    return 0;
}
static CYTHON_INLINE
PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) {
    PyObject *retval;
    assert(!self->is_running);
    if (unlikely(self->resume_label == 0)) {
        if (unlikely(value && value != Py_None)) {
            PyErr_SetString(PyExc_TypeError,
                            "can't send non-None value to a "
                            "just-started generator");
            return NULL;
        }
    }
    if (unlikely(self->resume_label == -1)) {
        PyErr_SetNone(PyExc_StopIteration);
        return NULL;
    }
    if (value) {
#if CYTHON_COMPILING_IN_PYPY
#else
        /* Generators always return to their most recent caller, not
         * necessarily their creator. */
        if (self->exc_traceback) {
            PyThreadState *tstate = PyThreadState_GET();
            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_XINCREF(tstate->frame);
            assert(f->f_back == NULL);
            f->f_back = tstate->frame;
        }
#endif
        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
                            &self->exc_traceback);
    } else {
        __Pyx_Generator_ExceptionClear(self);
    }
    self->is_running = 1;
    retval = self->body((PyObject *) self, value);
    self->is_running = 0;
    if (retval) {
        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
                            &self->exc_traceback);
#if CYTHON_COMPILING_IN_PYPY
#else
        /* Don't keep the reference to f_back any longer than necessary.  It
         * may keep a chain of frames alive or it could create a reference
         * cycle. */
        if (self->exc_traceback) {
            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_CLEAR(f->f_back);
        }
#endif
    } else {
        __Pyx_Generator_ExceptionClear(self);
    }
    return retval;
}
static CYTHON_INLINE
PyObject *__Pyx_Generator_FinishDelegation(__pyx_GeneratorObject *gen) {
    PyObject *ret;
    PyObject *val = NULL;
    __Pyx_Generator_Undelegate(gen);
    __Pyx_PyGen_FetchStopIterationValue(&val);
    ret = __Pyx_Generator_SendEx(gen, val);
    Py_XDECREF(val);
    return ret;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
        return NULL;
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        ret = Py_TYPE(yf)->tp_iternext(yf);
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        return __Pyx_Generator_FinishDelegation(gen);
    }
    return __Pyx_Generator_SendEx(gen, Py_None);
}
static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
        return NULL;
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Send(yf, value);
        } else {
            if (value == Py_None)
                ret = PyIter_Next(yf);
            else
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
        }
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        return __Pyx_Generator_FinishDelegation(gen);
    }
    return __Pyx_Generator_SendEx(gen, value);
}
static int __Pyx_Generator_CloseIter(__pyx_GeneratorObject *gen, PyObject *yf) {
    PyObject *retval = NULL;
    int err = 0;
    if (__Pyx_Generator_CheckExact(yf)) {
        retval = __Pyx_Generator_Close(yf);
        if (!retval)
            return -1;
    } else {
        PyObject *meth;
        gen->is_running = 1;
        meth = PyObject_GetAttr(yf, __pyx_n_s_close);
        if (unlikely(!meth)) {
            if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                PyErr_WriteUnraisable(yf);
            }
            PyErr_Clear();
        } else {
            retval = PyObject_CallFunction(meth, NULL);
            Py_DECREF(meth);
            if (!retval)
                err = -1;
        }
        gen->is_running = 0;
    }
    Py_XDECREF(retval);
    return err;
}
static PyObject *__Pyx_Generator_Close(PyObject *self) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
    PyObject *retval, *raised_exception;
    PyObject *yf = gen->yieldfrom;
    int err = 0;
    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
        return NULL;
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Generator_CloseIter(gen, yf);
        __Pyx_Generator_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
#if PY_VERSION_HEX < 0x02050000
        PyErr_SetNone(PyExc_StopIteration);
#else
        PyErr_SetNone(PyExc_GeneratorExit);
#endif
    retval = __Pyx_Generator_SendEx(gen, NULL);
    if (retval) {
        Py_DECREF(retval);
        PyErr_SetString(PyExc_RuntimeError,
                        "generator ignored GeneratorExit");
        return NULL;
    }
    raised_exception = PyErr_Occurred();
    if (!raised_exception
        || raised_exception == PyExc_StopIteration
#if PY_VERSION_HEX >= 0x02050000
        || raised_exception == PyExc_GeneratorExit
        || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit)
#endif
        || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration))
    {
        if (raised_exception) PyErr_Clear();      /* ignore these errors */
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}
static PyObject *__Pyx_Generator_Throw(PyObject *self, PyObject *args) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
    PyObject *typ;
    PyObject *tb = NULL;
    PyObject *val = NULL;
    PyObject *yf = gen->yieldfrom;
    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
        return NULL;
    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
        return NULL;
    if (yf) {
        PyObject *ret;
        Py_INCREF(yf);
#if PY_VERSION_HEX >= 0x02050000
        if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) {
            int err = __Pyx_Generator_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Generator_Undelegate(gen);
            if (err < 0)
                return __Pyx_Generator_SendEx(gen, NULL);
            goto throw_here;
        }
#endif
        gen->is_running = 1;
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Throw(yf, args);
        } else {
            PyObject *meth = PyObject_GetAttr(yf, __pyx_n_s_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                    gen->is_running = 0;
                    return NULL;
                }
                PyErr_Clear();
                __Pyx_Generator_Undelegate(gen);
                gen->is_running = 0;
                goto throw_here;
            }
            ret = PyObject_CallObject(meth, args);
            Py_DECREF(meth);
        }
        gen->is_running = 0;
        Py_DECREF(yf);
        if (!ret) {
            ret = __Pyx_Generator_FinishDelegation(gen);
        }
        return ret;
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Generator_SendEx(gen, NULL);
}
static int __Pyx_Generator_traverse(PyObject *self, visitproc visit, void *arg) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    Py_VISIT(gen->exc_type);
    Py_VISIT(gen->exc_value);
    Py_VISIT(gen->exc_traceback);
    return 0;
}
static int __Pyx_Generator_clear(PyObject *self) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
    Py_CLEAR(gen->closure);
    Py_CLEAR(gen->classobj);
    Py_CLEAR(gen->yieldfrom);
    Py_CLEAR(gen->exc_type);
    Py_CLEAR(gen->exc_value);
    Py_CLEAR(gen->exc_traceback);
    return 0;
}
static void __Pyx_Generator_dealloc(PyObject *self) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
    PyObject_GC_UnTrack(gen);
    if (gen->gi_weakreflist != NULL)
        PyObject_ClearWeakRefs(self);
    if (gen->resume_label > 0) {
        PyObject_GC_Track(self);
#if PY_VERSION_HEX >= 0x030400a1
        if (PyObject_CallFinalizerFromDealloc(self))
#else
        Py_TYPE(gen)->tp_del(self);
        if (self->ob_refcnt > 0)
#endif
            return;                     /* resurrected.  :( */
        PyObject_GC_UnTrack(self);
    }
    __Pyx_Generator_clear(self);
    PyObject_GC_Del(gen);
}
static void __Pyx_Generator_del(PyObject *self) {
    PyObject *res;
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
    if (gen->resume_label <= 0)
        return ;
#if PY_VERSION_HEX < 0x030400a1
    assert(self->ob_refcnt == 0);
    self->ob_refcnt = 1;
#endif
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
    res = __Pyx_Generator_Close(self);
    if (res == NULL)
        PyErr_WriteUnraisable(self);
    else
        Py_DECREF(res);
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
#if PY_VERSION_HEX < 0x030400a1
    /* Undo the temporary resurrection; can't use DECREF here, it would
     * cause a recursive call.
     */
    assert(self->ob_refcnt > 0);
    if (--self->ob_refcnt == 0)
        return; /* this is the normal path out */
    /* close() resurrected it!  Make it look like the original Py_DECREF
     * never happened.
     */
    {
        Py_ssize_t refcnt = self->ob_refcnt;
        _Py_NewReference(self);
        self->ob_refcnt = refcnt;
    }
#if CYTHON_COMPILING_IN_CPYTHON
    assert(PyType_IS_GC(self->ob_type) &&
           _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
    /* If Py_REF_DEBUG, _Py_NewReference bumped _Py_RefTotal, so
     * we need to undo that. */
    _Py_DEC_REFTOTAL;
#endif
    /* If Py_TRACE_REFS, _Py_NewReference re-added self to the object
     * chain, so no more to do there.
     * If COUNT_ALLOCS, the original decref bumped tp_frees, and
     * _Py_NewReference bumped tp_allocs:  both of those need to be
     * undone.
     */
#ifdef COUNT_ALLOCS
    --Py_TYPE(self)->tp_frees;
    --Py_TYPE(self)->tp_allocs;
#endif
#endif
}
static PyMemberDef __pyx_Generator_memberlist[] = {
    {(char *) "gi_running",
#if PY_VERSION_HEX >= 0x02060000
     T_BOOL,
#else
     T_BYTE,
#endif
     offsetof(__pyx_GeneratorObject, is_running),
     READONLY,
     NULL},
    {0, 0, 0, 0, 0}
};
static PyMethodDef __pyx_Generator_methods[] = {
    {__Pyx_NAMESTR("send"), (PyCFunction) __Pyx_Generator_Send, METH_O, 0},
    {__Pyx_NAMESTR("throw"), (PyCFunction) __Pyx_Generator_Throw, METH_VARARGS, 0},
    {__Pyx_NAMESTR("close"), (PyCFunction) __Pyx_Generator_Close, METH_NOARGS, 0},
    {0, 0, 0, 0}
};
static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    __Pyx_NAMESTR("generator"),         /*tp_name*/
    sizeof(__pyx_GeneratorObject),      /*tp_basicsize*/
    0,                                  /*tp_itemsize*/
    (destructor) __Pyx_Generator_dealloc,/*tp_dealloc*/
    0,                                  /*tp_print*/
    0,                                  /*tp_getattr*/
    0,                                  /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
    0,                                  /*tp_compare*/
#else
    0,                                  /*reserved*/
#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_GC | Py_TPFLAGS_HAVE_FINALIZE, /* tp_flags*/
    0,                                  /*tp_doc*/
    (traverseproc) __Pyx_Generator_traverse,   /*tp_traverse*/
    0,                                  /*tp_clear*/
    0,                                  /*tp_richcompare*/
    offsetof(__pyx_GeneratorObject, gi_weakreflist), /* tp_weaklistoffse */
    0,                                  /*tp_iter*/
    (iternextfunc) __Pyx_Generator_Next, /*tp_iternext*/
    __pyx_Generator_methods,            /*tp_methods*/
    __pyx_Generator_memberlist,         /*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*/
    0,                                  /*tp_new*/
    0,                                  /*tp_free*/
    0,                                  /*tp_is_gc*/
    0,                                  /*tp_bases*/
    0,                                  /*tp_mro*/
    0,                                  /*tp_cache*/
    0,                                  /*tp_subclasses*/
    0,                                  /*tp_weaklist*/
#if PY_VERSION_HEX >= 0x030400a1
    0,                                  /*tp_del*/
#else
    __Pyx_Generator_del,                /*tp_del*/
#endif
#if PY_VERSION_HEX >= 0x02060000
    0,                                  /*tp_version_tag*/
#endif
#if PY_VERSION_HEX >= 0x030400a1
    __Pyx_Generator_del,                /*tp_finalize*/
#endif
};
static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body,
                                                  PyObject *closure) {
    __pyx_GeneratorObject *gen =
        PyObject_GC_New(__pyx_GeneratorObject, &__pyx_GeneratorType_type);
    if (gen == NULL)
        return NULL;
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    gen->exc_type = NULL;
    gen->exc_value = NULL;
    gen->exc_traceback = NULL;
    gen->gi_weakreflist = NULL;
    PyObject_GC_Track(gen);
    return gen;
}
static int __pyx_Generator_init(void) {
    __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
    if (__pyx_GeneratorType == NULL) {
        return -1;
    }
    return 0;
}

static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        #if PY_VERSION_HEX < 0x02050000
        return PyErr_Warn(NULL, message);
        #else
        return PyErr_WarnEx(NULL, message, 1);
        #endif
    }
    return 0;
}

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

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,            /*int argcount,*/
        0,            /*int kwonlyargcount,*/
        0,            /*int nlocals,*/
        0,            /*int stacksize,*/
        0,            /*int flags,*/
        __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,      /*int firstlineno,*/
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_globals = 0;
    PyFrameObject *py_frame = 0;
    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
    }
    py_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) goto bad;
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        py_globals,          /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = py_line;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

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  /* Python 3+ has unicode identifiers */
        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;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str));
}
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
static CYTHON_INLINE 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)) {
#if PY_VERSION_HEX < 0x03030000
        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 /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/
        *length = PyBytes_GET_SIZE(defenc);
        return defenc_c;
#else /* PY_VERSION_HEX < 0x03030000 */
        if (PyUnicode_READY(o) == -1) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        if (PyUnicode_IS_ASCII(o)) {
            *length = PyUnicode_GET_DATA_SIZE(o);
            return PyUnicode_AsUTF8(o);
        } else {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
        return PyUnicode_AsUTF8AndSize(o, length);
#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
#endif /* PY_VERSION_HEX < 0x03030000 */
    } else
#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII  || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
#if PY_VERSION_HEX >= 0x02060000
    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 PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return Py_INCREF(x), x;
  m = Py_TYPE(x)->tp_as_number;
#if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_MAJOR_VERSION < 3
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%.4s__ returned non-%.4s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
 #endif
#endif
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)))
      return PyInt_AS_LONG(b);
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
     #if CYTHON_USE_PYLONG_INTERNALS
       switch (Py_SIZE(b)) {
       case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
       case  0: return 0;
       case  1: return ((PyLongObject*)b)->ob_digit[0];
       }
     #endif
    #endif
  #if PY_VERSION_HEX < 0x02060000
    return PyInt_AsSsize_t(b);
  #else
    return PyLong_AsSsize_t(b);
  #endif
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
#if PY_VERSION_HEX < 0x02050000
   if (ival <= LONG_MAX)
       return PyInt_FromLong((long)ival);
   else {
       unsigned char *bytes = (unsigned char *) &ival;
       int one = 1; int little = (int)*(unsigned char*)&one;
       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
   }
#else
   return PyInt_FromSize_t(ival);
#endif
}


#endif /* Py_PYTHON_H */
