/* Generated by Cython 0.23.4 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
    #error Cython requires Python 2.6+ or Python 3.2+.
#else
#define CYTHON_ABI "0_23_4"
#include <stddef.h>
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#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 !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000
#define CYTHON_USE_PYLONG_INTERNALS 1
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
#define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_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
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#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
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
#endif
#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))
#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_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#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_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if PY_VERSION_HEX >= 0x030500B1
#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
typedef struct {
    unaryfunc am_await;
    unaryfunc am_aiter;
    unaryfunc am_anext;
} __Pyx_PyAsyncMethodsStruct;
#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
#else
#define __Pyx_PyType_AsAsync(obj) NULL
#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
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)

#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

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


#if 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

#define __PYX_HAVE__hug__decorators
#define __PYX_HAVE_API__hug__decorators
#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
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED 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;

#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_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER) && defined (_M_X64)
    #define __Pyx_sst_abs(value) _abs64(value)
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE 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(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#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 (size_t)(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_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(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;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (!ascii_chars_u) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


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

static 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[] = {
  "hug/decorators.py",
};

/*--- Type declarations ---*/
struct __pyx_obj_3hug_10decorators___pyx_scope_struct__default_output_format;
struct __pyx_obj_3hug_10decorators___pyx_scope_struct_1_default_input_format;
struct __pyx_obj_3hug_10decorators___pyx_scope_struct_2_directive;
struct __pyx_obj_3hug_10decorators___pyx_scope_struct_3_extend_api;
struct __pyx_obj_3hug_10decorators___pyx_scope_struct_4__api_module;
struct __pyx_obj_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema;
struct __pyx_obj_3hug_10decorators___pyx_scope_struct_6__create_interface;
struct __pyx_obj_3hug_10decorators___pyx_scope_struct_7_not_found;
struct __pyx_obj_3hug_10decorators___pyx_scope_struct_8_call;
struct __pyx_obj_3hug_10decorators___pyx_scope_struct_9_cli;
struct __pyx_obj_3hug_10decorators___pyx_scope_struct_10_decorator;
struct __pyx_defaults;
typedef struct __pyx_defaults __pyx_defaults;
struct __pyx_defaults1;
typedef struct __pyx_defaults1 __pyx_defaults1;
struct __pyx_defaults {
  PyObject *__pyx_arg_defaults;
};
struct __pyx_defaults1 {
  PyObject *__pyx_arg_accept;
  PyObject *__pyx_arg_defaults;
};

/* "hug/decorators.py":137
 * 
 * 
 * def default_output_format(content_type='application/json', apply_globally=False):             # <<<<<<<<<<<<<<
 *     '''A decorator that allows you to override the default output format for an API'''
 *     def decorator(formatter):
 */
struct __pyx_obj_3hug_10decorators___pyx_scope_struct__default_output_format {
  PyObject_HEAD
  PyObject *__pyx_v_apply_globally;
  PyObject *__pyx_v_content_type;
};


/* "hug/decorators.py":150
 * 
 * 
 * def default_input_format(content_type='application/json', apply_globally=False):             # <<<<<<<<<<<<<<
 *     '''A decorator that allows you to override the default output format for an API'''
 *     def decorator(formatter):
 */
struct __pyx_obj_3hug_10decorators___pyx_scope_struct_1_default_input_format {
  PyObject_HEAD
  PyObject *__pyx_v_apply_globally;
  PyObject *__pyx_v_content_type;
};


/* "hug/decorators.py":163
 * 
 * 
 * def directive(apply_globally=True):             # <<<<<<<<<<<<<<
 *     '''A decorator that registers a single hug directive'''
 *     def decorator(directive_method):
 */
struct __pyx_obj_3hug_10decorators___pyx_scope_struct_2_directive {
  PyObject_HEAD
  PyObject *__pyx_v_apply_globally;
};


/* "hug/decorators.py":196
 * 
 * 
 * def extend_api(route=""):             # <<<<<<<<<<<<<<
 *     '''Extends the current api, with handlers from an imported api. Optionally provide a route that prefixes access'''
 *     def decorator(extend_with):
 */
struct __pyx_obj_3hug_10decorators___pyx_scope_struct_3_extend_api {
  PyObject_HEAD
  PyObject *__pyx_v_route;
};


/* "hug/decorators.py":206
 * 
 * 
 * def _api_module(module_name):             # <<<<<<<<<<<<<<
 *     module = sys.modules[module_name]
 *     if not '__hug__' in module.__dict__:
 */
struct __pyx_obj_3hug_10decorators___pyx_scope_struct_4__api_module {
  PyObject_HEAD
  PyObject *__pyx_v_module;
};


/* "hug/decorators.py":219
 * 
 * 
 * def _marshmallow_schema(marshmallow):             # <<<<<<<<<<<<<<
 *     '''Dynamically generates a hug style type handler from a Marshmallow style schema'''
 *     def marshmallow_type(input_data):
 */
struct __pyx_obj_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema {
  PyObject_HEAD
  PyObject *__pyx_v_marshmallow;
};


/* "hug/decorators.py":232
 * 
 * 
 * def _create_interface(module, api_function, parameters=None, defaults={}, output=None, versions=None,             # <<<<<<<<<<<<<<
 *                       parse_body=True, set_status=False, transform=None, requires=()):
 *     '''Creates the request handling interface method for the given API function'''
 */
struct __pyx_obj_3hug_10decorators___pyx_scope_struct_6__create_interface {
  PyObject_HEAD
  PyObject *__pyx_v_accepted_parameters;
  PyObject *__pyx_v_api_function;
  PyObject *__pyx_v_default_kwargs;
  PyObject *__pyx_v_defaults;
  PyObject *__pyx_v_function_output;
  PyObject *__pyx_v_function_output_args;
  PyObject *__pyx_v_input_transformations;
  PyObject *__pyx_v_module;
  PyObject *__pyx_v_named_directives;
  PyObject *__pyx_v_parse_body;
  PyObject *__pyx_v_required;
  PyObject *__pyx_v_requires;
  PyObject *__pyx_v_set_status;
  PyObject *__pyx_v_takes_kwargs;
  PyObject *__pyx_v_transform;
  PyObject *__pyx_v_transform_args;
  PyObject *__pyx_v_versions;
};


/* "hug/decorators.py":425
 * 
 * 
 * def not_found(output=None, versions=None, parse_body=False, transform=None, requires=()):             # <<<<<<<<<<<<<<
 *     '''A decorator to register a 404 handler'''
 *     versions = (versions, ) if isinstance(versions, (int, float, None.__class__)) else versions
 */
struct __pyx_obj_3hug_10decorators___pyx_scope_struct_7_not_found {
  PyObject_HEAD
  PyObject *__pyx_v_output;
  PyObject *__pyx_v_parse_body;
  PyObject *__pyx_v_requires;
  PyObject *__pyx_v_transform;
  PyObject *__pyx_v_versions;
};


/* "hug/decorators.py":444
 * 
 * 
 * def call(urls=None, accept=HTTP_METHODS, parameters=None, defaults={}, output=None, examples=(), versions=None,             # <<<<<<<<<<<<<<
 *          parse_body=True, transform=None, requires=()):
 *     '''Defines the base Hug API creating decorator, which exposes normal python methods as HTTP APIs'''
 */
struct __pyx_obj_3hug_10decorators___pyx_scope_struct_8_call {
  PyObject_HEAD
  PyObject *__pyx_v_accept;
  PyObject *__pyx_v_defaults;
  PyObject *__pyx_v_examples;
  PyObject *__pyx_v_output;
  PyObject *__pyx_v_parameters;
  PyObject *__pyx_v_parse_body;
  PyObject *__pyx_v_requires;
  PyObject *__pyx_v_transform;
  PyObject *__pyx_v_urls;
  PyObject *__pyx_v_versions;
};


/* "hug/decorators.py":475
 * 
 * 
 * def cli(name=None, version=None, doc=None, transform=None, output=None):             # <<<<<<<<<<<<<<
 *     '''Enables exposing a Hug compatible function as a Command Line Interface'''
 *     def decorator(api_function):
 */
struct __pyx_obj_3hug_10decorators___pyx_scope_struct_9_cli {
  PyObject_HEAD
  PyObject *__pyx_v_doc;
  PyObject *__pyx_v_name;
  PyObject *__pyx_v_output;
  PyObject *__pyx_v_transform;
  PyObject *__pyx_v_version;
};


/* "hug/decorators.py":477
 * def cli(name=None, version=None, doc=None, transform=None, output=None):
 *     '''Enables exposing a Hug compatible function as a Command Line Interface'''
 *     def decorator(api_function):             # <<<<<<<<<<<<<<
 *         module = module = _api_module(api_function.__module__)
 * 
 */
struct __pyx_obj_3hug_10decorators___pyx_scope_struct_10_decorator {
  PyObject_HEAD
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_9_cli *__pyx_outer_scope;
  PyObject *__pyx_v_api_function;
  PyObject *__pyx_v_cli_interface;
  PyObject *__pyx_v_defaults;
  PyObject *__pyx_v_karg_method;
  PyObject *__pyx_v_module;
  PyObject *__pyx_v_named_directives;
  PyObject *__pyx_v_output_transform;
  PyObject *__pyx_v_parser;
};


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

#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);

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

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

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

#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 PyObject *__Pyx_GetModuleGlobalName(PyObject *name);

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

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

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

static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);

static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);

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

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

#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_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

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

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

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;
#if PY_VERSION_HEX < 0x030500A0
    PyObject *func_weakreflist;
#endif
    PyObject *func_dict;
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
    PyObject *func_classobj;
    void *defaults;
    int defaults_pyobjects;
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
#define __Pyx_CyFunction_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_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);

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

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

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#define __Pyx_PyCallable_Check(obj)   ((obj)->ob_type->tp_call != NULL)
#else
#define __Pyx_PyCallable_Check(obj)   PyCallable_Check(obj)
#endif

static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);

typedef struct {
    PyObject *type;
    PyObject **method_name;
    PyCFunction func;
    PyObject *method;
    int flag;
} __Pyx_CachedCFunction;

static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CallUnboundCMethod0(cfunc, self)\
    ((likely((cfunc)->func)) ?\
        (likely((cfunc)->flag == METH_NOARGS) ?  (*((cfunc)->func))(self, NULL) :\
         (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ?  ((*(PyCFunctionWithKeywords)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\
             ((cfunc)->flag == METH_VARARGS ?  (*((cfunc)->func))(self, __pyx_empty_tuple) : __Pyx__CallUnboundCMethod0(cfunc, self)))) :\
        __Pyx__CallUnboundCMethod0(cfunc, self))
#else
#define __Pyx_CallUnboundCMethod0(cfunc, self)  __Pyx__CallUnboundCMethod0(cfunc, self)
#endif

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

#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred()) {
            PyObject* args = PyTuple_Pack(1, key);
            if (likely(args))
                PyErr_SetObject(PyExc_KeyError, args);
            Py_XDECREF(args);
        }
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#else
    #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#endif

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

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

#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);

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

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

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

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_AndObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_AndObjC(op1, op2, intval, inplace)\
    (inplace ? PyNumber_InPlaceAnd(op1, op2) : PyNumber_And(op1, op2))
#endif

static CYTHON_INLINE int __Pyx_PySet_Update(PyObject* set, PyObject* it);

static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CallUnboundCMethod1(cfunc, self, arg)\
    ((likely((cfunc)->func && (cfunc)->flag == METH_O)) ? (*((cfunc)->func))(self, arg) :\
        __Pyx__CallUnboundCMethod1(cfunc, self, arg))
#else
#define __Pyx_CallUnboundCMethod1(cfunc, self, arg)  __Pyx__CallUnboundCMethod1(cfunc, self, arg)
#endif

static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value);

#include <string.h>

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

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

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

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

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

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);
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
                                      PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);

static PyObject* __Pyx_Globals(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);

static int __Pyx_Print(PyObject*, PyObject *, int);
#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);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

static int __Pyx_check_binary_version(void);

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);


/* Module declarations from 'hug.decorators' */
static PyTypeObject *__pyx_ptype_3hug_10decorators___pyx_scope_struct__default_output_format = 0;
static PyTypeObject *__pyx_ptype_3hug_10decorators___pyx_scope_struct_1_default_input_format = 0;
static PyTypeObject *__pyx_ptype_3hug_10decorators___pyx_scope_struct_2_directive = 0;
static PyTypeObject *__pyx_ptype_3hug_10decorators___pyx_scope_struct_3_extend_api = 0;
static PyTypeObject *__pyx_ptype_3hug_10decorators___pyx_scope_struct_4__api_module = 0;
static PyTypeObject *__pyx_ptype_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema = 0;
static PyTypeObject *__pyx_ptype_3hug_10decorators___pyx_scope_struct_6__create_interface = 0;
static PyTypeObject *__pyx_ptype_3hug_10decorators___pyx_scope_struct_7_not_found = 0;
static PyTypeObject *__pyx_ptype_3hug_10decorators___pyx_scope_struct_8_call = 0;
static PyTypeObject *__pyx_ptype_3hug_10decorators___pyx_scope_struct_9_cli = 0;
static PyTypeObject *__pyx_ptype_3hug_10decorators___pyx_scope_struct_10_decorator = 0;
#define __Pyx_MODULE_NAME "hug.decorators"
int __pyx_module_is_main_hug__decorators = 0;

/* Implementation of 'hug.decorators' */
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_property;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_reversed;
static PyObject *__pyx_builtin_Exception;
static PyObject *__pyx_builtin_max;
static PyObject *__pyx_builtin_vars;
static char __pyx_k_[] = "";
static char __pyx_k_0[] = "/{0}";
static char __pyx_k_h[] = "h";
static char __pyx_k_p[] = "p";
static char __pyx_k_v[] = "-v";
static char __pyx_k_os[] = "os";
static char __pyx_k_0_1[] = "{0} {1}";
static char __pyx_k_0_2[] = "-{0}";
static char __pyx_k_0_3[] = "--{0}";
static char __pyx_k__43[] = "*";
static char __pyx_k_api[] = "api";
static char __pyx_k_cli[] = "cli";
static char __pyx_k_doc[] = "__doc__";
static char __pyx_k_end[] = "end";
static char __pyx_k_get[] = "get";
static char __pyx_k_hug[] = "hug";
static char __pyx_k_key[] = "key";
static char __pyx_k_max[] = "max";
static char __pyx_k_pop[] = "pop";
static char __pyx_k_sys[] = "sys";
static char __pyx_k_url[] = "url";
static char __pyx_k_v_2[] = "v";
static char __pyx_k_args[] = "args";
static char __pyx_k_body[] = "body";
static char __pyx_k_call[] = "call";
static char __pyx_k_code[] = "__code__";
static char __pyx_k_data[] = "data";
static char __pyx_k_dict[] = "__dict__";
static char __pyx_k_dump[] = "dump";
static char __pyx_k_file[] = "file";
static char __pyx_k_help[] = "help";
static char __pyx_k_init[] = "__init__";
static char __pyx_k_keys[] = "keys";
static char __pyx_k_load[] = "load";
static char __pyx_k_main[] = "__main__";
static char __pyx_k_name[] = "name";
static char __pyx_k_path[] = "path";
static char __pyx_k_port[] = "port";
static char __pyx_k_read[] = "read";
static char __pyx_k_seek[] = "seek";
static char __pyx_k_self[] = "self";
static char __pyx_k_sink[] = "sink";
static char __pyx_k_size[] = "size";
static char __pyx_k_test[] = "__test__";
static char __pyx_k_type[] = "type";
static char __pyx_k_urls[] = "urls";
static char __pyx_k_utf8[] = "utf8";
static char __pyx_k_vars[] = "vars";
static char __pyx_k_INTRO[] = "INTRO";
static char __pyx_k_chain[] = "chain";
static char __pyx_k_class[] = "__class__";
static char __pyx_k_close[] = "close";
static char __pyx_k_doc_2[] = "doc";
static char __pyx_k_error[] = "error";
static char __pyx_k_httpd[] = "httpd";
static char __pyx_k_hug_2[] = "hug_";
static char __pyx_k_hug_3[] = "__hug__";
static char __pyx_k_index[] = "index";
static char __pyx_k_items[] = "items";
static char __pyx_k_kargs[] = "kargs";
static char __pyx_k_loads[] = "loads";
static char __pyx_k_lower[] = "lower";
static char __pyx_k_nargs[] = "nargs";
static char __pyx_k_print[] = "print";
static char __pyx_k_range[] = "range";
static char __pyx_k_route[] = "route";
static char __pyx_k_serve[] = "serve";
static char __pyx_k_slots[] = "__slots__";
static char __pyx_k_start[] = "start";
static char __pyx_k_upper[] = "upper";
static char __pyx_k_wraps[] = "wraps";
static char __pyx_k_HugAPI[] = "HugAPI";
static char __pyx_k_accept[] = "accept";
static char __pyx_k_action[] = "action";
static char __pyx_k_append[] = "append";
static char __pyx_k_decode[] = "decode";
static char __pyx_k_errors[] = "errors";
static char __pyx_k_extend[] = "extend";
static char __pyx_k_falcon[] = "falcon";
static char __pyx_k_format[] = "format";
static char __pyx_k_import[] = "__import__";
static char __pyx_k_isfile[] = "isfile";
static char __pyx_k_kwargs[] = "kwargs";
static char __pyx_k_length[] = "length";
static char __pyx_k_method[] = "method";
static char __pyx_k_module[] = "module";
static char __pyx_k_name_2[] = "__name__";
static char __pyx_k_object[] = "object";
static char __pyx_k_option[] = "option";
static char __pyx_k_output[] = "output";
static char __pyx_k_params[] = "params";
static char __pyx_k_parser[] = "parser";
static char __pyx_k_result[] = "result";
static char __pyx_k_return[] = "return";
static char __pyx_k_routes[] = "routes";
static char __pyx_k_self_2[] = "__self__";
static char __pyx_k_server[] = "server";
static char __pyx_k_setter[] = "setter";
static char __pyx_k_status[] = "status";
static char __pyx_k_stream[] = "stream";
static char __pyx_k_update[] = "update";
static char __pyx_k_values[] = "values";
static char __pyx_k_default[] = "default";
static char __pyx_k_getsize[] = "getsize";
static char __pyx_k_handler[] = "handler";
static char __pyx_k_hug_run[] = "hug.run";
static char __pyx_k_message[] = "message";
static char __pyx_k_modules[] = "modules";
static char __pyx_k_partial[] = "partial";
static char __pyx_k_prepare[] = "__prepare__";
static char __pyx_k_reasons[] = "reasons";
static char __pyx_k_request[] = "request";
static char __pyx_k_require[] = "require";
static char __pyx_k_version[] = "version";
static char __pyx_k_HTTP_206[] = "HTTP_206";
static char __pyx_k_argparse[] = "argparse";
static char __pyx_k_co_flags[] = "co_flags";
static char __pyx_k_defaults[] = "defaults";
static char __pyx_k_examples[] = "examples";
static char __pyx_k_handlers[] = "handlers";
static char __pyx_k_hug_wsgi[] = "__hug_wsgi__";
static char __pyx_k_module_2[] = "__module__";
static char __pyx_k_property[] = "property";
static char __pyx_k_qualname[] = "__qualname__";
static char __pyx_k_required[] = "required";
static char __pyx_k_requires[] = "requires";
static char __pyx_k_response[] = "response";
static char __pyx_k_reversed[] = "reversed";
static char __pyx_k_versions[] = "versions";
static char __pyx_k_Exception[] = "Exception";
static char __pyx_k_arguments[] = "arguments";
static char __pyx_k_decorator[] = "decorator";
static char __pyx_k_directive[] = "directive";
static char __pyx_k_enumerate[] = "enumerate";
static char __pyx_k_formatter[] = "formatter";
static char __pyx_k_functools[] = "functools";
static char __pyx_k_interface[] = "interface";
static char __pyx_k_is_method[] = "is_method";
static char __pyx_k_itertools[] = "itertools";
static char __pyx_k_metaclass[] = "__metaclass__";
static char __pyx_k_nargs_set[] = "nargs_set";
static char __pyx_k_not_found[] = "not_found";
static char __pyx_k_parameter[] = "parameter";
static char __pyx_k_to_return[] = "to_return";
static char __pyx_k_transform[] = "transform";
static char __pyx_k_version_2[] = "--version";
static char __pyx_k_versioned[] = "versioned";
static char __pyx_k_annotation[] = "annotation";
static char __pyx_k_api_module[] = "_api_module";
static char __pyx_k_conclusion[] = "conclusion";
static char __pyx_k_defaults_2[] = "__defaults__";
static char __pyx_k_directives[] = "directives";
static char __pyx_k_extend_api[] = "extend_api";
static char __pyx_k_hug_format[] = "hug.format";
static char __pyx_k_input_data[] = "input_data";
static char __pyx_k_item_route[] = "item_route";
static char __pyx_k_middleware[] = "_middleware";
static char __pyx_k_namedtuple[] = "namedtuple";
static char __pyx_k_parameters[] = "parameters";
static char __pyx_k_parse_args[] = "parse_args";
static char __pyx_k_parse_body[] = "parse_body";
static char __pyx_k_set_status[] = "set_status";
static char __pyx_k_setdefault[] = "setdefault";
static char __pyx_k_store_true[] = "store_true";
static char __pyx_k_stream_len[] = "stream_len";
static char __pyx_k_underscore[] = "underscore";
static char __pyx_k_OrderedDict[] = "OrderedDict";
static char __pyx_k_annotations[] = "__annotations__";
static char __pyx_k_api_version[] = "api_version";
static char __pyx_k_co_argcount[] = "co_argcount";
static char __pyx_k_co_varnames[] = "co_varnames";
static char __pyx_k_collections[] = "collections";
static char __pyx_k_description[] = "description";
static char __pyx_k_deserialize[] = "deserialize";
static char __pyx_k_extend_with[] = "extend_with";
static char __pyx_k_hug_serving[] = "__hug_serving__";
static char __pyx_k_karg_method[] = "karg_method";
static char __pyx_k_karg_values[] = "karg_values";
static char __pyx_k_make_server[] = "make_server";
static char __pyx_k_marshmallow[] = "marshmallow";
static char __pyx_k_module_name[] = "module_name";
static char __pyx_k_output_type[] = "output_type";
static char __pyx_k_requirement[] = "requirement";
static char __pyx_k_takes_kargs[] = "takes_kargs";
static char __pyx_k_transformer[] = "transformer";
static char __pyx_k_AUTO_INCLUDE[] = "AUTO_INCLUDE";
static char __pyx_k_HTTP_METHODS[] = "HTTP_METHODS";
static char __pyx_k_HugAPI_serve[] = "HugAPI.serve";
static char __pyx_k_add_argument[] = "add_argument";
static char __pyx_k_api_function[] = "api_function";
static char __pyx_k_content_type[] = "content_type";
static char __pyx_k_directives_2[] = "_directives";
static char __pyx_k_extra_kwargs[] = "extra_kwargs";
static char __pyx_k_hug_defaults[] = "hug.defaults";
static char __pyx_k_input_format[] = "_input_format";
static char __pyx_k_intersection[] = "intersection";
static char __pyx_k_middleware_2[] = "middleware";
static char __pyx_k_short_option[] = "short_option";
static char __pyx_k_takes_kwargs[] = "takes_kwargs";
static char __pyx_k_type_handler[] = "type_handler";
static char __pyx_k_use_examples[] = "use_examples";
static char __pyx_k_used_options[] = "used_options";
static char __pyx_k_HugAPI___init[] = "HugAPI.__init__";
static char __pyx_k_HugAPI_extend[] = "HugAPI.extend";
static char __pyx_k_add_directive[] = "add_directive";
static char __pyx_k_annotations_2[] = "annotations";
static char __pyx_k_cli_behaviour[] = "cli_behaviour";
static char __pyx_k_cli_interface[] = "cli_interface";
static char __pyx_k_content_range[] = "content_range";
static char __pyx_k_output_format[] = "_output_format";
static char __pyx_k_serve_forever[] = "serve_forever";
static char __pyx_k_ArgumentParser[] = "ArgumentParser";
static char __pyx_k_HTTP_NOT_FOUND[] = "HTTP_NOT_FOUND";
static char __pyx_k_add_middleware[] = "add_middleware";
static char __pyx_k_apply_globally[] = "apply_globally";
static char __pyx_k_content_length[] = "content_length";
static char __pyx_k_default_kwargs[] = "default_kwargs";
static char __pyx_k_hug_decorators[] = "hug.decorators";
static char __pyx_k_hug_exceptions[] = "hug.exceptions";
static char __pyx_k_input_format_2[] = "input_format";
static char __pyx_k_method_handler[] = "method_handler";
static char __pyx_k_transform_args[] = "transform_args";
static char __pyx_k_use_directives[] = "use_directives";
static char __pyx_k_InvalidTypeData[] = "InvalidTypeData";
static char __pyx_k_callable_method[] = "callable_method";
static char __pyx_k_function_output[] = "function_output";
static char __pyx_k_output_format_2[] = "output_format";
static char __pyx_k_process_request[] = "process_request";
static char __pyx_k_version_mapping[] = "version_mapping";
static char __pyx_k_HTTP_BAD_REQUEST[] = "HTTP_BAD_REQUEST";
static char __pyx_k_HugAPI_directive[] = "HugAPI.directive";
static char __pyx_k_MiddlewareRouter[] = "MiddlewareRouter";
static char __pyx_k_application_json[] = "application/json";
static char __pyx_k_create_interface[] = "_create_interface";
static char __pyx_k_directive_method[] = "directive_method";
static char __pyx_k_input_parameters[] = "input_parameters";
static char __pyx_k_marshmallow_type[] = "marshmallow_type";
static char __pyx_k_named_directives[] = "named_directives";
static char __pyx_k_no_documentation[] = "no_documentation";
static char __pyx_k_output_transform[] = "output_transform";
static char __pyx_k_pass_to_function[] = "pass_to_function";
static char __pyx_k_process_response[] = "process_response";
static char __pyx_k_set_input_format[] = "set_input_format";
static char __pyx_k_HugAPI_directives[] = "HugAPI.directives";
static char __pyx_k_HugAPI_middleware[] = "HugAPI.middleware";
static char __pyx_k_Serving_on_port_0[] = "Serving on port {0}...";
static char __pyx_k_directive_sources[] = "directive_sources";
static char __pyx_k_hug_output_format[] = "hug.output_format";
static char __pyx_k_middleware_method[] = "middleware_method";
static char __pyx_k_marshmallow_schema[] = "_marshmallow_schema";
static char __pyx_k_not_found_handlers[] = "_not_found_handlers";
static char __pyx_k_request_middleware[] = "request_middleware";
static char __pyx_k_without_directives[] = "without_directives";
static char __pyx_k_HugAPI_input_format[] = "HugAPI.input_format";
static char __pyx_k_Invalid_0_passed_in[] = "Invalid {0} passed in";
static char __pyx_k_accepted_parameters[] = "accepted_parameters";
static char __pyx_k_response_middleware[] = "response_middleware";
static char __pyx_k_HugAPI_add_directive[] = "HugAPI.add_directive";
static char __pyx_k_HugAPI_output_format[] = "HugAPI.output_format";
static char __pyx_k_api_auto_instantiate[] = "api_auto_instantiate";
static char __pyx_k_cli_locals_decorator[] = "cli.<locals>.decorator";
static char __pyx_k_default_input_format[] = "default_input_format";
static char __pyx_k_function_output_args[] = "function_output_args";
static char __pyx_k_input_format_handler[] = "input_format_handler";
static char __pyx_k_not_found_handlers_2[] = "not_found_handlers";
static char __pyx_k_HugAPI_add_middleware[] = "HugAPI.add_middleware";
static char __pyx_k_call_locals_decorator[] = "call.<locals>.decorator";
static char __pyx_k_default_output_format[] = "default_output_format";
static char __pyx_k_input_transformations[] = "input_transformations";
static char __pyx_k_set_not_found_handler[] = "set_not_found_handler";
static char __pyx_k_wsgiref_simple_server[] = "wsgiref.simple_server";
static char __pyx_k_function_output_kwargs[] = "function_output_kwargs";
static char __pyx_k_HugAPI_set_input_format[] = "HugAPI.set_input_format";
static char __pyx_k_body_formatting_handler[] = "body_formatting_handler";
static char __pyx_k_HugAPI_not_found_handlers[] = "HugAPI.not_found_handlers";
static char __pyx_k_directive_locals_decorator[] = "directive.<locals>.decorator";
static char __pyx_k_not_found_locals_decorator[] = "not_found.<locals>.decorator";
static char __pyx_k_extend_api_locals_decorator[] = "extend_api.<locals>.decorator";
static char __pyx_k_HugAPI_set_not_found_handler[] = "HugAPI.set_not_found_handler";
static char __pyx_k_home_tcrosley_Projects_hug_hug[] = "/home/tcrosley/Projects/hug/hug/decorators.py";
static char __pyx_k_Required_parameter_not_supplied[] = "Required parameter not supplied";
static char __pyx_k_api_module_locals_api_auto_inst[] = "_api_module.<locals>.api_auto_instantiate";
static char __pyx_k_cli_locals_decorator_locals_cli[] = "cli.<locals>.decorator.<locals>.cli_interface";
static char __pyx_k_create_interface_locals_callabl[] = "_create_interface.<locals>.callable_method.<locals>.<lambda>";
static char __pyx_k_create_interface_locals_interfa[] = "_create_interface.<locals>.interface";
static char __pyx_k_marshmallow_schema_locals_marsh[] = "_marshmallow_schema.<locals>.marshmallow_type";
static char __pyx_k_Exposes_a_Python_method_external[] = "Exposes a Python method externally as an HTTP {0} method";
static char __pyx_k_Stores_the_information_necessary[] = "Stores the information necessary to expose API calls within this module externally";
static char __pyx_k_cli_locals_decorator_locals_call[] = "cli.<locals>.decorator.<locals>.callable_method";
static char __pyx_k_default_input_format_locals_deco[] = "default_input_format.<locals>.decorator";
static char __pyx_k_default_output_format_locals_dec[] = "default_output_format.<locals>.decorator";
static char __pyx_k_hug_decorators_py_Defines_the_me[] = "hug/decorators.py\n\nDefines the method decorators at the core of Hug's approach to creating HTTP APIs\n\n- Decorators for exposing python method as HTTP methods (get, post, etc)\n- Decorators for setting the default output and input formats used throughout an API using the framework\n- Decorator for registering a new directive method\n- Decorator for including another API modules handlers into the current one, with opitonal prefix route\n\nCopyright (C) 2015  Timothy Edmund Crosley\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\nthe rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\nto permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or\nsubstantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\nTO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\nTHE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\nCONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n\n";
static char __pyx_k_request_middleware_locals_decora[] = "request_middleware.<locals>.decorator";
static char __pyx_k_response_middleware_locals_decor[] = "response_middleware.<locals>.decorator";
static char __pyx_k_create_interface_locals_callabl_2[] = "_create_interface.<locals>.callable_method";
static PyObject *__pyx_kp_s_;
static PyObject *__pyx_kp_s_0;
static PyObject *__pyx_kp_s_0_1;
static PyObject *__pyx_kp_s_0_2;
static PyObject *__pyx_kp_s_0_3;
static PyObject *__pyx_n_s_AUTO_INCLUDE;
static PyObject *__pyx_n_s_ArgumentParser;
static PyObject *__pyx_n_s_Exception;
static PyObject *__pyx_kp_s_Exposes_a_Python_method_external;
static PyObject *__pyx_n_s_HTTP_206;
static PyObject *__pyx_n_s_HTTP_BAD_REQUEST;
static PyObject *__pyx_n_s_HTTP_METHODS;
static PyObject *__pyx_n_s_HTTP_NOT_FOUND;
static PyObject *__pyx_n_s_HugAPI;
static PyObject *__pyx_n_s_HugAPI___init;
static PyObject *__pyx_n_s_HugAPI_add_directive;
static PyObject *__pyx_n_s_HugAPI_add_middleware;
static PyObject *__pyx_n_s_HugAPI_directive;
static PyObject *__pyx_n_s_HugAPI_directives;
static PyObject *__pyx_n_s_HugAPI_extend;
static PyObject *__pyx_n_s_HugAPI_input_format;
static PyObject *__pyx_n_s_HugAPI_middleware;
static PyObject *__pyx_n_s_HugAPI_not_found_handlers;
static PyObject *__pyx_n_s_HugAPI_output_format;
static PyObject *__pyx_n_s_HugAPI_serve;
static PyObject *__pyx_n_s_HugAPI_set_input_format;
static PyObject *__pyx_n_s_HugAPI_set_not_found_handler;
static PyObject *__pyx_n_s_INTRO;
static PyObject *__pyx_n_s_InvalidTypeData;
static PyObject *__pyx_kp_s_Invalid_0_passed_in;
static PyObject *__pyx_n_s_MiddlewareRouter;
static PyObject *__pyx_n_s_OrderedDict;
static PyObject *__pyx_kp_s_Required_parameter_not_supplied;
static PyObject *__pyx_kp_s_Serving_on_port_0;
static PyObject *__pyx_kp_s_Stores_the_information_necessary;
static PyObject *__pyx_kp_s__43;
static PyObject *__pyx_n_s_accept;
static PyObject *__pyx_n_s_accepted_parameters;
static PyObject *__pyx_n_s_action;
static PyObject *__pyx_n_s_add_argument;
static PyObject *__pyx_n_s_add_directive;
static PyObject *__pyx_n_s_add_middleware;
static PyObject *__pyx_n_s_annotation;
static PyObject *__pyx_n_s_annotations;
static PyObject *__pyx_n_s_annotations_2;
static PyObject *__pyx_n_s_api;
static PyObject *__pyx_n_s_api_auto_instantiate;
static PyObject *__pyx_n_s_api_function;
static PyObject *__pyx_n_s_api_module;
static PyObject *__pyx_n_s_api_module_locals_api_auto_inst;
static PyObject *__pyx_n_s_api_version;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_kp_s_application_json;
static PyObject *__pyx_n_s_apply_globally;
static PyObject *__pyx_n_s_argparse;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_n_s_arguments;
static PyObject *__pyx_n_s_body;
static PyObject *__pyx_n_s_body_formatting_handler;
static PyObject *__pyx_n_s_call;
static PyObject *__pyx_n_s_call_locals_decorator;
static PyObject *__pyx_n_s_callable_method;
static PyObject *__pyx_n_s_chain;
static PyObject *__pyx_n_s_class;
static PyObject *__pyx_n_s_cli;
static PyObject *__pyx_n_s_cli_behaviour;
static PyObject *__pyx_n_s_cli_interface;
static PyObject *__pyx_n_s_cli_locals_decorator;
static PyObject *__pyx_n_s_cli_locals_decorator_locals_call;
static PyObject *__pyx_n_s_cli_locals_decorator_locals_cli;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_co_argcount;
static PyObject *__pyx_n_s_co_flags;
static PyObject *__pyx_n_s_co_varnames;
static PyObject *__pyx_n_s_code;
static PyObject *__pyx_n_s_collections;
static PyObject *__pyx_n_s_conclusion;
static PyObject *__pyx_n_s_content_length;
static PyObject *__pyx_n_s_content_range;
static PyObject *__pyx_n_s_content_type;
static PyObject *__pyx_n_s_create_interface;
static PyObject *__pyx_n_s_create_interface_locals_callabl;
static PyObject *__pyx_n_s_create_interface_locals_callabl_2;
static PyObject *__pyx_n_s_create_interface_locals_interfa;
static PyObject *__pyx_n_s_data;
static PyObject *__pyx_n_s_decode;
static PyObject *__pyx_n_s_decorator;
static PyObject *__pyx_n_s_default;
static PyObject *__pyx_n_s_default_input_format;
static PyObject *__pyx_n_s_default_input_format_locals_deco;
static PyObject *__pyx_n_s_default_kwargs;
static PyObject *__pyx_n_s_default_output_format;
static PyObject *__pyx_n_s_default_output_format_locals_dec;
static PyObject *__pyx_n_s_defaults;
static PyObject *__pyx_n_s_defaults_2;
static PyObject *__pyx_n_s_description;
static PyObject *__pyx_n_s_deserialize;
static PyObject *__pyx_n_s_dict;
static PyObject *__pyx_n_s_directive;
static PyObject *__pyx_n_s_directive_locals_decorator;
static PyObject *__pyx_n_s_directive_method;
static PyObject *__pyx_n_s_directive_sources;
static PyObject *__pyx_n_s_directives;
static PyObject *__pyx_n_s_directives_2;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_doc_2;
static PyObject *__pyx_n_s_dump;
static PyObject *__pyx_n_s_end;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_n_s_error;
static PyObject *__pyx_n_s_errors;
static PyObject *__pyx_n_s_examples;
static PyObject *__pyx_n_s_extend;
static PyObject *__pyx_n_s_extend_api;
static PyObject *__pyx_n_s_extend_api_locals_decorator;
static PyObject *__pyx_n_s_extend_with;
static PyObject *__pyx_n_s_extra_kwargs;
static PyObject *__pyx_n_s_falcon;
static PyObject *__pyx_n_s_file;
static PyObject *__pyx_n_s_format;
static PyObject *__pyx_n_s_formatter;
static PyObject *__pyx_n_s_function_output;
static PyObject *__pyx_n_s_function_output_args;
static PyObject *__pyx_n_s_function_output_kwargs;
static PyObject *__pyx_n_s_functools;
static PyObject *__pyx_n_s_get;
static PyObject *__pyx_n_s_getsize;
static PyObject *__pyx_n_s_h;
static PyObject *__pyx_n_s_handler;
static PyObject *__pyx_n_s_handlers;
static PyObject *__pyx_n_s_help;
static PyObject *__pyx_kp_s_home_tcrosley_Projects_hug_hug;
static PyObject *__pyx_n_s_httpd;
static PyObject *__pyx_n_s_hug;
static PyObject *__pyx_n_s_hug_2;
static PyObject *__pyx_n_s_hug_3;
static PyObject *__pyx_n_s_hug_decorators;
static PyObject *__pyx_n_s_hug_defaults;
static PyObject *__pyx_n_s_hug_exceptions;
static PyObject *__pyx_n_s_hug_format;
static PyObject *__pyx_n_s_hug_output_format;
static PyObject *__pyx_n_s_hug_run;
static PyObject *__pyx_n_s_hug_serving;
static PyObject *__pyx_n_s_hug_wsgi;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_index;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_input_data;
static PyObject *__pyx_n_s_input_format;
static PyObject *__pyx_n_s_input_format_2;
static PyObject *__pyx_n_s_input_format_handler;
static PyObject *__pyx_n_s_input_parameters;
static PyObject *__pyx_n_s_input_transformations;
static PyObject *__pyx_n_s_interface;
static PyObject *__pyx_n_s_intersection;
static PyObject *__pyx_n_s_is_method;
static PyObject *__pyx_n_s_isfile;
static PyObject *__pyx_n_s_item_route;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_s_itertools;
static PyObject *__pyx_n_s_karg_method;
static PyObject *__pyx_n_s_karg_values;
static PyObject *__pyx_n_s_kargs;
static PyObject *__pyx_n_s_key;
static PyObject *__pyx_n_s_keys;
static PyObject *__pyx_n_s_kwargs;
static PyObject *__pyx_n_s_length;
static PyObject *__pyx_n_s_load;
static PyObject *__pyx_n_s_loads;
static PyObject *__pyx_n_s_lower;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_make_server;
static PyObject *__pyx_n_s_marshmallow;
static PyObject *__pyx_n_s_marshmallow_schema;
static PyObject *__pyx_n_s_marshmallow_schema_locals_marsh;
static PyObject *__pyx_n_s_marshmallow_type;
static PyObject *__pyx_n_s_max;
static PyObject *__pyx_n_s_message;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_method;
static PyObject *__pyx_n_s_method_handler;
static PyObject *__pyx_n_s_middleware;
static PyObject *__pyx_n_s_middleware_2;
static PyObject *__pyx_n_s_middleware_method;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_module_2;
static PyObject *__pyx_n_s_module_name;
static PyObject *__pyx_n_s_modules;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_s_named_directives;
static PyObject *__pyx_n_s_namedtuple;
static PyObject *__pyx_n_s_nargs;
static PyObject *__pyx_n_s_nargs_set;
static PyObject *__pyx_n_s_no_documentation;
static PyObject *__pyx_n_s_not_found;
static PyObject *__pyx_n_s_not_found_handlers;
static PyObject *__pyx_n_s_not_found_handlers_2;
static PyObject *__pyx_n_s_not_found_locals_decorator;
static PyObject *__pyx_n_s_object;
static PyObject *__pyx_n_s_option;
static PyObject *__pyx_n_s_os;
static PyObject *__pyx_n_s_output;
static PyObject *__pyx_n_s_output_format;
static PyObject *__pyx_n_s_output_format_2;
static PyObject *__pyx_n_s_output_transform;
static PyObject *__pyx_n_s_output_type;
static PyObject *__pyx_n_s_p;
static PyObject *__pyx_n_s_parameter;
static PyObject *__pyx_n_s_parameters;
static PyObject *__pyx_n_s_params;
static PyObject *__pyx_n_s_parse_args;
static PyObject *__pyx_n_s_parse_body;
static PyObject *__pyx_n_s_parser;
static PyObject *__pyx_n_s_partial;
static PyObject *__pyx_n_s_pass_to_function;
static PyObject *__pyx_n_s_path;
static PyObject *__pyx_n_s_pop;
static PyObject *__pyx_n_s_port;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_print;
static PyObject *__pyx_n_s_process_request;
static PyObject *__pyx_n_s_process_response;
static PyObject *__pyx_n_s_property;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_read;
static PyObject *__pyx_n_s_reasons;
static PyObject *__pyx_n_s_request;
static PyObject *__pyx_n_s_request_middleware;
static PyObject *__pyx_n_s_request_middleware_locals_decora;
static PyObject *__pyx_n_s_require;
static PyObject *__pyx_n_s_required;
static PyObject *__pyx_n_s_requirement;
static PyObject *__pyx_n_s_requires;
static PyObject *__pyx_n_s_response;
static PyObject *__pyx_n_s_response_middleware;
static PyObject *__pyx_n_s_response_middleware_locals_decor;
static PyObject *__pyx_n_s_result;
static PyObject *__pyx_n_s_return;
static PyObject *__pyx_n_s_reversed;
static PyObject *__pyx_n_s_route;
static PyObject *__pyx_n_s_routes;
static PyObject *__pyx_n_s_seek;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_self_2;
static PyObject *__pyx_n_s_serve;
static PyObject *__pyx_n_s_serve_forever;
static PyObject *__pyx_n_s_server;
static PyObject *__pyx_n_s_set_input_format;
static PyObject *__pyx_n_s_set_not_found_handler;
static PyObject *__pyx_n_s_set_status;
static PyObject *__pyx_n_s_setdefault;
static PyObject *__pyx_n_s_setter;
static PyObject *__pyx_n_s_short_option;
static PyObject *__pyx_n_s_sink;
static PyObject *__pyx_n_s_size;
static PyObject *__pyx_n_s_slots;
static PyObject *__pyx_n_s_start;
static PyObject *__pyx_n_s_status;
static PyObject *__pyx_n_s_store_true;
static PyObject *__pyx_n_s_stream;
static PyObject *__pyx_n_s_stream_len;
static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_s_takes_kargs;
static PyObject *__pyx_n_s_takes_kwargs;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_to_return;
static PyObject *__pyx_n_s_transform;
static PyObject *__pyx_n_s_transform_args;
static PyObject *__pyx_n_s_transformer;
static PyObject *__pyx_n_s_type;
static PyObject *__pyx_n_s_type_handler;
static PyObject *__pyx_n_s_underscore;
static PyObject *__pyx_n_s_update;
static PyObject *__pyx_n_s_upper;
static PyObject *__pyx_n_s_url;
static PyObject *__pyx_n_s_urls;
static PyObject *__pyx_n_s_use_directives;
static PyObject *__pyx_n_s_use_examples;
static PyObject *__pyx_n_s_used_options;
static PyObject *__pyx_n_s_utf8;
static PyObject *__pyx_kp_s_v;
static PyObject *__pyx_n_s_v_2;
static PyObject *__pyx_n_s_values;
static PyObject *__pyx_n_s_vars;
static PyObject *__pyx_n_s_version;
static PyObject *__pyx_kp_s_version_2;
static PyObject *__pyx_n_s_version_mapping;
static PyObject *__pyx_n_s_versioned;
static PyObject *__pyx_n_s_versions;
static PyObject *__pyx_n_s_without_directives;
static PyObject *__pyx_n_s_wraps;
static PyObject *__pyx_n_s_wsgiref_simple_server;
static PyObject *__pyx_pf_3hug_10decorators_6HugAPI___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_module); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_6HugAPI_2output_format(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_6HugAPI_4output_format(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_formatter); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_6HugAPI_6input_format(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_content_type); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_6HugAPI_8set_input_format(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_content_type, PyObject *__pyx_v_handler); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_6HugAPI_10directives(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_6HugAPI_12directive(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_6HugAPI_14add_directive(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_directive); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_6HugAPI_16middleware(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_6HugAPI_18add_middleware(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_middleware); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_6HugAPI_20extend(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_module, PyObject *__pyx_v_route); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_6HugAPI_22not_found_handlers(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_6HugAPI_24set_not_found_handler(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_handler, PyObject *__pyx_v_version); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_6HugAPI_26serve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_port, PyObject *__pyx_v_no_documentation); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_21default_output_format_decorator(PyObject *__pyx_self, PyObject *__pyx_v_formatter); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_default_output_format(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_content_type, PyObject *__pyx_v_apply_globally); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_20default_input_format_decorator(PyObject *__pyx_self, PyObject *__pyx_v_formatter); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_2default_input_format(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_content_type, PyObject *__pyx_v_apply_globally); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_9directive_decorator(PyObject *__pyx_self, PyObject *__pyx_v_directive_method); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_4directive(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_apply_globally); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_18request_middleware_decorator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_middleware_method); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_6request_middleware(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_19response_middleware_decorator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_middleware_method); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_8response_middleware(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_10extend_api_decorator(PyObject *__pyx_self, PyObject *__pyx_v_extend_with); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_10extend_api(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_route); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_11_api_module_api_auto_instantiate(PyObject *__pyx_self, PyObject *__pyx_v_kargs, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_12_api_module(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_module_name); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_19_marshmallow_schema_marshmallow_type(PyObject *__pyx_self, PyObject *__pyx_v_input_data); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_14_marshmallow_schema(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_marshmallow); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_24__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_17_create_interface_interface(PyObject *__pyx_self, PyObject *__pyx_v_request, PyObject *__pyx_v_response, PyObject *__pyx_v_api_version, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_version); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_17_create_interface_2callable_method(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_16_create_interface(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_module, PyObject *__pyx_v_api_function, PyObject *__pyx_v_parameters, PyObject *__pyx_v_defaults, PyObject *__pyx_v_output, PyObject *__pyx_v_versions, PyObject *__pyx_v_parse_body, PyObject *__pyx_v_set_status, PyObject *__pyx_v_transform, PyObject *__pyx_v_requires); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_9not_found_decorator(PyObject *__pyx_self, PyObject *__pyx_v_api_function); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_18not_found(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_output, PyObject *__pyx_v_versions, PyObject *__pyx_v_parse_body, PyObject *__pyx_v_transform, PyObject *__pyx_v_requires); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_26__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_4call_decorator(PyObject *__pyx_self, PyObject *__pyx_v_api_function); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_20call(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_urls, PyObject *__pyx_v_accept, PyObject *__pyx_v_parameters, PyObject *__pyx_v_defaults, PyObject *__pyx_v_output, PyObject *__pyx_v_examples, PyObject *__pyx_v_versions, PyObject *__pyx_v_parse_body, PyObject *__pyx_v_transform, PyObject *__pyx_v_requires); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_3cli_9decorator_cli_interface(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_3cli_9decorator_2callable_method(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_3cli_decorator(PyObject *__pyx_self, PyObject *__pyx_v_api_function); /* proto */
static PyObject *__pyx_pf_3hug_10decorators_22cli(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name, PyObject *__pyx_v_version, PyObject *__pyx_v_doc, PyObject *__pyx_v_transform, PyObject *__pyx_v_output); /* proto */
static PyObject *__pyx_tp_new_3hug_10decorators___pyx_scope_struct__default_output_format(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3hug_10decorators___pyx_scope_struct_1_default_input_format(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3hug_10decorators___pyx_scope_struct_2_directive(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3hug_10decorators___pyx_scope_struct_3_extend_api(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3hug_10decorators___pyx_scope_struct_4__api_module(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3hug_10decorators___pyx_scope_struct_6__create_interface(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3hug_10decorators___pyx_scope_struct_7_not_found(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3hug_10decorators___pyx_scope_struct_8_call(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3hug_10decorators___pyx_scope_struct_9_cli(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3hug_10decorators___pyx_scope_struct_10_decorator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items = {0, &__pyx_n_s_items, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PySet_Type_update = {0, &__pyx_n_s_update, 0, 0, 0};
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_8;
static PyObject *__pyx_int_8000;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_slice__24;
static PyObject *__pyx_slice__37;
static PyObject *__pyx_slice__38;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_tuple__20;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__28;
static PyObject *__pyx_tuple__30;
static PyObject *__pyx_tuple__32;
static PyObject *__pyx_tuple__33;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__36;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__41;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__47;
static PyObject *__pyx_tuple__49;
static PyObject *__pyx_tuple__51;
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__67;
static PyObject *__pyx_tuple__69;
static PyObject *__pyx_tuple__71;
static PyObject *__pyx_tuple__73;
static PyObject *__pyx_tuple__75;
static PyObject *__pyx_tuple__76;
static PyObject *__pyx_tuple__78;
static PyObject *__pyx_tuple__80;
static PyObject *__pyx_tuple__81;
static PyObject *__pyx_tuple__83;
static PyObject *__pyx_tuple__84;
static PyObject *__pyx_tuple__86;
static PyObject *__pyx_tuple__87;
static PyObject *__pyx_tuple__89;
static PyObject *__pyx_tuple__90;
static PyObject *__pyx_tuple__92;
static PyObject *__pyx_tuple__93;
static PyObject *__pyx_tuple__95;
static PyObject *__pyx_tuple__97;
static PyObject *__pyx_tuple__99;
static PyObject *__pyx_codeobj__3;
static PyObject *__pyx_codeobj__5;
static PyObject *__pyx_codeobj__7;
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__109;
static PyObject *__pyx_tuple__111;
static PyObject *__pyx_tuple__113;
static PyObject *__pyx_codeobj__11;
static PyObject *__pyx_codeobj__15;
static PyObject *__pyx_codeobj__17;
static PyObject *__pyx_codeobj__19;
static PyObject *__pyx_codeobj__21;
static PyObject *__pyx_codeobj__26;
static PyObject *__pyx_codeobj__29;
static PyObject *__pyx_codeobj__31;
static PyObject *__pyx_codeobj__34;
static PyObject *__pyx_codeobj__46;
static PyObject *__pyx_codeobj__48;
static PyObject *__pyx_codeobj__50;
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__68;
static PyObject *__pyx_codeobj__70;
static PyObject *__pyx_codeobj__72;
static PyObject *__pyx_codeobj__74;
static PyObject *__pyx_codeobj__77;
static PyObject *__pyx_codeobj__79;
static PyObject *__pyx_codeobj__82;
static PyObject *__pyx_codeobj__85;
static PyObject *__pyx_codeobj__88;
static PyObject *__pyx_codeobj__91;
static PyObject *__pyx_codeobj__94;
static PyObject *__pyx_codeobj__96;
static PyObject *__pyx_codeobj__98;
static PyObject *__pyx_codeobj__101;
static PyObject *__pyx_codeobj__103;
static PyObject *__pyx_codeobj__105;
static PyObject *__pyx_codeobj__107;
static PyObject *__pyx_codeobj__110;
static PyObject *__pyx_codeobj__112;

/* "hug/decorators.py":51
 *                  '_middleware', '_not_found_handlers')
 * 
 *     def __init__(self, module):             # <<<<<<<<<<<<<<
 *         self.module = module
 *         self.versions = set()
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_6HugAPI_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3hug_10decorators_6HugAPI_1__init__ = {"__init__", (PyCFunction)__pyx_pw_3hug_10decorators_6HugAPI_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3hug_10decorators_6HugAPI_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_module = 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_module,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_module)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __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 = 51; __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_module = 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 = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("hug.decorators.HugAPI.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3hug_10decorators_6HugAPI___init__(__pyx_self, __pyx_v_self, __pyx_v_module);

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

static PyObject *__pyx_pf_3hug_10decorators_6HugAPI___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_module) {
  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);

  /* "hug/decorators.py":52
 * 
 *     def __init__(self, module):
 *         self.module = module             # <<<<<<<<<<<<<<
 *         self.versions = set()
 *         self.routes = OrderedDict()
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_module, __pyx_v_module) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":53
 *     def __init__(self, module):
 *         self.module = module
 *         self.versions = set()             # <<<<<<<<<<<<<<
 *         self.routes = OrderedDict()
 *         self.versioned = OrderedDict()
 */
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_versions, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "hug/decorators.py":54
 *         self.module = module
 *         self.versions = set()
 *         self.routes = OrderedDict()             # <<<<<<<<<<<<<<
 *         self.versioned = OrderedDict()
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_routes, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "hug/decorators.py":55
 *         self.versions = set()
 *         self.routes = OrderedDict()
 *         self.versioned = OrderedDict()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_versioned, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "hug/decorators.py":51
 *                  '_middleware', '_not_found_handlers')
 * 
 *     def __init__(self, module):             # <<<<<<<<<<<<<<
 *         self.module = module
 *         self.versions = set()
 */

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

/* "hug/decorators.py":58
 * 
 *     @property
 *     def output_format(self):             # <<<<<<<<<<<<<<
 *         return getattr(self, '_output_format', hug.defaults.output_format)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_6HugAPI_3output_format(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_3hug_10decorators_6HugAPI_3output_format = {"output_format", (PyCFunction)__pyx_pw_3hug_10decorators_6HugAPI_3output_format, METH_O, 0};
static PyObject *__pyx_pw_3hug_10decorators_6HugAPI_3output_format(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("output_format (wrapper)", 0);
  __pyx_r = __pyx_pf_3hug_10decorators_6HugAPI_2output_format(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "hug/decorators.py":59
 *     @property
 *     def output_format(self):
 *         return getattr(self, '_output_format', hug.defaults.output_format)             # <<<<<<<<<<<<<<
 * 
 *     @output_format.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_hug); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_defaults); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __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_t_2, __pyx_n_s_output_format_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __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_GetAttr3(__pyx_v_self, __pyx_n_s_output_format, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __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;

  /* "hug/decorators.py":58
 * 
 *     @property
 *     def output_format(self):             # <<<<<<<<<<<<<<
 *         return getattr(self, '_output_format', hug.defaults.output_format)
 * 
 */

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

/* "hug/decorators.py":62
 * 
 *     @output_format.setter
 *     def output_format(self, formatter):             # <<<<<<<<<<<<<<
 *         self._output_format = formatter
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_6HugAPI_5output_format(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3hug_10decorators_6HugAPI_5output_format = {"output_format", (PyCFunction)__pyx_pw_3hug_10decorators_6HugAPI_5output_format, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3hug_10decorators_6HugAPI_5output_format(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_formatter = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("output_format (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_formatter,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_formatter)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("output_format", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "output_format") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __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_formatter = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("output_format", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("hug.decorators.HugAPI.output_format", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3hug_10decorators_6HugAPI_4output_format(__pyx_self, __pyx_v_self, __pyx_v_formatter);

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

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

  /* "hug/decorators.py":63
 *     @output_format.setter
 *     def output_format(self, formatter):
 *         self._output_format = formatter             # <<<<<<<<<<<<<<
 * 
 *     def input_format(self, content_type):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_output_format, __pyx_v_formatter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":62
 * 
 *     @output_format.setter
 *     def output_format(self, formatter):             # <<<<<<<<<<<<<<
 *         self._output_format = formatter
 * 
 */

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

/* "hug/decorators.py":65
 *         self._output_format = formatter
 * 
 *     def input_format(self, content_type):             # <<<<<<<<<<<<<<
 *         '''Returns the set input_format handler for the given content_type'''
 *         return getattr(self, '_input_format', {}).get(content_type, hug.defaults.input_format.get(content_type, None))
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_6HugAPI_7input_format(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3hug_10decorators_6HugAPI_6input_format[] = "Returns the set input_format handler for the given content_type";
static PyMethodDef __pyx_mdef_3hug_10decorators_6HugAPI_7input_format = {"input_format", (PyCFunction)__pyx_pw_3hug_10decorators_6HugAPI_7input_format, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3hug_10decorators_6HugAPI_6input_format};
static PyObject *__pyx_pw_3hug_10decorators_6HugAPI_7input_format(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_content_type = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("input_format (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_content_type,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_content_type)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("input_format", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "input_format") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __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_content_type = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("input_format", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("hug.decorators.HugAPI.input_format", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3hug_10decorators_6HugAPI_6input_format(__pyx_self, __pyx_v_self, __pyx_v_content_type);

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

static PyObject *__pyx_pf_3hug_10decorators_6HugAPI_6input_format(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_content_type) {
  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;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("input_format", 0);

  /* "hug/decorators.py":67
 *     def input_format(self, content_type):
 *         '''Returns the set input_format handler for the given content_type'''
 *         return getattr(self, '_input_format', {}).get(content_type, hug.defaults.input_format.get(content_type, None))             # <<<<<<<<<<<<<<
 * 
 *     def set_input_format(self, content_type, handler):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_self, __pyx_n_s_input_format, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_hug); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_defaults); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_input_format_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __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_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_4) {
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_INCREF(__pyx_v_content_type);
  __Pyx_GIVEREF(__pyx_v_content_type);
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_content_type);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, Py_None);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_5) {
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
  }
  __Pyx_INCREF(__pyx_v_content_type);
  __Pyx_GIVEREF(__pyx_v_content_type);
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_content_type);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "hug/decorators.py":65
 *         self._output_format = formatter
 * 
 *     def input_format(self, content_type):             # <<<<<<<<<<<<<<
 *         '''Returns the set input_format handler for the given content_type'''
 *         return getattr(self, '_input_format', {}).get(content_type, hug.defaults.input_format.get(content_type, None))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("hug.decorators.HugAPI.input_format", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":69
 *         return getattr(self, '_input_format', {}).get(content_type, hug.defaults.input_format.get(content_type, None))
 * 
 *     def set_input_format(self, content_type, handler):             # <<<<<<<<<<<<<<
 *         '''Sets an input format handler for this Hug API, given the specified content_type'''
 *         if getattr(self, '_input_format', None) is None:
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_6HugAPI_9set_input_format(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3hug_10decorators_6HugAPI_8set_input_format[] = "Sets an input format handler for this Hug API, given the specified content_type";
static PyMethodDef __pyx_mdef_3hug_10decorators_6HugAPI_9set_input_format = {"set_input_format", (PyCFunction)__pyx_pw_3hug_10decorators_6HugAPI_9set_input_format, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3hug_10decorators_6HugAPI_8set_input_format};
static PyObject *__pyx_pw_3hug_10decorators_6HugAPI_9set_input_format(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_content_type = 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("set_input_format (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_content_type,&__pyx_n_s_handler,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_content_type)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_input_format", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_handler)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_input_format", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_input_format") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __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_content_type = values[1];
    __pyx_v_handler = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_input_format", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("hug.decorators.HugAPI.set_input_format", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3hug_10decorators_6HugAPI_8set_input_format(__pyx_self, __pyx_v_self, __pyx_v_content_type, __pyx_v_handler);

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

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

  /* "hug/decorators.py":71
 *     def set_input_format(self, content_type, handler):
 *         '''Sets an input format handler for this Hug API, given the specified content_type'''
 *         if getattr(self, '_input_format', None) is None:             # <<<<<<<<<<<<<<
 *             self._input_format = {}
 *         self._input_format[content_type] = handler
 */
  __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_self, __pyx_n_s_input_format, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __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) {

    /* "hug/decorators.py":72
 *         '''Sets an input format handler for this Hug API, given the specified content_type'''
 *         if getattr(self, '_input_format', None) is None:
 *             self._input_format = {}             # <<<<<<<<<<<<<<
 *         self._input_format[content_type] = handler
 * 
 */
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_input_format, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "hug/decorators.py":71
 *     def set_input_format(self, content_type, handler):
 *         '''Sets an input format handler for this Hug API, given the specified content_type'''
 *         if getattr(self, '_input_format', None) is None:             # <<<<<<<<<<<<<<
 *             self._input_format = {}
 *         self._input_format[content_type] = handler
 */
  }

  /* "hug/decorators.py":73
 *         if getattr(self, '_input_format', None) is None:
 *             self._input_format = {}
 *         self._input_format[content_type] = handler             # <<<<<<<<<<<<<<
 * 
 *     def directives(self):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_input_format); 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);
  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_content_type, __pyx_v_handler) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "hug/decorators.py":69
 *         return getattr(self, '_input_format', {}).get(content_type, hug.defaults.input_format.get(content_type, None))
 * 
 *     def set_input_format(self, content_type, handler):             # <<<<<<<<<<<<<<
 *         '''Sets an input format handler for this Hug API, given the specified content_type'''
 *         if getattr(self, '_input_format', None) is None:
 */

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

/* "hug/decorators.py":75
 *         self._input_format[content_type] = handler
 * 
 *     def directives(self):             # <<<<<<<<<<<<<<
 *         '''Returns all directives applicable to this Hug API'''
 *         directive_sources = chain(hug.defaults.directives.items(), getattr(self, '_directives', {}).items())
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_6HugAPI_11directives(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_3hug_10decorators_6HugAPI_10directives[] = "Returns all directives applicable to this Hug API";
static PyMethodDef __pyx_mdef_3hug_10decorators_6HugAPI_11directives = {"directives", (PyCFunction)__pyx_pw_3hug_10decorators_6HugAPI_11directives, METH_O, __pyx_doc_3hug_10decorators_6HugAPI_10directives};
static PyObject *__pyx_pw_3hug_10decorators_6HugAPI_11directives(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("directives (wrapper)", 0);
  __pyx_r = __pyx_pf_3hug_10decorators_6HugAPI_10directives(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_3hug_10decorators_6HugAPI_10directives(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_directive_sources = 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;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("directives", 0);

  /* "hug/decorators.py":77
 *     def directives(self):
 *         '''Returns all directives applicable to this Hug API'''
 *         directive_sources = chain(hug.defaults.directives.items(), getattr(self, '_directives', {}).items())             # <<<<<<<<<<<<<<
 *         return {'hug_' + directive_name: directive for directive_name, directive in directive_sources}
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_chain); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_hug); 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);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_defaults); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_directives); 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);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_items); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = PyDict_New(); 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);
  __pyx_t_6 = __Pyx_GetAttr3(__pyx_v_self, __pyx_n_s_directives_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_items); 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);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_6) {
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_4) {
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_t_5);
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_directive_sources = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "hug/decorators.py":78
 *         '''Returns all directives applicable to this Hug API'''
 *         directive_sources = chain(hug.defaults.directives.items(), getattr(self, '_directives', {}).items())
 *         return {'hug_' + directive_name: directive for directive_name, directive in directive_sources}             # <<<<<<<<<<<<<<
 * 
 *     def directive(self, name, default=None):
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    PyObject *__pyx_7genexpr__pyx_v_directive_name = NULL;
    PyObject *__pyx_7genexpr__pyx_v_directive = NULL;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(__pyx_v_directive_sources)) || PyTuple_CheckExact(__pyx_v_directive_sources)) {
      __pyx_t_2 = __pyx_v_directive_sources; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_directive_sources); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    }
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_8(__pyx_t_2);
        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 = 78; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
        PyObject* sequence = __pyx_t_6;
        #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 = 78; __pyx_clineno = __LINE__; goto __pyx_L5_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); 
        } else {
          __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        #else
        __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_3);
        #endif
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_4 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext;
        index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_5);
        index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_3);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __pyx_t_9 = NULL;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        goto __pyx_L9_unpacking_done;
        __pyx_L8_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_9 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __pyx_L9_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_directive_name, __pyx_t_5);
      __pyx_t_5 = 0;
      __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_directive, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_6 = PyNumber_Add(__pyx_n_s_hug_2, __pyx_7genexpr__pyx_v_directive_name); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_t_6, (PyObject*)__pyx_7genexpr__pyx_v_directive))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_directive_name);
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_directive);
    goto __pyx_L10_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_directive_name);
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_directive);
    goto __pyx_L1_error;
    __pyx_L10_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "hug/decorators.py":75
 *         self._input_format[content_type] = handler
 * 
 *     def directives(self):             # <<<<<<<<<<<<<<
 *         '''Returns all directives applicable to this Hug API'''
 *         directive_sources = chain(hug.defaults.directives.items(), getattr(self, '_directives', {}).items())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("hug.decorators.HugAPI.directives", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_directive_sources);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":80
 *         return {'hug_' + directive_name: directive for directive_name, directive in directive_sources}
 * 
 *     def directive(self, name, default=None):             # <<<<<<<<<<<<<<
 *         '''Returns the loaded directive with the specified name, or default if passed name is not present'''
 *         return getattr(self, '_directives', {}).get(name,  hug.defaults.directives.get(name, default))
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_6HugAPI_13directive(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3hug_10decorators_6HugAPI_12directive[] = "Returns the loaded directive with the specified name, or default if passed name is not present";
static PyMethodDef __pyx_mdef_3hug_10decorators_6HugAPI_13directive = {"directive", (PyCFunction)__pyx_pw_3hug_10decorators_6HugAPI_13directive, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3hug_10decorators_6HugAPI_12directive};
static PyObject *__pyx_pw_3hug_10decorators_6HugAPI_13directive(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_default = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("directive (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,&__pyx_n_s_default,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("directive", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_default);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "directive") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __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);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_name = values[1];
    __pyx_v_default = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("directive", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("hug.decorators.HugAPI.directive", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3hug_10decorators_6HugAPI_12directive(__pyx_self, __pyx_v_self, __pyx_v_name, __pyx_v_default);

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

static PyObject *__pyx_pf_3hug_10decorators_6HugAPI_12directive(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default) {
  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;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("directive", 0);

  /* "hug/decorators.py":82
 *     def directive(self, name, default=None):
 *         '''Returns the loaded directive with the specified name, or default if passed name is not present'''
 *         return getattr(self, '_directives', {}).get(name,  hug.defaults.directives.get(name, default))             # <<<<<<<<<<<<<<
 * 
 *     def add_directive(self, directive):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_self, __pyx_n_s_directives_2, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_hug); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_defaults); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_directives); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __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_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_4) {
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_name);
  __Pyx_INCREF(__pyx_v_default);
  __Pyx_GIVEREF(__pyx_v_default);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_default);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_5) {
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
  }
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_name);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "hug/decorators.py":80
 *         return {'hug_' + directive_name: directive for directive_name, directive in directive_sources}
 * 
 *     def directive(self, name, default=None):             # <<<<<<<<<<<<<<
 *         '''Returns the loaded directive with the specified name, or default if passed name is not present'''
 *         return getattr(self, '_directives', {}).get(name,  hug.defaults.directives.get(name, default))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("hug.decorators.HugAPI.directive", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":84
 *         return getattr(self, '_directives', {}).get(name,  hug.defaults.directives.get(name, default))
 * 
 *     def add_directive(self, directive):             # <<<<<<<<<<<<<<
 *         self._directives = getattr(self, '_directives', {})
 *         self._directives[directive.__name__] = directive
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_6HugAPI_15add_directive(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3hug_10decorators_6HugAPI_15add_directive = {"add_directive", (PyCFunction)__pyx_pw_3hug_10decorators_6HugAPI_15add_directive, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3hug_10decorators_6HugAPI_15add_directive(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_directive = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_directive (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_directive,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_directive)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add_directive", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_directive") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __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_directive = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_directive", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("hug.decorators.HugAPI.add_directive", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3hug_10decorators_6HugAPI_14add_directive(__pyx_self, __pyx_v_self, __pyx_v_directive);

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

static PyObject *__pyx_pf_3hug_10decorators_6HugAPI_14add_directive(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_directive) {
  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("add_directive", 0);

  /* "hug/decorators.py":85
 * 
 *     def add_directive(self, directive):
 *         self._directives = getattr(self, '_directives', {})             # <<<<<<<<<<<<<<
 *         self._directives[directive.__name__] = directive
 * 
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetAttr3(__pyx_v_self, __pyx_n_s_directives_2, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __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_directives_2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "hug/decorators.py":86
 *     def add_directive(self, directive):
 *         self._directives = getattr(self, '_directives', {})
 *         self._directives[directive.__name__] = directive             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_directives_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_directive, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_t_1, __pyx_v_directive) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __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;

  /* "hug/decorators.py":84
 *         return getattr(self, '_directives', {}).get(name,  hug.defaults.directives.get(name, default))
 * 
 *     def add_directive(self, directive):             # <<<<<<<<<<<<<<
 *         self._directives = getattr(self, '_directives', {})
 *         self._directives[directive.__name__] = directive
 */

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

/* "hug/decorators.py":89
 * 
 *     @property
 *     def middleware(self):             # <<<<<<<<<<<<<<
 *         return getattr(self, '_middleware', None)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_6HugAPI_17middleware(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_3hug_10decorators_6HugAPI_17middleware = {"middleware", (PyCFunction)__pyx_pw_3hug_10decorators_6HugAPI_17middleware, METH_O, 0};
static PyObject *__pyx_pw_3hug_10decorators_6HugAPI_17middleware(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("middleware (wrapper)", 0);
  __pyx_r = __pyx_pf_3hug_10decorators_6HugAPI_16middleware(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "hug/decorators.py":90
 *     @property
 *     def middleware(self):
 *         return getattr(self, '_middleware', None)             # <<<<<<<<<<<<<<
 * 
 *     def add_middleware(self, middleware):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_self, __pyx_n_s_middleware, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "hug/decorators.py":89
 * 
 *     @property
 *     def middleware(self):             # <<<<<<<<<<<<<<
 *         return getattr(self, '_middleware', None)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("hug.decorators.HugAPI.middleware", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":92
 *         return getattr(self, '_middleware', None)
 * 
 *     def add_middleware(self, middleware):             # <<<<<<<<<<<<<<
 *         '''Adds a middleware object used to process all incoming requests against the API'''
 *         if self.middleware is None:
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_6HugAPI_19add_middleware(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3hug_10decorators_6HugAPI_18add_middleware[] = "Adds a middleware object used to process all incoming requests against the API";
static PyMethodDef __pyx_mdef_3hug_10decorators_6HugAPI_19add_middleware = {"add_middleware", (PyCFunction)__pyx_pw_3hug_10decorators_6HugAPI_19add_middleware, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3hug_10decorators_6HugAPI_18add_middleware};
static PyObject *__pyx_pw_3hug_10decorators_6HugAPI_19add_middleware(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_middleware = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_middleware (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_middleware_2,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_middleware_2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add_middleware", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_middleware") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __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_middleware = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_middleware", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("hug.decorators.HugAPI.add_middleware", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3hug_10decorators_6HugAPI_18add_middleware(__pyx_self, __pyx_v_self, __pyx_v_middleware);

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

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

  /* "hug/decorators.py":94
 *     def add_middleware(self, middleware):
 *         '''Adds a middleware object used to process all incoming requests against the API'''
 *         if self.middleware is None:             # <<<<<<<<<<<<<<
 *             self._middleware = []
 *         self.middleware.append(middleware)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_middleware_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __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) {

    /* "hug/decorators.py":95
 *         '''Adds a middleware object used to process all incoming requests against the API'''
 *         if self.middleware is None:
 *             self._middleware = []             # <<<<<<<<<<<<<<
 *         self.middleware.append(middleware)
 * 
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_middleware, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "hug/decorators.py":94
 *     def add_middleware(self, middleware):
 *         '''Adds a middleware object used to process all incoming requests against the API'''
 *         if self.middleware is None:             # <<<<<<<<<<<<<<
 *             self._middleware = []
 *         self.middleware.append(middleware)
 */
  }

  /* "hug/decorators.py":96
 *         if self.middleware is None:
 *             self._middleware = []
 *         self.middleware.append(middleware)             # <<<<<<<<<<<<<<
 * 
 *     def extend(self, module, route=""):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_middleware_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_v_middleware); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "hug/decorators.py":92
 *         return getattr(self, '_middleware', None)
 * 
 *     def add_middleware(self, middleware):             # <<<<<<<<<<<<<<
 *         '''Adds a middleware object used to process all incoming requests against the API'''
 *         if self.middleware is None:
 */

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

/* "hug/decorators.py":98
 *         self.middleware.append(middleware)
 * 
 *     def extend(self, module, route=""):             # <<<<<<<<<<<<<<
 *         '''Adds handlers from a different Hug API module to this one - to create a single API'''
 *         for item_route, handler in module.__hug__.routes.items():
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_6HugAPI_21extend(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3hug_10decorators_6HugAPI_20extend[] = "Adds handlers from a different Hug API module to this one - to create a single API";
static PyMethodDef __pyx_mdef_3hug_10decorators_6HugAPI_21extend = {"extend", (PyCFunction)__pyx_pw_3hug_10decorators_6HugAPI_21extend, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3hug_10decorators_6HugAPI_20extend};
static PyObject *__pyx_pw_3hug_10decorators_6HugAPI_21extend(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_module = 0;
  PyObject *__pyx_v_route = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("extend (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_module,&__pyx_n_s_route,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject*)__pyx_kp_s_));
    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_module)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("extend", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_route);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extend") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __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);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_module = values[1];
    __pyx_v_route = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("extend", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("hug.decorators.HugAPI.extend", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3hug_10decorators_6HugAPI_20extend(__pyx_self, __pyx_v_self, __pyx_v_module, __pyx_v_route);

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

static PyObject *__pyx_pf_3hug_10decorators_6HugAPI_20extend(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_module, PyObject *__pyx_v_route) {
  PyObject *__pyx_v_item_route = NULL;
  PyObject *__pyx_v_handler = NULL;
  PyObject *__pyx_v_directive = NULL;
  PyObject *__pyx_v_middleware = NULL;
  PyObject *__pyx_v_input_format = NULL;
  PyObject *__pyx_v_input_format_handler = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("extend", 0);

  /* "hug/decorators.py":100
 *     def extend(self, module, route=""):
 *         '''Adds handlers from a different Hug API module to this one - to create a single API'''
 *         for item_route, handler in module.__hug__.routes.items():             # <<<<<<<<<<<<<<
 *             self.routes[route + item_route] = handler
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_module, __pyx_n_s_hug_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_routes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_items); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    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 = 100; __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_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_item_route, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_handler, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "hug/decorators.py":101
 *         '''Adds handlers from a different Hug API module to this one - to create a single API'''
 *         for item_route, handler in module.__hug__.routes.items():
 *             self.routes[route + item_route] = handler             # <<<<<<<<<<<<<<
 * 
 *         for directive in getattr(module.__hug__, '_directives', {}).values():
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_routes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyNumber_Add(__pyx_v_route, __pyx_v_item_route); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_t_6, __pyx_v_handler) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "hug/decorators.py":100
 *     def extend(self, module, route=""):
 *         '''Adds handlers from a different Hug API module to this one - to create a single API'''
 *         for item_route, handler in module.__hug__.routes.items():             # <<<<<<<<<<<<<<
 *             self.routes[route + item_route] = handler
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "hug/decorators.py":103
 *             self.routes[route + item_route] = handler
 * 
 *         for directive in getattr(module.__hug__, '_directives', {}).values():             # <<<<<<<<<<<<<<
 *             self.add_directive(directive)
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_module, __pyx_n_s_hug_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetAttr3(__pyx_t_6, __pyx_n_s_directives_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_directive, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "hug/decorators.py":104
 * 
 *         for directive in getattr(module.__hug__, '_directives', {}).values():
 *             self.add_directive(directive)             # <<<<<<<<<<<<<<
 * 
 *         for middleware in (module.__hug__.middleware or ()):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_add_directive); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_directive); 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);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_directive);
      __Pyx_GIVEREF(__pyx_v_directive);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_directive);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); 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);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "hug/decorators.py":103
 *             self.routes[route + item_route] = handler
 * 
 *         for directive in getattr(module.__hug__, '_directives', {}).values():             # <<<<<<<<<<<<<<
 *             self.add_directive(directive)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "hug/decorators.py":106
 *             self.add_directive(directive)
 * 
 *         for middleware in (module.__hug__.middleware or ()):             # <<<<<<<<<<<<<<
 *             self.add_middleware(middleware)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_module, __pyx_n_s_hug_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_middleware_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!__pyx_t_9) {
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L11_bool_binop_done;
  }
  __Pyx_INCREF(__pyx_empty_tuple);
  __pyx_t_1 = __pyx_empty_tuple;
  __pyx_L11_bool_binop_done:;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_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 = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(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 = 106; __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 = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        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 = 106; __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 = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        #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 = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_middleware, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "hug/decorators.py":107
 * 
 *         for middleware in (module.__hug__.middleware or ()):
 *             self.add_middleware(middleware)             # <<<<<<<<<<<<<<
 * 
 *         for input_format, input_format_handler in getattr(module.__hug__, '_input_format', {}).items():
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_add_middleware); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_middleware); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_INCREF(__pyx_v_middleware);
      __Pyx_GIVEREF(__pyx_v_middleware);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_middleware);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "hug/decorators.py":106
 *             self.add_directive(directive)
 * 
 *         for middleware in (module.__hug__.middleware or ()):             # <<<<<<<<<<<<<<
 *             self.add_middleware(middleware)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "hug/decorators.py":109
 *             self.add_middleware(middleware)
 * 
 *         for input_format, input_format_handler in getattr(module.__hug__, '_input_format', {}).items():             # <<<<<<<<<<<<<<
 *             if not input_format in getattr(self, '_input_format', {}):
 *                 self.set_input_format(input_format, input_format_handler)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_module, __pyx_n_s_hug_3); 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_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_GetAttr3(__pyx_t_1, __pyx_n_s_input_format, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_items); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_6) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __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 = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_1);
      #else
      __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = PySequence_ITEM(sequence, 1); 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);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L15_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L15_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L16_unpacking_done;
      __pyx_L15_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L16_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_input_format, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_input_format_handler, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "hug/decorators.py":110
 * 
 *         for input_format, input_format_handler in getattr(module.__hug__, '_input_format', {}).items():
 *             if not input_format in getattr(self, '_input_format', {}):             # <<<<<<<<<<<<<<
 *                 self.set_input_format(input_format, input_format_handler)
 * 
 */
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_self, __pyx_n_s_input_format, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_v_input_format, __pyx_t_1, Py_NE)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = (__pyx_t_9 != 0);
    if (__pyx_t_10) {

      /* "hug/decorators.py":111
 *         for input_format, input_format_handler in getattr(module.__hug__, '_input_format', {}).items():
 *             if not input_format in getattr(self, '_input_format', {}):
 *                 self.set_input_format(input_format, input_format_handler)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_set_input_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = NULL;
      __pyx_t_11 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_11 = 1;
        }
      }
      __pyx_t_7 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(__pyx_v_input_format);
      __Pyx_GIVEREF(__pyx_v_input_format);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_11, __pyx_v_input_format);
      __Pyx_INCREF(__pyx_v_input_format_handler);
      __Pyx_GIVEREF(__pyx_v_input_format_handler);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_11, __pyx_v_input_format_handler);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __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_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "hug/decorators.py":110
 * 
 *         for input_format, input_format_handler in getattr(module.__hug__, '_input_format', {}).items():
 *             if not input_format in getattr(self, '_input_format', {}):             # <<<<<<<<<<<<<<
 *                 self.set_input_format(input_format, input_format_handler)
 * 
 */
    }

    /* "hug/decorators.py":109
 *             self.add_middleware(middleware)
 * 
 *         for input_format, input_format_handler in getattr(module.__hug__, '_input_format', {}).items():             # <<<<<<<<<<<<<<
 *             if not input_format in getattr(self, '_input_format', {}):
 *                 self.set_input_format(input_format, input_format_handler)
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "hug/decorators.py":98
 *         self.middleware.append(middleware)
 * 
 *     def extend(self, module, route=""):             # <<<<<<<<<<<<<<
 *         '''Adds handlers from a different Hug API module to this one - to create a single API'''
 *         for item_route, handler in module.__hug__.routes.items():
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("hug.decorators.HugAPI.extend", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item_route);
  __Pyx_XDECREF(__pyx_v_handler);
  __Pyx_XDECREF(__pyx_v_directive);
  __Pyx_XDECREF(__pyx_v_middleware);
  __Pyx_XDECREF(__pyx_v_input_format);
  __Pyx_XDECREF(__pyx_v_input_format_handler);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":114
 * 
 *     @property
 *     def not_found_handlers(self):             # <<<<<<<<<<<<<<
 *         return getattr(self, '_not_found_handlers', {})
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_6HugAPI_23not_found_handlers(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_3hug_10decorators_6HugAPI_23not_found_handlers = {"not_found_handlers", (PyCFunction)__pyx_pw_3hug_10decorators_6HugAPI_23not_found_handlers, METH_O, 0};
static PyObject *__pyx_pw_3hug_10decorators_6HugAPI_23not_found_handlers(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("not_found_handlers (wrapper)", 0);
  __pyx_r = __pyx_pf_3hug_10decorators_6HugAPI_22not_found_handlers(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "hug/decorators.py":115
 *     @property
 *     def not_found_handlers(self):
 *         return getattr(self, '_not_found_handlers', {})             # <<<<<<<<<<<<<<
 * 
 *     def set_not_found_handler(self, handler, version=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDict_New(); 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_t_2 = __Pyx_GetAttr3(__pyx_v_self, __pyx_n_s_not_found_handlers, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __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;

  /* "hug/decorators.py":114
 * 
 *     @property
 *     def not_found_handlers(self):             # <<<<<<<<<<<<<<
 *         return getattr(self, '_not_found_handlers', {})
 * 
 */

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

/* "hug/decorators.py":117
 *         return getattr(self, '_not_found_handlers', {})
 * 
 *     def set_not_found_handler(self, handler, version=None):             # <<<<<<<<<<<<<<
 *         '''Sets the not_found handler for the specified version of the api'''
 *         if not self.not_found_handlers:
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_6HugAPI_25set_not_found_handler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3hug_10decorators_6HugAPI_24set_not_found_handler[] = "Sets the not_found handler for the specified version of the api";
static PyMethodDef __pyx_mdef_3hug_10decorators_6HugAPI_25set_not_found_handler = {"set_not_found_handler", (PyCFunction)__pyx_pw_3hug_10decorators_6HugAPI_25set_not_found_handler, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3hug_10decorators_6HugAPI_24set_not_found_handler};
static PyObject *__pyx_pw_3hug_10decorators_6HugAPI_25set_not_found_handler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_handler = 0;
  PyObject *__pyx_v_version = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_not_found_handler (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_handler,&__pyx_n_s_version,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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("set_not_found_handler", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_version);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_not_found_handler") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __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);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_handler = values[1];
    __pyx_v_version = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_not_found_handler", 0, 2, 3, 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("hug.decorators.HugAPI.set_not_found_handler", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3hug_10decorators_6HugAPI_24set_not_found_handler(__pyx_self, __pyx_v_self, __pyx_v_handler, __pyx_v_version);

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

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

  /* "hug/decorators.py":119
 *     def set_not_found_handler(self, handler, version=None):
 *         '''Sets the not_found handler for the specified version of the api'''
 *         if not self.not_found_handlers:             # <<<<<<<<<<<<<<
 *             self._not_found_handlers = {}
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_not_found_handlers_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __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 = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!__pyx_t_2) != 0);
  if (__pyx_t_3) {

    /* "hug/decorators.py":120
 *         '''Sets the not_found handler for the specified version of the api'''
 *         if not self.not_found_handlers:
 *             self._not_found_handlers = {}             # <<<<<<<<<<<<<<
 * 
 *         self.not_found_handlers[version] = handler
 */
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_not_found_handlers, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "hug/decorators.py":119
 *     def set_not_found_handler(self, handler, version=None):
 *         '''Sets the not_found handler for the specified version of the api'''
 *         if not self.not_found_handlers:             # <<<<<<<<<<<<<<
 *             self._not_found_handlers = {}
 * 
 */
  }

  /* "hug/decorators.py":122
 *             self._not_found_handlers = {}
 * 
 *         self.not_found_handlers[version] = handler             # <<<<<<<<<<<<<<
 * 
 *     def serve(self, port=8000, no_documentation=False):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_not_found_handlers_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_version, __pyx_v_handler) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "hug/decorators.py":117
 *         return getattr(self, '_not_found_handlers', {})
 * 
 *     def set_not_found_handler(self, handler, version=None):             # <<<<<<<<<<<<<<
 *         '''Sets the not_found handler for the specified version of the api'''
 *         if not self.not_found_handlers:
 */

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

/* "hug/decorators.py":124
 *         self.not_found_handlers[version] = handler
 * 
 *     def serve(self, port=8000, no_documentation=False):             # <<<<<<<<<<<<<<
 *         '''Runs the basic hug development server against this API'''
 *         if no_documentation:
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_6HugAPI_27serve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3hug_10decorators_6HugAPI_26serve[] = "Runs the basic hug development server against this API";
static PyMethodDef __pyx_mdef_3hug_10decorators_6HugAPI_27serve = {"serve", (PyCFunction)__pyx_pw_3hug_10decorators_6HugAPI_27serve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3hug_10decorators_6HugAPI_26serve};
static PyObject *__pyx_pw_3hug_10decorators_6HugAPI_27serve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_port = 0;
  PyObject *__pyx_v_no_documentation = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("serve (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_port,&__pyx_n_s_no_documentation,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)((PyObject *)__pyx_int_8000));
    values[2] = ((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  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_port);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_no_documentation);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "serve") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __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_port = values[1];
    __pyx_v_no_documentation = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("serve", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("hug.decorators.HugAPI.serve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3hug_10decorators_6HugAPI_26serve(__pyx_self, __pyx_v_self, __pyx_v_port, __pyx_v_no_documentation);

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

static PyObject *__pyx_pf_3hug_10decorators_6HugAPI_26serve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_port, PyObject *__pyx_v_no_documentation) {
  PyObject *__pyx_v_api = NULL;
  PyObject *__pyx_v_httpd = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("serve", 0);

  /* "hug/decorators.py":126
 *     def serve(self, port=8000, no_documentation=False):
 *         '''Runs the basic hug development server against this API'''
 *         if no_documentation:             # <<<<<<<<<<<<<<
 *             api = server(self.module, sink=None)
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_no_documentation); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "hug/decorators.py":127
 *         '''Runs the basic hug development server against this API'''
 *         if no_documentation:
 *             api = server(self.module, sink=None)             # <<<<<<<<<<<<<<
 *         else:
 *             api = server(self.module)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_server); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_module); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __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 = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_sink, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __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_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_api = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "hug/decorators.py":126
 *     def serve(self, port=8000, no_documentation=False):
 *         '''Runs the basic hug development server against this API'''
 *         if no_documentation:             # <<<<<<<<<<<<<<
 *             api = server(self.module, sink=None)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "hug/decorators.py":129
 *             api = server(self.module, sink=None)
 *         else:
 *             api = server(self.module)             # <<<<<<<<<<<<<<
 * 
 *         print(INTRO)
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_server); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_module); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_2) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __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_3); __pyx_t_3 = 0;
    __pyx_v_api = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __pyx_L3:;

  /* "hug/decorators.py":131
 *             api = server(self.module)
 * 
 *         print(INTRO)             # <<<<<<<<<<<<<<
 *         httpd = make_server('', port, api)
 *         print("Serving on port {0}...".format(port))
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_INTRO); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_PrintOne(0, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "hug/decorators.py":132
 * 
 *         print(INTRO)
 *         httpd = make_server('', port, api)             # <<<<<<<<<<<<<<
 *         print("Serving on port {0}...".format(port))
 *         httpd.serve_forever()
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_make_server); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_7 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_6) {
    __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
  }
  __Pyx_INCREF(__pyx_kp_s_);
  __Pyx_GIVEREF(__pyx_kp_s_);
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_7, __pyx_kp_s_);
  __Pyx_INCREF(__pyx_v_port);
  __Pyx_GIVEREF(__pyx_v_port);
  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, __pyx_v_port);
  __Pyx_INCREF(__pyx_v_api);
  __Pyx_GIVEREF(__pyx_v_api);
  PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_7, __pyx_v_api);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __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_3); __pyx_t_3 = 0;
  __pyx_v_httpd = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "hug/decorators.py":133
 *         print(INTRO)
 *         httpd = make_server('', port, api)
 *         print("Serving on port {0}...".format(port))             # <<<<<<<<<<<<<<
 *         httpd.serve_forever()
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Serving_on_port_0, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_port); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_v_port);
    __Pyx_GIVEREF(__pyx_v_port);
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_port);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __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_3); __pyx_t_3 = 0;
  if (__Pyx_PrintOne(0, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "hug/decorators.py":134
 *         httpd = make_server('', port, api)
 *         print("Serving on port {0}...".format(port))
 *         httpd.serve_forever()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_httpd, __pyx_n_s_serve_forever); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_6) {
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __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_5); __pyx_t_5 = 0;

  /* "hug/decorators.py":124
 *         self.not_found_handlers[version] = handler
 * 
 *     def serve(self, port=8000, no_documentation=False):             # <<<<<<<<<<<<<<
 *         '''Runs the basic hug development server against this API'''
 *         if no_documentation:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("hug.decorators.HugAPI.serve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_api);
  __Pyx_XDECREF(__pyx_v_httpd);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":137
 * 
 * 
 * def default_output_format(content_type='application/json', apply_globally=False):             # <<<<<<<<<<<<<<
 *     '''A decorator that allows you to override the default output format for an API'''
 *     def decorator(formatter):
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_1default_output_format(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3hug_10decorators_default_output_format[] = "A decorator that allows you to override the default output format for an API";
static PyMethodDef __pyx_mdef_3hug_10decorators_1default_output_format = {"default_output_format", (PyCFunction)__pyx_pw_3hug_10decorators_1default_output_format, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3hug_10decorators_default_output_format};
static PyObject *__pyx_pw_3hug_10decorators_1default_output_format(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_content_type = 0;
  PyObject *__pyx_v_apply_globally = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("default_output_format (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_content_type,&__pyx_n_s_apply_globally,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)((PyObject*)__pyx_kp_s_application_json));
    values[1] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_content_type);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_apply_globally);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "default_output_format") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_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;
      }
    }
    __pyx_v_content_type = values[0];
    __pyx_v_apply_globally = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("default_output_format", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("hug.decorators.default_output_format", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3hug_10decorators_default_output_format(__pyx_self, __pyx_v_content_type, __pyx_v_apply_globally);

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

/* "hug/decorators.py":139
 * def default_output_format(content_type='application/json', apply_globally=False):
 *     '''A decorator that allows you to override the default output format for an API'''
 *     def decorator(formatter):             # <<<<<<<<<<<<<<
 *         module = _api_module(formatter.__module__)
 *         formatter = hug.output_format.content_type(content_type)(formatter)
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_21default_output_format_1decorator(PyObject *__pyx_self, PyObject *__pyx_v_formatter); /*proto*/
static PyMethodDef __pyx_mdef_3hug_10decorators_21default_output_format_1decorator = {"decorator", (PyCFunction)__pyx_pw_3hug_10decorators_21default_output_format_1decorator, METH_O, 0};
static PyObject *__pyx_pw_3hug_10decorators_21default_output_format_1decorator(PyObject *__pyx_self, PyObject *__pyx_v_formatter) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decorator (wrapper)", 0);
  __pyx_r = __pyx_pf_3hug_10decorators_21default_output_format_decorator(__pyx_self, ((PyObject *)__pyx_v_formatter));

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

static PyObject *__pyx_pf_3hug_10decorators_21default_output_format_decorator(PyObject *__pyx_self, PyObject *__pyx_v_formatter) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct__default_output_format *__pyx_cur_scope;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct__default_output_format *__pyx_outer_scope;
  PyObject *__pyx_v_module = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decorator", 0);
  __pyx_outer_scope = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct__default_output_format *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_INCREF(__pyx_v_formatter);

  /* "hug/decorators.py":140
 *     '''A decorator that allows you to override the default output format for an API'''
 *     def decorator(formatter):
 *         module = _api_module(formatter.__module__)             # <<<<<<<<<<<<<<
 *         formatter = hug.output_format.content_type(content_type)(formatter)
 *         if apply_globally:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_api_module); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_formatter, __pyx_n_s_module_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __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_2); __pyx_t_2 = 0;
  __pyx_v_module = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "hug/decorators.py":141
 *     def decorator(formatter):
 *         module = _api_module(formatter.__module__)
 *         formatter = hug.output_format.content_type(content_type)(formatter)             # <<<<<<<<<<<<<<
 *         if apply_globally:
 *             hug.defaults.output_format = formatter
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_hug); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_output_format_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_content_type); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_cur_scope->__pyx_v_content_type)) { __Pyx_RaiseClosureNameError("content_type"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_cur_scope->__pyx_v_content_type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_content_type);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_content_type);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_cur_scope->__pyx_v_content_type);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __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_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_formatter); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_v_formatter);
    __Pyx_GIVEREF(__pyx_v_formatter);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_formatter);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __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;
  __Pyx_DECREF_SET(__pyx_v_formatter, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "hug/decorators.py":142
 *         module = _api_module(formatter.__module__)
 *         formatter = hug.output_format.content_type(content_type)(formatter)
 *         if apply_globally:             # <<<<<<<<<<<<<<
 *             hug.defaults.output_format = formatter
 *         else:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_apply_globally)) { __Pyx_RaiseClosureNameError("apply_globally"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_apply_globally); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_6) {

    /* "hug/decorators.py":143
 *         formatter = hug.output_format.content_type(content_type)(formatter)
 *         if apply_globally:
 *             hug.defaults.output_format = formatter             # <<<<<<<<<<<<<<
 *         else:
 *             module.__hug__.output_format = formatter
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_hug); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_defaults); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __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_t_2, __pyx_n_s_output_format_2, __pyx_v_formatter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "hug/decorators.py":142
 *         module = _api_module(formatter.__module__)
 *         formatter = hug.output_format.content_type(content_type)(formatter)
 *         if apply_globally:             # <<<<<<<<<<<<<<
 *             hug.defaults.output_format = formatter
 *         else:
 */
    goto __pyx_L3;
  }

  /* "hug/decorators.py":145
 *             hug.defaults.output_format = formatter
 *         else:
 *             module.__hug__.output_format = formatter             # <<<<<<<<<<<<<<
 *         return formatter
 *     return decorator
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_module, __pyx_n_s_hug_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_2, __pyx_n_s_output_format_2, __pyx_v_formatter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "hug/decorators.py":146
 *         else:
 *             module.__hug__.output_format = formatter
 *         return formatter             # <<<<<<<<<<<<<<
 *     return decorator
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_formatter);
  __pyx_r = __pyx_v_formatter;
  goto __pyx_L0;

  /* "hug/decorators.py":139
 * def default_output_format(content_type='application/json', apply_globally=False):
 *     '''A decorator that allows you to override the default output format for an API'''
 *     def decorator(formatter):             # <<<<<<<<<<<<<<
 *         module = _api_module(formatter.__module__)
 *         formatter = hug.output_format.content_type(content_type)(formatter)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("hug.decorators.default_output_format.decorator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_module);
  __Pyx_XDECREF(__pyx_v_formatter);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":137
 * 
 * 
 * def default_output_format(content_type='application/json', apply_globally=False):             # <<<<<<<<<<<<<<
 *     '''A decorator that allows you to override the default output format for an API'''
 *     def decorator(formatter):
 */

static PyObject *__pyx_pf_3hug_10decorators_default_output_format(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_content_type, PyObject *__pyx_v_apply_globally) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct__default_output_format *__pyx_cur_scope;
  PyObject *__pyx_v_decorator = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("default_output_format", 0);
  __pyx_cur_scope = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct__default_output_format *)__pyx_tp_new_3hug_10decorators___pyx_scope_struct__default_output_format(__pyx_ptype_3hug_10decorators___pyx_scope_struct__default_output_format, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_content_type = __pyx_v_content_type;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_content_type);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_content_type);
  __pyx_cur_scope->__pyx_v_apply_globally = __pyx_v_apply_globally;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_apply_globally);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_apply_globally);

  /* "hug/decorators.py":139
 * def default_output_format(content_type='application/json', apply_globally=False):
 *     '''A decorator that allows you to override the default output format for an API'''
 *     def decorator(formatter):             # <<<<<<<<<<<<<<
 *         module = _api_module(formatter.__module__)
 *         formatter = hug.output_format.content_type(content_type)(formatter)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_21default_output_format_1decorator, 0, __pyx_n_s_default_output_format_locals_dec, ((PyObject*)__pyx_cur_scope), __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__3)); 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_v_decorator = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "hug/decorators.py":147
 *             module.__hug__.output_format = formatter
 *         return formatter
 *     return decorator             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_decorator);
  __pyx_r = __pyx_v_decorator;
  goto __pyx_L0;

  /* "hug/decorators.py":137
 * 
 * 
 * def default_output_format(content_type='application/json', apply_globally=False):             # <<<<<<<<<<<<<<
 *     '''A decorator that allows you to override the default output format for an API'''
 *     def decorator(formatter):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("hug.decorators.default_output_format", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_decorator);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":150
 * 
 * 
 * def default_input_format(content_type='application/json', apply_globally=False):             # <<<<<<<<<<<<<<
 *     '''A decorator that allows you to override the default output format for an API'''
 *     def decorator(formatter):
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_3default_input_format(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3hug_10decorators_2default_input_format[] = "A decorator that allows you to override the default output format for an API";
static PyMethodDef __pyx_mdef_3hug_10decorators_3default_input_format = {"default_input_format", (PyCFunction)__pyx_pw_3hug_10decorators_3default_input_format, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3hug_10decorators_2default_input_format};
static PyObject *__pyx_pw_3hug_10decorators_3default_input_format(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_content_type = 0;
  PyObject *__pyx_v_apply_globally = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("default_input_format (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_content_type,&__pyx_n_s_apply_globally,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)((PyObject*)__pyx_kp_s_application_json));
    values[1] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_content_type);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_apply_globally);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "default_input_format") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_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;
      }
    }
    __pyx_v_content_type = values[0];
    __pyx_v_apply_globally = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("default_input_format", 0, 0, 2, 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("hug.decorators.default_input_format", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3hug_10decorators_2default_input_format(__pyx_self, __pyx_v_content_type, __pyx_v_apply_globally);

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

/* "hug/decorators.py":152
 * def default_input_format(content_type='application/json', apply_globally=False):
 *     '''A decorator that allows you to override the default output format for an API'''
 *     def decorator(formatter):             # <<<<<<<<<<<<<<
 *         module = _api_module(formatter.__module__)
 *         formatter = hug.output_format.content_type(content_type)(formatter)
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_20default_input_format_1decorator(PyObject *__pyx_self, PyObject *__pyx_v_formatter); /*proto*/
static PyMethodDef __pyx_mdef_3hug_10decorators_20default_input_format_1decorator = {"decorator", (PyCFunction)__pyx_pw_3hug_10decorators_20default_input_format_1decorator, METH_O, 0};
static PyObject *__pyx_pw_3hug_10decorators_20default_input_format_1decorator(PyObject *__pyx_self, PyObject *__pyx_v_formatter) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decorator (wrapper)", 0);
  __pyx_r = __pyx_pf_3hug_10decorators_20default_input_format_decorator(__pyx_self, ((PyObject *)__pyx_v_formatter));

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

static PyObject *__pyx_pf_3hug_10decorators_20default_input_format_decorator(PyObject *__pyx_self, PyObject *__pyx_v_formatter) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_1_default_input_format *__pyx_cur_scope;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_1_default_input_format *__pyx_outer_scope;
  PyObject *__pyx_v_module = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decorator", 0);
  __pyx_outer_scope = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_1_default_input_format *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_INCREF(__pyx_v_formatter);

  /* "hug/decorators.py":153
 *     '''A decorator that allows you to override the default output format for an API'''
 *     def decorator(formatter):
 *         module = _api_module(formatter.__module__)             # <<<<<<<<<<<<<<
 *         formatter = hug.output_format.content_type(content_type)(formatter)
 *         if apply_globally:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_api_module); 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);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_formatter, __pyx_n_s_module_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __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_2); __pyx_t_2 = 0;
  __pyx_v_module = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "hug/decorators.py":154
 *     def decorator(formatter):
 *         module = _api_module(formatter.__module__)
 *         formatter = hug.output_format.content_type(content_type)(formatter)             # <<<<<<<<<<<<<<
 *         if apply_globally:
 *             hug.defaults.input_format[content_type] = formatter
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_hug); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_output_format_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_content_type); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_cur_scope->__pyx_v_content_type)) { __Pyx_RaiseClosureNameError("content_type"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_cur_scope->__pyx_v_content_type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_content_type);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_content_type);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_cur_scope->__pyx_v_content_type);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __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_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_formatter); 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);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_v_formatter);
    __Pyx_GIVEREF(__pyx_v_formatter);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_formatter);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, 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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_formatter, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "hug/decorators.py":155
 *         module = _api_module(formatter.__module__)
 *         formatter = hug.output_format.content_type(content_type)(formatter)
 *         if apply_globally:             # <<<<<<<<<<<<<<
 *             hug.defaults.input_format[content_type] = formatter
 *         else:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_apply_globally)) { __Pyx_RaiseClosureNameError("apply_globally"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_apply_globally); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_6) {

    /* "hug/decorators.py":156
 *         formatter = hug.output_format.content_type(content_type)(formatter)
 *         if apply_globally:
 *             hug.defaults.input_format[content_type] = formatter             # <<<<<<<<<<<<<<
 *         else:
 *             module.__hug__.set_input_format(content_type, formatter)
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_hug); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_defaults); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __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_t_2, __pyx_n_s_input_format_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_v_content_type)) { __Pyx_RaiseClosureNameError("content_type"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_cur_scope->__pyx_v_content_type, __pyx_v_formatter) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "hug/decorators.py":155
 *         module = _api_module(formatter.__module__)
 *         formatter = hug.output_format.content_type(content_type)(formatter)
 *         if apply_globally:             # <<<<<<<<<<<<<<
 *             hug.defaults.input_format[content_type] = formatter
 *         else:
 */
    goto __pyx_L3;
  }

  /* "hug/decorators.py":158
 *             hug.defaults.input_format[content_type] = formatter
 *         else:
 *             module.__hug__.set_input_format(content_type, formatter)             # <<<<<<<<<<<<<<
 *         return formatter
 *     return decorator
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_module, __pyx_n_s_hug_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_set_input_format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_v_content_type)) { __Pyx_RaiseClosureNameError("content_type"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_2 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    __pyx_t_5 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_content_type);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_content_type);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, __pyx_cur_scope->__pyx_v_content_type);
    __Pyx_INCREF(__pyx_v_formatter);
    __Pyx_GIVEREF(__pyx_v_formatter);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_formatter);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __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_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "hug/decorators.py":159
 *         else:
 *             module.__hug__.set_input_format(content_type, formatter)
 *         return formatter             # <<<<<<<<<<<<<<
 *     return decorator
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_formatter);
  __pyx_r = __pyx_v_formatter;
  goto __pyx_L0;

  /* "hug/decorators.py":152
 * def default_input_format(content_type='application/json', apply_globally=False):
 *     '''A decorator that allows you to override the default output format for an API'''
 *     def decorator(formatter):             # <<<<<<<<<<<<<<
 *         module = _api_module(formatter.__module__)
 *         formatter = hug.output_format.content_type(content_type)(formatter)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("hug.decorators.default_input_format.decorator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_module);
  __Pyx_XDECREF(__pyx_v_formatter);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":150
 * 
 * 
 * def default_input_format(content_type='application/json', apply_globally=False):             # <<<<<<<<<<<<<<
 *     '''A decorator that allows you to override the default output format for an API'''
 *     def decorator(formatter):
 */

static PyObject *__pyx_pf_3hug_10decorators_2default_input_format(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_content_type, PyObject *__pyx_v_apply_globally) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_1_default_input_format *__pyx_cur_scope;
  PyObject *__pyx_v_decorator = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("default_input_format", 0);
  __pyx_cur_scope = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_1_default_input_format *)__pyx_tp_new_3hug_10decorators___pyx_scope_struct_1_default_input_format(__pyx_ptype_3hug_10decorators___pyx_scope_struct_1_default_input_format, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_content_type = __pyx_v_content_type;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_content_type);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_content_type);
  __pyx_cur_scope->__pyx_v_apply_globally = __pyx_v_apply_globally;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_apply_globally);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_apply_globally);

  /* "hug/decorators.py":152
 * def default_input_format(content_type='application/json', apply_globally=False):
 *     '''A decorator that allows you to override the default output format for an API'''
 *     def decorator(formatter):             # <<<<<<<<<<<<<<
 *         module = _api_module(formatter.__module__)
 *         formatter = hug.output_format.content_type(content_type)(formatter)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_20default_input_format_1decorator, 0, __pyx_n_s_default_input_format_locals_deco, ((PyObject*)__pyx_cur_scope), __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_decorator = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "hug/decorators.py":160
 *             module.__hug__.set_input_format(content_type, formatter)
 *         return formatter
 *     return decorator             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_decorator);
  __pyx_r = __pyx_v_decorator;
  goto __pyx_L0;

  /* "hug/decorators.py":150
 * 
 * 
 * def default_input_format(content_type='application/json', apply_globally=False):             # <<<<<<<<<<<<<<
 *     '''A decorator that allows you to override the default output format for an API'''
 *     def decorator(formatter):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("hug.decorators.default_input_format", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_decorator);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":163
 * 
 * 
 * def directive(apply_globally=True):             # <<<<<<<<<<<<<<
 *     '''A decorator that registers a single hug directive'''
 *     def decorator(directive_method):
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_5directive(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3hug_10decorators_4directive[] = "A decorator that registers a single hug directive";
static PyMethodDef __pyx_mdef_3hug_10decorators_5directive = {"directive", (PyCFunction)__pyx_pw_3hug_10decorators_5directive, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3hug_10decorators_4directive};
static PyObject *__pyx_pw_3hug_10decorators_5directive(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_apply_globally = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("directive (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_apply_globally,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)((PyObject *)Py_True));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_apply_globally);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "directive") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_apply_globally = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("directive", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("hug.decorators.directive", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3hug_10decorators_4directive(__pyx_self, __pyx_v_apply_globally);

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

/* "hug/decorators.py":165
 * def directive(apply_globally=True):
 *     '''A decorator that registers a single hug directive'''
 *     def decorator(directive_method):             # <<<<<<<<<<<<<<
 *         if apply_globally:
 *             hug.defaults.directives[underscore(directive_method.__name__)] = directive_method
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_9directive_1decorator(PyObject *__pyx_self, PyObject *__pyx_v_directive_method); /*proto*/
static PyMethodDef __pyx_mdef_3hug_10decorators_9directive_1decorator = {"decorator", (PyCFunction)__pyx_pw_3hug_10decorators_9directive_1decorator, METH_O, 0};
static PyObject *__pyx_pw_3hug_10decorators_9directive_1decorator(PyObject *__pyx_self, PyObject *__pyx_v_directive_method) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decorator (wrapper)", 0);
  __pyx_r = __pyx_pf_3hug_10decorators_9directive_decorator(__pyx_self, ((PyObject *)__pyx_v_directive_method));

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

static PyObject *__pyx_pf_3hug_10decorators_9directive_decorator(PyObject *__pyx_self, PyObject *__pyx_v_directive_method) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_2_directive *__pyx_cur_scope;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_2_directive *__pyx_outer_scope;
  PyObject *__pyx_v_module = 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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decorator", 0);
  __pyx_outer_scope = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_2_directive *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "hug/decorators.py":166
 *     '''A decorator that registers a single hug directive'''
 *     def decorator(directive_method):
 *         if apply_globally:             # <<<<<<<<<<<<<<
 *             hug.defaults.directives[underscore(directive_method.__name__)] = directive_method
 *         else:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_apply_globally)) { __Pyx_RaiseClosureNameError("apply_globally"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_apply_globally); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "hug/decorators.py":167
 *     def decorator(directive_method):
 *         if apply_globally:
 *             hug.defaults.directives[underscore(directive_method.__name__)] = directive_method             # <<<<<<<<<<<<<<
 *         else:
 *             module = _api_module(directive_method.__module__)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_hug); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_defaults); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_directives); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_underscore); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_directive_method, __pyx_n_s_name_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_t_3, __pyx_v_directive_method) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "hug/decorators.py":166
 *     '''A decorator that registers a single hug directive'''
 *     def decorator(directive_method):
 *         if apply_globally:             # <<<<<<<<<<<<<<
 *             hug.defaults.directives[underscore(directive_method.__name__)] = directive_method
 *         else:
 */
    goto __pyx_L3;
  }

  /* "hug/decorators.py":169
 *             hug.defaults.directives[underscore(directive_method.__name__)] = directive_method
 *         else:
 *             module = _api_module(directive_method.__module__)             # <<<<<<<<<<<<<<
 *             module.__hug__.add_directive(directive_method)
 *         directive_method.directive = True
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_api_module); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_directive_method, __pyx_n_s_module_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __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_2); __pyx_t_2 = 0;
    __pyx_v_module = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "hug/decorators.py":170
 *         else:
 *             module = _api_module(directive_method.__module__)
 *             module.__hug__.add_directive(directive_method)             # <<<<<<<<<<<<<<
 *         directive_method.directive = True
 *         return directive_method
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_module, __pyx_n_s_hug_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_add_directive); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_2) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_directive_method); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
      __Pyx_INCREF(__pyx_v_directive_method);
      __Pyx_GIVEREF(__pyx_v_directive_method);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_directive_method);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __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_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "hug/decorators.py":171
 *             module = _api_module(directive_method.__module__)
 *             module.__hug__.add_directive(directive_method)
 *         directive_method.directive = True             # <<<<<<<<<<<<<<
 *         return directive_method
 *     return decorator
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_directive_method, __pyx_n_s_directive, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":172
 *             module.__hug__.add_directive(directive_method)
 *         directive_method.directive = True
 *         return directive_method             # <<<<<<<<<<<<<<
 *     return decorator
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_directive_method);
  __pyx_r = __pyx_v_directive_method;
  goto __pyx_L0;

  /* "hug/decorators.py":165
 * def directive(apply_globally=True):
 *     '''A decorator that registers a single hug directive'''
 *     def decorator(directive_method):             # <<<<<<<<<<<<<<
 *         if apply_globally:
 *             hug.defaults.directives[underscore(directive_method.__name__)] = directive_method
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("hug.decorators.directive.decorator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_module);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":163
 * 
 * 
 * def directive(apply_globally=True):             # <<<<<<<<<<<<<<
 *     '''A decorator that registers a single hug directive'''
 *     def decorator(directive_method):
 */

static PyObject *__pyx_pf_3hug_10decorators_4directive(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_apply_globally) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_2_directive *__pyx_cur_scope;
  PyObject *__pyx_v_decorator = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("directive", 0);
  __pyx_cur_scope = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_2_directive *)__pyx_tp_new_3hug_10decorators___pyx_scope_struct_2_directive(__pyx_ptype_3hug_10decorators___pyx_scope_struct_2_directive, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_apply_globally = __pyx_v_apply_globally;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_apply_globally);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_apply_globally);

  /* "hug/decorators.py":165
 * def directive(apply_globally=True):
 *     '''A decorator that registers a single hug directive'''
 *     def decorator(directive_method):             # <<<<<<<<<<<<<<
 *         if apply_globally:
 *             hug.defaults.directives[underscore(directive_method.__name__)] = directive_method
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_9directive_1decorator, 0, __pyx_n_s_directive_locals_decorator, ((PyObject*)__pyx_cur_scope), __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__7)); 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_v_decorator = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "hug/decorators.py":173
 *         directive_method.directive = True
 *         return directive_method
 *     return decorator             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_decorator);
  __pyx_r = __pyx_v_decorator;
  goto __pyx_L0;

  /* "hug/decorators.py":163
 * 
 * 
 * def directive(apply_globally=True):             # <<<<<<<<<<<<<<
 *     '''A decorator that registers a single hug directive'''
 *     def decorator(directive_method):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("hug.decorators.directive", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_decorator);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":176
 * 
 * 
 * def request_middleware():             # <<<<<<<<<<<<<<
 *     '''Registers a middleware function that will be called on every request'''
 *     def decorator(middleware_method):
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_7request_middleware(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3hug_10decorators_6request_middleware[] = "Registers a middleware function that will be called on every request";
static PyMethodDef __pyx_mdef_3hug_10decorators_7request_middleware = {"request_middleware", (PyCFunction)__pyx_pw_3hug_10decorators_7request_middleware, METH_NOARGS, __pyx_doc_3hug_10decorators_6request_middleware};
static PyObject *__pyx_pw_3hug_10decorators_7request_middleware(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("request_middleware (wrapper)", 0);
  __pyx_r = __pyx_pf_3hug_10decorators_6request_middleware(__pyx_self);

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

/* "hug/decorators.py":178
 * def request_middleware():
 *     '''Registers a middleware function that will be called on every request'''
 *     def decorator(middleware_method):             # <<<<<<<<<<<<<<
 *         module = _api_module(middleware_method.__module__)
 *         middleware_method.__self__ = middleware_method
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_18request_middleware_1decorator(PyObject *__pyx_self, PyObject *__pyx_v_middleware_method); /*proto*/
static PyMethodDef __pyx_mdef_3hug_10decorators_18request_middleware_1decorator = {"decorator", (PyCFunction)__pyx_pw_3hug_10decorators_18request_middleware_1decorator, METH_O, 0};
static PyObject *__pyx_pw_3hug_10decorators_18request_middleware_1decorator(PyObject *__pyx_self, PyObject *__pyx_v_middleware_method) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decorator (wrapper)", 0);
  __pyx_r = __pyx_pf_3hug_10decorators_18request_middleware_decorator(__pyx_self, ((PyObject *)__pyx_v_middleware_method));

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

static PyObject *__pyx_pf_3hug_10decorators_18request_middleware_decorator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_middleware_method) {
  PyObject *__pyx_v_module = 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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decorator", 0);

  /* "hug/decorators.py":179
 *     '''Registers a middleware function that will be called on every request'''
 *     def decorator(middleware_method):
 *         module = _api_module(middleware_method.__module__)             # <<<<<<<<<<<<<<
 *         middleware_method.__self__ = middleware_method
 *         module.__hug__.add_middleware(namedtuple('MiddlewareRouter', ('process_request', ))(middleware_method))
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_api_module); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_middleware_method, __pyx_n_s_module_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, 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_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_module = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "hug/decorators.py":180
 *     def decorator(middleware_method):
 *         module = _api_module(middleware_method.__module__)
 *         middleware_method.__self__ = middleware_method             # <<<<<<<<<<<<<<
 *         module.__hug__.add_middleware(namedtuple('MiddlewareRouter', ('process_request', ))(middleware_method))
 *         return middleware_method
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_middleware_method, __pyx_n_s_self_2, __pyx_v_middleware_method) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":181
 *         module = _api_module(middleware_method.__module__)
 *         middleware_method.__self__ = middleware_method
 *         module.__hug__.add_middleware(namedtuple('MiddlewareRouter', ('process_request', ))(middleware_method))             # <<<<<<<<<<<<<<
 *         return middleware_method
 *     return decorator
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_module, __pyx_n_s_hug_3); 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);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_add_middleware); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_namedtuple); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_middleware_method); 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);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_middleware_method);
    __Pyx_GIVEREF(__pyx_v_middleware_method);
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_middleware_method);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); 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);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "hug/decorators.py":182
 *         middleware_method.__self__ = middleware_method
 *         module.__hug__.add_middleware(namedtuple('MiddlewareRouter', ('process_request', ))(middleware_method))
 *         return middleware_method             # <<<<<<<<<<<<<<
 *     return decorator
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_middleware_method);
  __pyx_r = __pyx_v_middleware_method;
  goto __pyx_L0;

  /* "hug/decorators.py":178
 * def request_middleware():
 *     '''Registers a middleware function that will be called on every request'''
 *     def decorator(middleware_method):             # <<<<<<<<<<<<<<
 *         module = _api_module(middleware_method.__module__)
 *         middleware_method.__self__ = middleware_method
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("hug.decorators.request_middleware.decorator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_module);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":176
 * 
 * 
 * def request_middleware():             # <<<<<<<<<<<<<<
 *     '''Registers a middleware function that will be called on every request'''
 *     def decorator(middleware_method):
 */

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

  /* "hug/decorators.py":178
 * def request_middleware():
 *     '''Registers a middleware function that will be called on every request'''
 *     def decorator(middleware_method):             # <<<<<<<<<<<<<<
 *         module = _api_module(middleware_method.__module__)
 *         middleware_method.__self__ = middleware_method
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_18request_middleware_1decorator, 0, __pyx_n_s_request_middleware_locals_decora, NULL, __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_decorator = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "hug/decorators.py":183
 *         module.__hug__.add_middleware(namedtuple('MiddlewareRouter', ('process_request', ))(middleware_method))
 *         return middleware_method
 *     return decorator             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_decorator);
  __pyx_r = __pyx_v_decorator;
  goto __pyx_L0;

  /* "hug/decorators.py":176
 * 
 * 
 * def request_middleware():             # <<<<<<<<<<<<<<
 *     '''Registers a middleware function that will be called on every request'''
 *     def decorator(middleware_method):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("hug.decorators.request_middleware", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_decorator);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":186
 * 
 * 
 * def response_middleware():             # <<<<<<<<<<<<<<
 *     '''Registers a middleware function that will be called on every response'''
 *     def decorator(middleware_method):
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_9response_middleware(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_3hug_10decorators_8response_middleware[] = "Registers a middleware function that will be called on every response";
static PyMethodDef __pyx_mdef_3hug_10decorators_9response_middleware = {"response_middleware", (PyCFunction)__pyx_pw_3hug_10decorators_9response_middleware, METH_NOARGS, __pyx_doc_3hug_10decorators_8response_middleware};
static PyObject *__pyx_pw_3hug_10decorators_9response_middleware(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("response_middleware (wrapper)", 0);
  __pyx_r = __pyx_pf_3hug_10decorators_8response_middleware(__pyx_self);

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

/* "hug/decorators.py":188
 * def response_middleware():
 *     '''Registers a middleware function that will be called on every response'''
 *     def decorator(middleware_method):             # <<<<<<<<<<<<<<
 *         module = _api_module(middleware_method.__module__)
 *         middleware_method.__self__ = middleware_method
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_19response_middleware_1decorator(PyObject *__pyx_self, PyObject *__pyx_v_middleware_method); /*proto*/
static PyMethodDef __pyx_mdef_3hug_10decorators_19response_middleware_1decorator = {"decorator", (PyCFunction)__pyx_pw_3hug_10decorators_19response_middleware_1decorator, METH_O, 0};
static PyObject *__pyx_pw_3hug_10decorators_19response_middleware_1decorator(PyObject *__pyx_self, PyObject *__pyx_v_middleware_method) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decorator (wrapper)", 0);
  __pyx_r = __pyx_pf_3hug_10decorators_19response_middleware_decorator(__pyx_self, ((PyObject *)__pyx_v_middleware_method));

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

static PyObject *__pyx_pf_3hug_10decorators_19response_middleware_decorator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_middleware_method) {
  PyObject *__pyx_v_module = 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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decorator", 0);

  /* "hug/decorators.py":189
 *     '''Registers a middleware function that will be called on every response'''
 *     def decorator(middleware_method):
 *         module = _api_module(middleware_method.__module__)             # <<<<<<<<<<<<<<
 *         middleware_method.__self__ = middleware_method
 *         module.__hug__.add_middleware(namedtuple('MiddlewareRouter', ('process_response', ))(middleware_method))
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_api_module); 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);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_middleware_method, __pyx_n_s_module_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __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_2); __pyx_t_2 = 0;
  __pyx_v_module = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "hug/decorators.py":190
 *     def decorator(middleware_method):
 *         module = _api_module(middleware_method.__module__)
 *         middleware_method.__self__ = middleware_method             # <<<<<<<<<<<<<<
 *         module.__hug__.add_middleware(namedtuple('MiddlewareRouter', ('process_response', ))(middleware_method))
 *         return middleware_method
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_middleware_method, __pyx_n_s_self_2, __pyx_v_middleware_method) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":191
 *         module = _api_module(middleware_method.__module__)
 *         middleware_method.__self__ = middleware_method
 *         module.__hug__.add_middleware(namedtuple('MiddlewareRouter', ('process_response', ))(middleware_method))             # <<<<<<<<<<<<<<
 *         return middleware_method
 *     return decorator
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_module, __pyx_n_s_hug_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_add_middleware); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_namedtuple); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_middleware_method); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_middleware_method);
    __Pyx_GIVEREF(__pyx_v_middleware_method);
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_middleware_method);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "hug/decorators.py":192
 *         middleware_method.__self__ = middleware_method
 *         module.__hug__.add_middleware(namedtuple('MiddlewareRouter', ('process_response', ))(middleware_method))
 *         return middleware_method             # <<<<<<<<<<<<<<
 *     return decorator
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_middleware_method);
  __pyx_r = __pyx_v_middleware_method;
  goto __pyx_L0;

  /* "hug/decorators.py":188
 * def response_middleware():
 *     '''Registers a middleware function that will be called on every response'''
 *     def decorator(middleware_method):             # <<<<<<<<<<<<<<
 *         module = _api_module(middleware_method.__module__)
 *         middleware_method.__self__ = middleware_method
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("hug.decorators.response_middleware.decorator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_module);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":186
 * 
 * 
 * def response_middleware():             # <<<<<<<<<<<<<<
 *     '''Registers a middleware function that will be called on every response'''
 *     def decorator(middleware_method):
 */

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

  /* "hug/decorators.py":188
 * def response_middleware():
 *     '''Registers a middleware function that will be called on every response'''
 *     def decorator(middleware_method):             # <<<<<<<<<<<<<<
 *         module = _api_module(middleware_method.__module__)
 *         middleware_method.__self__ = middleware_method
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_19response_middleware_1decorator, 0, __pyx_n_s_response_middleware_locals_decor, NULL, __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_decorator = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "hug/decorators.py":193
 *         module.__hug__.add_middleware(namedtuple('MiddlewareRouter', ('process_response', ))(middleware_method))
 *         return middleware_method
 *     return decorator             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_decorator);
  __pyx_r = __pyx_v_decorator;
  goto __pyx_L0;

  /* "hug/decorators.py":186
 * 
 * 
 * def response_middleware():             # <<<<<<<<<<<<<<
 *     '''Registers a middleware function that will be called on every response'''
 *     def decorator(middleware_method):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("hug.decorators.response_middleware", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_decorator);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":196
 * 
 * 
 * def extend_api(route=""):             # <<<<<<<<<<<<<<
 *     '''Extends the current api, with handlers from an imported api. Optionally provide a route that prefixes access'''
 *     def decorator(extend_with):
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_11extend_api(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3hug_10decorators_10extend_api[] = "Extends the current api, with handlers from an imported api. Optionally provide a route that prefixes access";
static PyMethodDef __pyx_mdef_3hug_10decorators_11extend_api = {"extend_api", (PyCFunction)__pyx_pw_3hug_10decorators_11extend_api, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3hug_10decorators_10extend_api};
static PyObject *__pyx_pw_3hug_10decorators_11extend_api(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_route = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("extend_api (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_route,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)((PyObject*)__pyx_kp_s_));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_route);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extend_api") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_route = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("extend_api", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("hug.decorators.extend_api", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3hug_10decorators_10extend_api(__pyx_self, __pyx_v_route);

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

/* "hug/decorators.py":198
 * def extend_api(route=""):
 *     '''Extends the current api, with handlers from an imported api. Optionally provide a route that prefixes access'''
 *     def decorator(extend_with):             # <<<<<<<<<<<<<<
 *         module = _api_module(extend_with.__module__)
 *         for api in extend_with():
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_10extend_api_1decorator(PyObject *__pyx_self, PyObject *__pyx_v_extend_with); /*proto*/
static PyMethodDef __pyx_mdef_3hug_10decorators_10extend_api_1decorator = {"decorator", (PyCFunction)__pyx_pw_3hug_10decorators_10extend_api_1decorator, METH_O, 0};
static PyObject *__pyx_pw_3hug_10decorators_10extend_api_1decorator(PyObject *__pyx_self, PyObject *__pyx_v_extend_with) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decorator (wrapper)", 0);
  __pyx_r = __pyx_pf_3hug_10decorators_10extend_api_decorator(__pyx_self, ((PyObject *)__pyx_v_extend_with));

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

static PyObject *__pyx_pf_3hug_10decorators_10extend_api_decorator(PyObject *__pyx_self, PyObject *__pyx_v_extend_with) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_3_extend_api *__pyx_cur_scope;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_3_extend_api *__pyx_outer_scope;
  PyObject *__pyx_v_module = NULL;
  PyObject *__pyx_v_api = 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;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  Py_ssize_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decorator", 0);
  __pyx_outer_scope = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_3_extend_api *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "hug/decorators.py":199
 *     '''Extends the current api, with handlers from an imported api. Optionally provide a route that prefixes access'''
 *     def decorator(extend_with):
 *         module = _api_module(extend_with.__module__)             # <<<<<<<<<<<<<<
 *         for api in extend_with():
 *             module.__hug__.extend(api, route)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_api_module); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_extend_with, __pyx_n_s_module_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __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_2); __pyx_t_2 = 0;
  __pyx_v_module = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "hug/decorators.py":200
 *     def decorator(extend_with):
 *         module = _api_module(extend_with.__module__)
 *         for api in extend_with():             # <<<<<<<<<<<<<<
 *             module.__hug__.extend(api, route)
 *         return extend_with
 */
  __Pyx_INCREF(__pyx_v_extend_with);
  __pyx_t_2 = __pyx_v_extend_with; __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); 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);
    __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_7(__pyx_t_2);
      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 = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_api, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "hug/decorators.py":201
 *         module = _api_module(extend_with.__module__)
 *         for api in extend_with():
 *             module.__hug__.extend(api, route)             # <<<<<<<<<<<<<<
 *         return extend_with
 *     return decorator
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_module, __pyx_n_s_hug_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_extend); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_v_route)) { __Pyx_RaiseClosureNameError("route"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_5 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_8 = 1;
      }
    }
    __pyx_t_4 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_v_api);
    __Pyx_GIVEREF(__pyx_v_api);
    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_v_api);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_route);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_route);
    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_cur_scope->__pyx_v_route);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, 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_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;

    /* "hug/decorators.py":200
 *     def decorator(extend_with):
 *         module = _api_module(extend_with.__module__)
 *         for api in extend_with():             # <<<<<<<<<<<<<<
 *             module.__hug__.extend(api, route)
 *         return extend_with
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "hug/decorators.py":202
 *         for api in extend_with():
 *             module.__hug__.extend(api, route)
 *         return extend_with             # <<<<<<<<<<<<<<
 *     return decorator
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_extend_with);
  __pyx_r = __pyx_v_extend_with;
  goto __pyx_L0;

  /* "hug/decorators.py":198
 * def extend_api(route=""):
 *     '''Extends the current api, with handlers from an imported api. Optionally provide a route that prefixes access'''
 *     def decorator(extend_with):             # <<<<<<<<<<<<<<
 *         module = _api_module(extend_with.__module__)
 *         for api in extend_with():
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("hug.decorators.extend_api.decorator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_module);
  __Pyx_XDECREF(__pyx_v_api);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":196
 * 
 * 
 * def extend_api(route=""):             # <<<<<<<<<<<<<<
 *     '''Extends the current api, with handlers from an imported api. Optionally provide a route that prefixes access'''
 *     def decorator(extend_with):
 */

static PyObject *__pyx_pf_3hug_10decorators_10extend_api(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_route) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_3_extend_api *__pyx_cur_scope;
  PyObject *__pyx_v_decorator = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("extend_api", 0);
  __pyx_cur_scope = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_3_extend_api *)__pyx_tp_new_3hug_10decorators___pyx_scope_struct_3_extend_api(__pyx_ptype_3hug_10decorators___pyx_scope_struct_3_extend_api, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_route = __pyx_v_route;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_route);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_route);

  /* "hug/decorators.py":198
 * def extend_api(route=""):
 *     '''Extends the current api, with handlers from an imported api. Optionally provide a route that prefixes access'''
 *     def decorator(extend_with):             # <<<<<<<<<<<<<<
 *         module = _api_module(extend_with.__module__)
 *         for api in extend_with():
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_10extend_api_1decorator, 0, __pyx_n_s_extend_api_locals_decorator, ((PyObject*)__pyx_cur_scope), __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__17)); 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_v_decorator = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "hug/decorators.py":203
 *             module.__hug__.extend(api, route)
 *         return extend_with
 *     return decorator             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_decorator);
  __pyx_r = __pyx_v_decorator;
  goto __pyx_L0;

  /* "hug/decorators.py":196
 * 
 * 
 * def extend_api(route=""):             # <<<<<<<<<<<<<<
 *     '''Extends the current api, with handlers from an imported api. Optionally provide a route that prefixes access'''
 *     def decorator(extend_with):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("hug.decorators.extend_api", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_decorator);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":206
 * 
 * 
 * def _api_module(module_name):             # <<<<<<<<<<<<<<
 *     module = sys.modules[module_name]
 *     if not '__hug__' in module.__dict__:
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_13_api_module(PyObject *__pyx_self, PyObject *__pyx_v_module_name); /*proto*/
static PyMethodDef __pyx_mdef_3hug_10decorators_13_api_module = {"_api_module", (PyCFunction)__pyx_pw_3hug_10decorators_13_api_module, METH_O, 0};
static PyObject *__pyx_pw_3hug_10decorators_13_api_module(PyObject *__pyx_self, PyObject *__pyx_v_module_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_api_module (wrapper)", 0);
  __pyx_r = __pyx_pf_3hug_10decorators_12_api_module(__pyx_self, ((PyObject *)__pyx_v_module_name));

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

/* "hug/decorators.py":209
 *     module = sys.modules[module_name]
 *     if not '__hug__' in module.__dict__:
 *         def api_auto_instantiate(*kargs, **kwargs):             # <<<<<<<<<<<<<<
 *             if not hasattr(module, '__hug_serving__'):
 *                 module.__hug_wsgi__ = server(module)
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_11_api_module_1api_auto_instantiate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3hug_10decorators_11_api_module_1api_auto_instantiate = {"api_auto_instantiate", (PyCFunction)__pyx_pw_3hug_10decorators_11_api_module_1api_auto_instantiate, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3hug_10decorators_11_api_module_1api_auto_instantiate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_kargs = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("api_auto_instantiate (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "api_auto_instantiate", 1))) return NULL;
  if (unlikely(__pyx_kwds)) {
    __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  } else {
    __pyx_v_kwargs = NULL;
  }
  __Pyx_INCREF(__pyx_args);
  __pyx_v_kargs = __pyx_args;
  __pyx_r = __pyx_pf_3hug_10decorators_11_api_module_api_auto_instantiate(__pyx_self, __pyx_v_kargs, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_3hug_10decorators_11_api_module_api_auto_instantiate(PyObject *__pyx_self, PyObject *__pyx_v_kargs, PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_4__api_module *__pyx_cur_scope;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_4__api_module *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("api_auto_instantiate", 0);
  __pyx_outer_scope = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_4__api_module *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "hug/decorators.py":210
 *     if not '__hug__' in module.__dict__:
 *         def api_auto_instantiate(*kargs, **kwargs):
 *             if not hasattr(module, '__hug_serving__'):             # <<<<<<<<<<<<<<
 *                 module.__hug_wsgi__ = server(module)
 *                 module.__hug_serving__ = True
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_module)) { __Pyx_RaiseClosureNameError("module"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_module;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyObject_HasAttr(__pyx_t_1, __pyx_n_s_hug_serving); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
  if (__pyx_t_3) {

    /* "hug/decorators.py":211
 *         def api_auto_instantiate(*kargs, **kwargs):
 *             if not hasattr(module, '__hug_serving__'):
 *                 module.__hug_wsgi__ = server(module)             # <<<<<<<<<<<<<<
 *                 module.__hug_serving__ = True
 *             return module.__hug_wsgi__(*kargs, **kwargs)
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_server); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(!__pyx_cur_scope->__pyx_v_module)) { __Pyx_RaiseClosureNameError("module"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_cur_scope->__pyx_v_module); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_module);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_module);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_cur_scope->__pyx_v_module);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_v_module)) { __Pyx_RaiseClosureNameError("module"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_module, __pyx_n_s_hug_wsgi, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "hug/decorators.py":212
 *             if not hasattr(module, '__hug_serving__'):
 *                 module.__hug_wsgi__ = server(module)
 *                 module.__hug_serving__ = True             # <<<<<<<<<<<<<<
 *             return module.__hug_wsgi__(*kargs, **kwargs)
 *         module.__hug__ = HugAPI(module)
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_module)) { __Pyx_RaiseClosureNameError("module"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_module, __pyx_n_s_hug_serving, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "hug/decorators.py":210
 *     if not '__hug__' in module.__dict__:
 *         def api_auto_instantiate(*kargs, **kwargs):
 *             if not hasattr(module, '__hug_serving__'):             # <<<<<<<<<<<<<<
 *                 module.__hug_wsgi__ = server(module)
 *                 module.__hug_serving__ = True
 */
  }

  /* "hug/decorators.py":213
 *                 module.__hug_wsgi__ = server(module)
 *                 module.__hug_serving__ = True
 *             return module.__hug_wsgi__(*kargs, **kwargs)             # <<<<<<<<<<<<<<
 *         module.__hug__ = HugAPI(module)
 *         module.__hug_wsgi__ = api_auto_instantiate
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_module)) { __Pyx_RaiseClosureNameError("module"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_module, __pyx_n_s_hug_wsgi); 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_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_kargs, __pyx_v_kwargs); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "hug/decorators.py":209
 *     module = sys.modules[module_name]
 *     if not '__hug__' in module.__dict__:
 *         def api_auto_instantiate(*kargs, **kwargs):             # <<<<<<<<<<<<<<
 *             if not hasattr(module, '__hug_serving__'):
 *                 module.__hug_wsgi__ = server(module)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("hug.decorators._api_module.api_auto_instantiate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":206
 * 
 * 
 * def _api_module(module_name):             # <<<<<<<<<<<<<<
 *     module = sys.modules[module_name]
 *     if not '__hug__' in module.__dict__:
 */

static PyObject *__pyx_pf_3hug_10decorators_12_api_module(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_module_name) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_4__api_module *__pyx_cur_scope;
  PyObject *__pyx_v_api_auto_instantiate = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_api_module", 0);
  __pyx_cur_scope = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_4__api_module *)__pyx_tp_new_3hug_10decorators___pyx_scope_struct_4__api_module(__pyx_ptype_3hug_10decorators___pyx_scope_struct_4__api_module, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);

  /* "hug/decorators.py":207
 * 
 * def _api_module(module_name):
 *     module = sys.modules[module_name]             # <<<<<<<<<<<<<<
 *     if not '__hug__' in module.__dict__:
 *         def api_auto_instantiate(*kargs, **kwargs):
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); 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_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_modules); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __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_GetItem(__pyx_t_2, __pyx_v_module_name); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_module = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "hug/decorators.py":208
 * def _api_module(module_name):
 *     module = sys.modules[module_name]
 *     if not '__hug__' in module.__dict__:             # <<<<<<<<<<<<<<
 *         def api_auto_instantiate(*kargs, **kwargs):
 *             if not hasattr(module, '__hug_serving__'):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_module, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_hug_3, __pyx_t_1, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "hug/decorators.py":209
 *     module = sys.modules[module_name]
 *     if not '__hug__' in module.__dict__:
 *         def api_auto_instantiate(*kargs, **kwargs):             # <<<<<<<<<<<<<<
 *             if not hasattr(module, '__hug_serving__'):
 *                 module.__hug_wsgi__ = server(module)
 */
    __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_11_api_module_1api_auto_instantiate, 0, __pyx_n_s_api_module_locals_api_auto_inst, ((PyObject*)__pyx_cur_scope), __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_api_auto_instantiate = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "hug/decorators.py":214
 *                 module.__hug_serving__ = True
 *             return module.__hug_wsgi__(*kargs, **kwargs)
 *         module.__hug__ = HugAPI(module)             # <<<<<<<<<<<<<<
 *         module.__hug_wsgi__ = api_auto_instantiate
 *     return module
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_HugAPI); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_v_module); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_module);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_module);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_cur_scope->__pyx_v_module);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_module, __pyx_n_s_hug_3, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "hug/decorators.py":215
 *             return module.__hug_wsgi__(*kargs, **kwargs)
 *         module.__hug__ = HugAPI(module)
 *         module.__hug_wsgi__ = api_auto_instantiate             # <<<<<<<<<<<<<<
 *     return module
 * 
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_module, __pyx_n_s_hug_wsgi, __pyx_v_api_auto_instantiate) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "hug/decorators.py":208
 * def _api_module(module_name):
 *     module = sys.modules[module_name]
 *     if not '__hug__' in module.__dict__:             # <<<<<<<<<<<<<<
 *         def api_auto_instantiate(*kargs, **kwargs):
 *             if not hasattr(module, '__hug_serving__'):
 */
  }

  /* "hug/decorators.py":216
 *         module.__hug__ = HugAPI(module)
 *         module.__hug_wsgi__ = api_auto_instantiate
 *     return module             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_module);
  __pyx_r = __pyx_cur_scope->__pyx_v_module;
  goto __pyx_L0;

  /* "hug/decorators.py":206
 * 
 * 
 * def _api_module(module_name):             # <<<<<<<<<<<<<<
 *     module = sys.modules[module_name]
 *     if not '__hug__' in module.__dict__:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("hug.decorators._api_module", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_api_auto_instantiate);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":219
 * 
 * 
 * def _marshmallow_schema(marshmallow):             # <<<<<<<<<<<<<<
 *     '''Dynamically generates a hug style type handler from a Marshmallow style schema'''
 *     def marshmallow_type(input_data):
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_15_marshmallow_schema(PyObject *__pyx_self, PyObject *__pyx_v_marshmallow); /*proto*/
static char __pyx_doc_3hug_10decorators_14_marshmallow_schema[] = "Dynamically generates a hug style type handler from a Marshmallow style schema";
static PyMethodDef __pyx_mdef_3hug_10decorators_15_marshmallow_schema = {"_marshmallow_schema", (PyCFunction)__pyx_pw_3hug_10decorators_15_marshmallow_schema, METH_O, __pyx_doc_3hug_10decorators_14_marshmallow_schema};
static PyObject *__pyx_pw_3hug_10decorators_15_marshmallow_schema(PyObject *__pyx_self, PyObject *__pyx_v_marshmallow) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_marshmallow_schema (wrapper)", 0);
  __pyx_r = __pyx_pf_3hug_10decorators_14_marshmallow_schema(__pyx_self, ((PyObject *)__pyx_v_marshmallow));

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

/* "hug/decorators.py":221
 * def _marshmallow_schema(marshmallow):
 *     '''Dynamically generates a hug style type handler from a Marshmallow style schema'''
 *     def marshmallow_type(input_data):             # <<<<<<<<<<<<<<
 *         result, errors = marshmallow.loads(input_data) if isinstance(input_data, str) else marshmallow.load(input_data)
 *         if errors:
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_19_marshmallow_schema_1marshmallow_type(PyObject *__pyx_self, PyObject *__pyx_v_input_data); /*proto*/
static PyMethodDef __pyx_mdef_3hug_10decorators_19_marshmallow_schema_1marshmallow_type = {"marshmallow_type", (PyCFunction)__pyx_pw_3hug_10decorators_19_marshmallow_schema_1marshmallow_type, METH_O, 0};
static PyObject *__pyx_pw_3hug_10decorators_19_marshmallow_schema_1marshmallow_type(PyObject *__pyx_self, PyObject *__pyx_v_input_data) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("marshmallow_type (wrapper)", 0);
  __pyx_r = __pyx_pf_3hug_10decorators_19_marshmallow_schema_marshmallow_type(__pyx_self, ((PyObject *)__pyx_v_input_data));

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

static PyObject *__pyx_pf_3hug_10decorators_19_marshmallow_schema_marshmallow_type(PyObject *__pyx_self, PyObject *__pyx_v_input_data) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema *__pyx_cur_scope;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema *__pyx_outer_scope;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_errors = 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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("marshmallow_type", 0);
  __pyx_outer_scope = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "hug/decorators.py":222
 *     '''Dynamically generates a hug style type handler from a Marshmallow style schema'''
 *     def marshmallow_type(input_data):
 *         result, errors = marshmallow.loads(input_data) if isinstance(input_data, str) else marshmallow.load(input_data)             # <<<<<<<<<<<<<<
 *         if errors:
 *             raise InvalidTypeData('Invalid {0} passed in'.format(marshmallow.__class__.__name__), errors)
 */
  __pyx_t_2 = PyString_Check(__pyx_v_input_data); 
  if ((__pyx_t_2 != 0)) {
    if (unlikely(!__pyx_cur_scope->__pyx_v_marshmallow)) { __Pyx_RaiseClosureNameError("marshmallow"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_marshmallow, __pyx_n_s_loads); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_input_data); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_INCREF(__pyx_v_input_data);
      __Pyx_GIVEREF(__pyx_v_input_data);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_input_data);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    if (unlikely(!__pyx_cur_scope->__pyx_v_marshmallow)) { __Pyx_RaiseClosureNameError("marshmallow"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_marshmallow, __pyx_n_s_load); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_input_data); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_input_data);
      __Pyx_GIVEREF(__pyx_v_input_data);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_input_data);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __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_1 = __pyx_t_3;
    __pyx_t_3 = 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 = 222; __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_4 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = NULL;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_result = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_errors = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "hug/decorators.py":223
 *     def marshmallow_type(input_data):
 *         result, errors = marshmallow.loads(input_data) if isinstance(input_data, str) else marshmallow.load(input_data)
 *         if errors:             # <<<<<<<<<<<<<<
 *             raise InvalidTypeData('Invalid {0} passed in'.format(marshmallow.__class__.__name__), errors)
 *         return result
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_errors); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "hug/decorators.py":224
 *         result, errors = marshmallow.loads(input_data) if isinstance(input_data, str) else marshmallow.load(input_data)
 *         if errors:
 *             raise InvalidTypeData('Invalid {0} passed in'.format(marshmallow.__class__.__name__), errors)             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_InvalidTypeData); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Invalid_0_passed_in, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(!__pyx_cur_scope->__pyx_v_marshmallow)) { __Pyx_RaiseClosureNameError("marshmallow"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_marshmallow, __pyx_n_s_class); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_name_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_10 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_10 = 1;
      }
    }
    __pyx_t_9 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_10, __pyx_t_3);
    __Pyx_INCREF(__pyx_v_errors);
    __Pyx_GIVEREF(__pyx_v_errors);
    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_10, __pyx_v_errors);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "hug/decorators.py":223
 *     def marshmallow_type(input_data):
 *         result, errors = marshmallow.loads(input_data) if isinstance(input_data, str) else marshmallow.load(input_data)
 *         if errors:             # <<<<<<<<<<<<<<
 *             raise InvalidTypeData('Invalid {0} passed in'.format(marshmallow.__class__.__name__), errors)
 *         return result
 */
  }

  /* "hug/decorators.py":225
 *         if errors:
 *             raise InvalidTypeData('Invalid {0} passed in'.format(marshmallow.__class__.__name__), errors)
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     marshmallow_type.__doc__ = marshmallow.__doc__
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "hug/decorators.py":221
 * def _marshmallow_schema(marshmallow):
 *     '''Dynamically generates a hug style type handler from a Marshmallow style schema'''
 *     def marshmallow_type(input_data):             # <<<<<<<<<<<<<<
 *         result, errors = marshmallow.loads(input_data) if isinstance(input_data, str) else marshmallow.load(input_data)
 *         if errors:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("hug.decorators._marshmallow_schema.marshmallow_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_errors);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":219
 * 
 * 
 * def _marshmallow_schema(marshmallow):             # <<<<<<<<<<<<<<
 *     '''Dynamically generates a hug style type handler from a Marshmallow style schema'''
 *     def marshmallow_type(input_data):
 */

static PyObject *__pyx_pf_3hug_10decorators_14_marshmallow_schema(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_marshmallow) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema *__pyx_cur_scope;
  PyObject *__pyx_v_marshmallow_type = 0;
  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("_marshmallow_schema", 0);
  __pyx_cur_scope = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema *)__pyx_tp_new_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema(__pyx_ptype_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_marshmallow = __pyx_v_marshmallow;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_marshmallow);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_marshmallow);

  /* "hug/decorators.py":221
 * def _marshmallow_schema(marshmallow):
 *     '''Dynamically generates a hug style type handler from a Marshmallow style schema'''
 *     def marshmallow_type(input_data):             # <<<<<<<<<<<<<<
 *         result, errors = marshmallow.loads(input_data) if isinstance(input_data, str) else marshmallow.load(input_data)
 *         if errors:
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_19_marshmallow_schema_1marshmallow_type, 0, __pyx_n_s_marshmallow_schema_locals_marsh, ((PyObject*)__pyx_cur_scope), __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_marshmallow_type = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "hug/decorators.py":227
 *         return result
 * 
 *     marshmallow_type.__doc__ = marshmallow.__doc__             # <<<<<<<<<<<<<<
 *     marshmallow_type.__name__ = marshmallow.__class__.__name__
 *     return marshmallow_type
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_marshmallow, __pyx_n_s_doc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_marshmallow_type, __pyx_n_s_doc, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "hug/decorators.py":228
 * 
 *     marshmallow_type.__doc__ = marshmallow.__doc__
 *     marshmallow_type.__name__ = marshmallow.__class__.__name__             # <<<<<<<<<<<<<<
 *     return marshmallow_type
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_marshmallow, __pyx_n_s_class); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __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_marshmallow_type, __pyx_n_s_name_2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "hug/decorators.py":229
 *     marshmallow_type.__doc__ = marshmallow.__doc__
 *     marshmallow_type.__name__ = marshmallow.__class__.__name__
 *     return marshmallow_type             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_marshmallow_type);
  __pyx_r = __pyx_v_marshmallow_type;
  goto __pyx_L0;

  /* "hug/decorators.py":219
 * 
 * 
 * def _marshmallow_schema(marshmallow):             # <<<<<<<<<<<<<<
 *     '''Dynamically generates a hug style type handler from a Marshmallow style schema'''
 *     def marshmallow_type(input_data):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("hug.decorators._marshmallow_schema", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_marshmallow_type);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":232
 * 
 * 
 * def _create_interface(module, api_function, parameters=None, defaults={}, output=None, versions=None,             # <<<<<<<<<<<<<<
 *                       parse_body=True, set_status=False, transform=None, requires=()):
 *     '''Creates the request handling interface method for the given API function'''
 */

static PyObject *__pyx_pf_3hug_10decorators_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);

  /* "hug/decorators.py":233
 * 
 * def _create_interface(module, api_function, parameters=None, defaults={}, output=None, versions=None,
 *                       parse_body=True, set_status=False, transform=None, requires=()):             # <<<<<<<<<<<<<<
 *     '''Creates the request handling interface method for the given API function'''
 *     if not parameters:
 */
  __pyx_t_1 = PyTuple_New(8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_None));
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_defaults);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_defaults);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_defaults);
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)Py_None));
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)Py_None));
  __Pyx_INCREF(((PyObject *)Py_True));
  __Pyx_GIVEREF(((PyObject *)Py_True));
  PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)Py_True));
  __Pyx_INCREF(((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));
  PyTuple_SET_ITEM(__pyx_t_1, 5, ((PyObject *)Py_False));
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 6, ((PyObject *)Py_None));
  __Pyx_INCREF(((PyObject*)__pyx_empty_tuple));
  __Pyx_GIVEREF(((PyObject*)__pyx_empty_tuple));
  PyTuple_SET_ITEM(__pyx_t_1, 7, ((PyObject*)__pyx_empty_tuple));

  /* "hug/decorators.py":232
 * 
 * 
 * def _create_interface(module, api_function, parameters=None, defaults={}, output=None, versions=None,             # <<<<<<<<<<<<<<
 *                       parse_body=True, set_status=False, transform=None, requires=()):
 *     '''Creates the request handling interface method for the given API function'''
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, 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("hug.decorators.__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_3hug_10decorators_17_create_interface(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3hug_10decorators_16_create_interface[] = "Creates the request handling interface method for the given API function";
static PyMethodDef __pyx_mdef_3hug_10decorators_17_create_interface = {"_create_interface", (PyCFunction)__pyx_pw_3hug_10decorators_17_create_interface, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3hug_10decorators_16_create_interface};
static PyObject *__pyx_pw_3hug_10decorators_17_create_interface(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_module = 0;
  PyObject *__pyx_v_api_function = 0;
  PyObject *__pyx_v_parameters = 0;
  PyObject *__pyx_v_defaults = 0;
  PyObject *__pyx_v_output = 0;
  PyObject *__pyx_v_versions = 0;
  PyObject *__pyx_v_parse_body = 0;
  PyObject *__pyx_v_set_status = 0;
  PyObject *__pyx_v_transform = 0;
  PyObject *__pyx_v_requires = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_create_interface (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_module,&__pyx_n_s_api_function,&__pyx_n_s_parameters,&__pyx_n_s_defaults,&__pyx_n_s_output,&__pyx_n_s_versions,&__pyx_n_s_parse_body,&__pyx_n_s_set_status,&__pyx_n_s_transform,&__pyx_n_s_requires,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
    values[2] = ((PyObject *)((PyObject *)Py_None));
    values[3] = __pyx_dynamic_args->__pyx_arg_defaults;
    values[4] = ((PyObject *)((PyObject *)Py_None));
    values[5] = ((PyObject *)((PyObject *)Py_None));
    values[6] = ((PyObject *)((PyObject *)Py_True));
    values[7] = ((PyObject *)((PyObject *)Py_False));
    values[8] = ((PyObject *)((PyObject *)Py_None));
    values[9] = ((PyObject *)((PyObject*)__pyx_empty_tuple));
    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_module)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_api_function)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_create_interface", 0, 2, 10, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parameters);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_defaults);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_output);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_versions);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parse_body);
          if (value) { values[6] = value; kw_args--; }
        }
        case  7:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_set_status);
          if (value) { values[7] = value; kw_args--; }
        }
        case  8:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_transform);
          if (value) { values[8] = value; kw_args--; }
        }
        case  9:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_requires);
          if (value) { values[9] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_create_interface") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __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);
        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_module = values[0];
    __pyx_v_api_function = values[1];
    __pyx_v_parameters = values[2];
    __pyx_v_defaults = values[3];
    __pyx_v_output = values[4];
    __pyx_v_versions = values[5];
    __pyx_v_parse_body = values[6];
    __pyx_v_set_status = values[7];
    __pyx_v_transform = values[8];
    __pyx_v_requires = values[9];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_create_interface", 0, 2, 10, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("hug.decorators._create_interface", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3hug_10decorators_16_create_interface(__pyx_self, __pyx_v_module, __pyx_v_api_function, __pyx_v_parameters, __pyx_v_defaults, __pyx_v_output, __pyx_v_versions, __pyx_v_parse_body, __pyx_v_set_status, __pyx_v_transform, __pyx_v_requires);

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

/* "hug/decorators.py":286
 *         input_transformations[name] = transformer
 * 
 *     def interface(request, response, api_version=None, **kwargs):             # <<<<<<<<<<<<<<
 *         if set_status:
 *             response.status = set_status
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_17_create_interface_1interface(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3hug_10decorators_17_create_interface_1interface = {"interface", (PyCFunction)__pyx_pw_3hug_10decorators_17_create_interface_1interface, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3hug_10decorators_17_create_interface_1interface(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_request = 0;
  PyObject *__pyx_v_response = 0;
  PyObject *__pyx_v_api_version = 0;
  PyObject *__pyx_v_kwargs = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("interface (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_request,&__pyx_n_s_response,&__pyx_n_s_api_version,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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_request)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_response)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("interface", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_api_version);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "interface") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __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);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_request = values[0];
    __pyx_v_response = values[1];
    __pyx_v_api_version = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("interface", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("hug.decorators._create_interface.interface", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3hug_10decorators_17_create_interface_interface(__pyx_self, __pyx_v_request, __pyx_v_response, __pyx_v_api_version, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_3hug_10decorators_17_create_interface_interface(PyObject *__pyx_self, PyObject *__pyx_v_request, PyObject *__pyx_v_response, PyObject *__pyx_v_api_version, PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_6__create_interface *__pyx_cur_scope;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_6__create_interface *__pyx_outer_scope;
  PyObject *__pyx_v_function_output_kwargs = NULL;
  PyObject *__pyx_v_requirement = NULL;
  PyObject *__pyx_v_conclusion = NULL;
  PyObject *__pyx_v_input_parameters = NULL;
  PyObject *__pyx_v_body = NULL;
  PyObject *__pyx_v_body_formatting_handler = NULL;
  PyObject *__pyx_v_errors = NULL;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_type_handler = NULL;
  PyObject *__pyx_v_error = NULL;
  PyObject *__pyx_v_parameter = NULL;
  PyObject *__pyx_v_directive = NULL;
  PyObject *__pyx_v_arguments = NULL;
  PyObject *__pyx_v_require = NULL;
  PyObject *__pyx_v_to_return = NULL;
  PyObject *__pyx_v_extra_kwargs = NULL;
  PyObject *__pyx_v_size = NULL;
  PyObject *__pyx_v_start = NULL;
  PyObject *__pyx_v_end = NULL;
  PyObject *__pyx_v_length = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("interface", 0);
  __pyx_outer_scope = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_6__create_interface *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_INCREF(__pyx_v_api_version);

  /* "hug/decorators.py":287
 * 
 *     def interface(request, response, api_version=None, **kwargs):
 *         if set_status:             # <<<<<<<<<<<<<<
 *             response.status = set_status
 * 
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_set_status)) { __Pyx_RaiseClosureNameError("set_status"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_set_status); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "hug/decorators.py":288
 *     def interface(request, response, api_version=None, **kwargs):
 *         if set_status:
 *             response.status = set_status             # <<<<<<<<<<<<<<
 * 
 *         if function_output_args:
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_set_status)) { __Pyx_RaiseClosureNameError("set_status"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_response, __pyx_n_s_status, __pyx_cur_scope->__pyx_v_set_status) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "hug/decorators.py":287
 * 
 *     def interface(request, response, api_version=None, **kwargs):
 *         if set_status:             # <<<<<<<<<<<<<<
 *             response.status = set_status
 * 
 */
  }

  /* "hug/decorators.py":290
 *             response.status = set_status
 * 
 *         if function_output_args:             # <<<<<<<<<<<<<<
 *             function_output_kwargs = {}
 *             if 'response' in function_output_args:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_function_output_args)) { __Pyx_RaiseClosureNameError("function_output_args"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_function_output_args); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "hug/decorators.py":291
 * 
 *         if function_output_args:
 *             function_output_kwargs = {}             # <<<<<<<<<<<<<<
 *             if 'response' in function_output_args:
 *                 function_output_kwargs['response'] = response
 */
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_function_output_kwargs = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "hug/decorators.py":292
 *         if function_output_args:
 *             function_output_kwargs = {}
 *             if 'response' in function_output_args:             # <<<<<<<<<<<<<<
 *                 function_output_kwargs['response'] = response
 *             if 'request' in function_output_args:
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_function_output_args)) { __Pyx_RaiseClosureNameError("function_output_args"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_response, __pyx_cur_scope->__pyx_v_function_output_args, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = (__pyx_t_1 != 0);
    if (__pyx_t_3) {

      /* "hug/decorators.py":293
 *             function_output_kwargs = {}
 *             if 'response' in function_output_args:
 *                 function_output_kwargs['response'] = response             # <<<<<<<<<<<<<<
 *             if 'request' in function_output_args:
 *                 function_output_kwargs['request'] = request
 */
      if (unlikely(PyDict_SetItem(__pyx_v_function_output_kwargs, __pyx_n_s_response, __pyx_v_response) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "hug/decorators.py":292
 *         if function_output_args:
 *             function_output_kwargs = {}
 *             if 'response' in function_output_args:             # <<<<<<<<<<<<<<
 *                 function_output_kwargs['response'] = response
 *             if 'request' in function_output_args:
 */
    }

    /* "hug/decorators.py":294
 *             if 'response' in function_output_args:
 *                 function_output_kwargs['response'] = response
 *             if 'request' in function_output_args:             # <<<<<<<<<<<<<<
 *                 function_output_kwargs['request'] = request
 *         else:
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_function_output_args)) { __Pyx_RaiseClosureNameError("function_output_args"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_request, __pyx_cur_scope->__pyx_v_function_output_args, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = (__pyx_t_3 != 0);
    if (__pyx_t_1) {

      /* "hug/decorators.py":295
 *                 function_output_kwargs['response'] = response
 *             if 'request' in function_output_args:
 *                 function_output_kwargs['request'] = request             # <<<<<<<<<<<<<<
 *         else:
 *             function_output_kwargs = default_kwargs
 */
      if (unlikely(PyDict_SetItem(__pyx_v_function_output_kwargs, __pyx_n_s_request, __pyx_v_request) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "hug/decorators.py":294
 *             if 'response' in function_output_args:
 *                 function_output_kwargs['response'] = response
 *             if 'request' in function_output_args:             # <<<<<<<<<<<<<<
 *                 function_output_kwargs['request'] = request
 *         else:
 */
    }

    /* "hug/decorators.py":290
 *             response.status = set_status
 * 
 *         if function_output_args:             # <<<<<<<<<<<<<<
 *             function_output_kwargs = {}
 *             if 'response' in function_output_args:
 */
    goto __pyx_L4;
  }

  /* "hug/decorators.py":297
 *                 function_output_kwargs['request'] = request
 *         else:
 *             function_output_kwargs = default_kwargs             # <<<<<<<<<<<<<<
 * 
 *         api_version = int(api_version) if api_version is not None else api_version
 */
  /*else*/ {
    if (unlikely(!__pyx_cur_scope->__pyx_v_default_kwargs)) { __Pyx_RaiseClosureNameError("default_kwargs"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_default_kwargs);
    __pyx_v_function_output_kwargs = __pyx_cur_scope->__pyx_v_default_kwargs;
  }
  __pyx_L4:;

  /* "hug/decorators.py":299
 *             function_output_kwargs = default_kwargs
 * 
 *         api_version = int(api_version) if api_version is not None else api_version             # <<<<<<<<<<<<<<
 *         if callable(function_output.content_type):
 *             response.content_type = function_output.content_type(request=request, response=response)
 */
  __pyx_t_1 = (__pyx_v_api_version != Py_None);
  if ((__pyx_t_1 != 0)) {
    __pyx_t_4 = PyNumber_Int(__pyx_v_api_version); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __pyx_t_4;
    __pyx_t_4 = 0;
  } else {
    __Pyx_INCREF(__pyx_v_api_version);
    __pyx_t_2 = __pyx_v_api_version;
  }
  __Pyx_DECREF_SET(__pyx_v_api_version, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "hug/decorators.py":300
 * 
 *         api_version = int(api_version) if api_version is not None else api_version
 *         if callable(function_output.content_type):             # <<<<<<<<<<<<<<
 *             response.content_type = function_output.content_type(request=request, response=response)
 *         else:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_function_output)) { __Pyx_RaiseClosureNameError("function_output"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_function_output, __pyx_n_s_content_type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "hug/decorators.py":301
 *         api_version = int(api_version) if api_version is not None else api_version
 *         if callable(function_output.content_type):
 *             response.content_type = function_output.content_type(request=request, response=response)             # <<<<<<<<<<<<<<
 *         else:
 *             response.content_type = function_output.content_type
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_function_output)) { __Pyx_RaiseClosureNameError("function_output"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_function_output, __pyx_n_s_content_type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_request, __pyx_v_request) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_response, __pyx_v_response) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __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_4); __pyx_t_4 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_response, __pyx_n_s_content_type, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "hug/decorators.py":300
 * 
 *         api_version = int(api_version) if api_version is not None else api_version
 *         if callable(function_output.content_type):             # <<<<<<<<<<<<<<
 *             response.content_type = function_output.content_type(request=request, response=response)
 *         else:
 */
    goto __pyx_L7;
  }

  /* "hug/decorators.py":303
 *             response.content_type = function_output.content_type(request=request, response=response)
 *         else:
 *             response.content_type = function_output.content_type             # <<<<<<<<<<<<<<
 *         for requirement in requires:
 *             conclusion = requirement(response=response, request=request, module=module, api_version=api_version)
 */
  /*else*/ {
    if (unlikely(!__pyx_cur_scope->__pyx_v_function_output)) { __Pyx_RaiseClosureNameError("function_output"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_function_output, __pyx_n_s_content_type); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_response, __pyx_n_s_content_type, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_L7:;

  /* "hug/decorators.py":304
 *         else:
 *             response.content_type = function_output.content_type
 *         for requirement in requires:             # <<<<<<<<<<<<<<
 *             conclusion = requirement(response=response, request=request, module=module, api_version=api_version)
 *             if conclusion is not True:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_requires)) { __Pyx_RaiseClosureNameError("requires"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_requires)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_requires)) {
    __pyx_t_5 = __pyx_cur_scope->__pyx_v_requires; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_requires); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; 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);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; 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);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_7(__pyx_t_5);
      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 = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_requirement, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "hug/decorators.py":305
 *             response.content_type = function_output.content_type
 *         for requirement in requires:
 *             conclusion = requirement(response=response, request=request, module=module, api_version=api_version)             # <<<<<<<<<<<<<<
 *             if conclusion is not True:
 *                 if conclusion:
 */
    __pyx_t_4 = PyDict_New(); 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);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_response, __pyx_v_response) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_request, __pyx_v_request) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (unlikely(!__pyx_cur_scope->__pyx_v_module)) { __Pyx_RaiseClosureNameError("module"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_module, __pyx_cur_scope->__pyx_v_module) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_api_version, __pyx_v_api_version) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_requirement, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_conclusion, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "hug/decorators.py":306
 *         for requirement in requires:
 *             conclusion = requirement(response=response, request=request, module=module, api_version=api_version)
 *             if conclusion is not True:             # <<<<<<<<<<<<<<
 *                 if conclusion:
 *                     response.data = function_output(conclusion, **function_output_kwargs)
 */
    __pyx_t_3 = (__pyx_v_conclusion != Py_True);
    __pyx_t_1 = (__pyx_t_3 != 0);
    if (__pyx_t_1) {

      /* "hug/decorators.py":307
 *             conclusion = requirement(response=response, request=request, module=module, api_version=api_version)
 *             if conclusion is not True:
 *                 if conclusion:             # <<<<<<<<<<<<<<
 *                     response.data = function_output(conclusion, **function_output_kwargs)
 *                 return
 */
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_conclusion); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__pyx_t_1) {

        /* "hug/decorators.py":308
 *             if conclusion is not True:
 *                 if conclusion:
 *                     response.data = function_output(conclusion, **function_output_kwargs)             # <<<<<<<<<<<<<<
 *                 return
 * 
 */
        if (unlikely(!__pyx_cur_scope->__pyx_v_function_output)) { __Pyx_RaiseClosureNameError("function_output"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
        __pyx_t_2 = PyTuple_New(1); 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_v_conclusion);
        __Pyx_GIVEREF(__pyx_v_conclusion);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_conclusion);
        if (unlikely(__pyx_v_function_output_kwargs == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_function_output, __pyx_t_2, __pyx_v_function_output_kwargs); 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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_response, __pyx_n_s_data, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "hug/decorators.py":307
 *             conclusion = requirement(response=response, request=request, module=module, api_version=api_version)
 *             if conclusion is not True:
 *                 if conclusion:             # <<<<<<<<<<<<<<
 *                     response.data = function_output(conclusion, **function_output_kwargs)
 *                 return
 */
      }

      /* "hug/decorators.py":309
 *                 if conclusion:
 *                     response.data = function_output(conclusion, **function_output_kwargs)
 *                 return             # <<<<<<<<<<<<<<
 * 
 *         input_parameters = kwargs
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L0;

      /* "hug/decorators.py":306
 *         for requirement in requires:
 *             conclusion = requirement(response=response, request=request, module=module, api_version=api_version)
 *             if conclusion is not True:             # <<<<<<<<<<<<<<
 *                 if conclusion:
 *                     response.data = function_output(conclusion, **function_output_kwargs)
 */
    }

    /* "hug/decorators.py":304
 *         else:
 *             response.content_type = function_output.content_type
 *         for requirement in requires:             # <<<<<<<<<<<<<<
 *             conclusion = requirement(response=response, request=request, module=module, api_version=api_version)
 *             if conclusion is not True:
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "hug/decorators.py":311
 *                 return
 * 
 *         input_parameters = kwargs             # <<<<<<<<<<<<<<
 *         input_parameters.update(request.params)
 *         if parse_body and request.content_length is not None:
 */
  __Pyx_INCREF(__pyx_v_kwargs);
  __pyx_v_input_parameters = __pyx_v_kwargs;

  /* "hug/decorators.py":312
 * 
 *         input_parameters = kwargs
 *         input_parameters.update(request.params)             # <<<<<<<<<<<<<<
 *         if parse_body and request.content_length is not None:
 *             body = request.stream
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_input_parameters, __pyx_n_s_update); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_request, __pyx_n_s_params); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_8) {
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_5);
  } else {
    __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "hug/decorators.py":313
 *         input_parameters = kwargs
 *         input_parameters.update(request.params)
 *         if parse_body and request.content_length is not None:             # <<<<<<<<<<<<<<
 *             body = request.stream
 *             body_formatting_handler = body and module.__hug__.input_format(request.content_type)
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_parse_body)) { __Pyx_RaiseClosureNameError("parse_body"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_parse_body); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L13_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_request, __pyx_n_s_content_length); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = (__pyx_t_5 != Py_None);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_10 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_10;
  __pyx_L13_bool_binop_done:;
  if (__pyx_t_1) {

    /* "hug/decorators.py":314
 *         input_parameters.update(request.params)
 *         if parse_body and request.content_length is not None:
 *             body = request.stream             # <<<<<<<<<<<<<<
 *             body_formatting_handler = body and module.__hug__.input_format(request.content_type)
 *             if body_formatting_handler:
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_request, __pyx_n_s_stream); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_v_body = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "hug/decorators.py":315
 *         if parse_body and request.content_length is not None:
 *             body = request.stream
 *             body_formatting_handler = body and module.__hug__.input_format(request.content_type)             # <<<<<<<<<<<<<<
 *             if body_formatting_handler:
 *                 body = body_formatting_handler(body)
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_body); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_1) {
    } else {
      __Pyx_INCREF(__pyx_v_body);
      __pyx_t_5 = __pyx_v_body;
      goto __pyx_L15_bool_binop_done;
    }
    if (unlikely(!__pyx_cur_scope->__pyx_v_module)) { __Pyx_RaiseClosureNameError("module"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_module, __pyx_n_s_hug_3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_input_format_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_request, __pyx_n_s_content_type); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8); __pyx_t_8 = NULL;
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); 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);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = __pyx_t_4;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_L15_bool_binop_done:;
    __pyx_v_body_formatting_handler = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "hug/decorators.py":316
 *             body = request.stream
 *             body_formatting_handler = body and module.__hug__.input_format(request.content_type)
 *             if body_formatting_handler:             # <<<<<<<<<<<<<<
 *                 body = body_formatting_handler(body)
 *             if 'body' in accepted_parameters:
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_body_formatting_handler); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_1) {

      /* "hug/decorators.py":317
 *             body_formatting_handler = body and module.__hug__.input_format(request.content_type)
 *             if body_formatting_handler:
 *                 body = body_formatting_handler(body)             # <<<<<<<<<<<<<<
 *             if 'body' in accepted_parameters:
 *                 input_parameters['body'] = body
 */
      __Pyx_INCREF(__pyx_v_body_formatting_handler);
      __pyx_t_4 = __pyx_v_body_formatting_handler; __pyx_t_2 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_body); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2); __pyx_t_2 = NULL;
        __Pyx_INCREF(__pyx_v_body);
        __Pyx_GIVEREF(__pyx_v_body);
        PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_body);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_body, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "hug/decorators.py":316
 *             body = request.stream
 *             body_formatting_handler = body and module.__hug__.input_format(request.content_type)
 *             if body_formatting_handler:             # <<<<<<<<<<<<<<
 *                 body = body_formatting_handler(body)
 *             if 'body' in accepted_parameters:
 */
    }

    /* "hug/decorators.py":318
 *             if body_formatting_handler:
 *                 body = body_formatting_handler(body)
 *             if 'body' in accepted_parameters:             # <<<<<<<<<<<<<<
 *                 input_parameters['body'] = body
 *             if isinstance(body, dict):
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_accepted_parameters)) { __Pyx_RaiseClosureNameError("accepted_parameters"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_body, __pyx_cur_scope->__pyx_v_accepted_parameters, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = (__pyx_t_1 != 0);
    if (__pyx_t_10) {

      /* "hug/decorators.py":319
 *                 body = body_formatting_handler(body)
 *             if 'body' in accepted_parameters:
 *                 input_parameters['body'] = body             # <<<<<<<<<<<<<<
 *             if isinstance(body, dict):
 *                 input_parameters.update(body)
 */
      if (unlikely(PyDict_SetItem(__pyx_v_input_parameters, __pyx_n_s_body, __pyx_v_body) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "hug/decorators.py":318
 *             if body_formatting_handler:
 *                 body = body_formatting_handler(body)
 *             if 'body' in accepted_parameters:             # <<<<<<<<<<<<<<
 *                 input_parameters['body'] = body
 *             if isinstance(body, dict):
 */
    }

    /* "hug/decorators.py":320
 *             if 'body' in accepted_parameters:
 *                 input_parameters['body'] = body
 *             if isinstance(body, dict):             # <<<<<<<<<<<<<<
 *                 input_parameters.update(body)
 *         elif 'body' in accepted_parameters:
 */
    __pyx_t_10 = PyDict_Check(__pyx_v_body); 
    __pyx_t_1 = (__pyx_t_10 != 0);
    if (__pyx_t_1) {

      /* "hug/decorators.py":321
 *                 input_parameters['body'] = body
 *             if isinstance(body, dict):
 *                 input_parameters.update(body)             # <<<<<<<<<<<<<<
 *         elif 'body' in accepted_parameters:
 *             input_parameters['body'] = None
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_input_parameters, __pyx_n_s_update); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_11 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_11) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_body); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_11); __pyx_t_11 = NULL;
        __Pyx_INCREF(__pyx_v_body);
        __Pyx_GIVEREF(__pyx_v_body);
        PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_body);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __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_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "hug/decorators.py":320
 *             if 'body' in accepted_parameters:
 *                 input_parameters['body'] = body
 *             if isinstance(body, dict):             # <<<<<<<<<<<<<<
 *                 input_parameters.update(body)
 *         elif 'body' in accepted_parameters:
 */
    }

    /* "hug/decorators.py":313
 *         input_parameters = kwargs
 *         input_parameters.update(request.params)
 *         if parse_body and request.content_length is not None:             # <<<<<<<<<<<<<<
 *             body = request.stream
 *             body_formatting_handler = body and module.__hug__.input_format(request.content_type)
 */
    goto __pyx_L12;
  }

  /* "hug/decorators.py":322
 *             if isinstance(body, dict):
 *                 input_parameters.update(body)
 *         elif 'body' in accepted_parameters:             # <<<<<<<<<<<<<<
 *             input_parameters['body'] = None
 * 
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_accepted_parameters)) { __Pyx_RaiseClosureNameError("accepted_parameters"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_body, __pyx_cur_scope->__pyx_v_accepted_parameters, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = (__pyx_t_1 != 0);
  if (__pyx_t_10) {

    /* "hug/decorators.py":323
 *                 input_parameters.update(body)
 *         elif 'body' in accepted_parameters:
 *             input_parameters['body'] = None             # <<<<<<<<<<<<<<
 * 
 *         errors = {}
 */
    if (unlikely(PyDict_SetItem(__pyx_v_input_parameters, __pyx_n_s_body, Py_None) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "hug/decorators.py":322
 *             if isinstance(body, dict):
 *                 input_parameters.update(body)
 *         elif 'body' in accepted_parameters:             # <<<<<<<<<<<<<<
 *             input_parameters['body'] = None
 * 
 */
  }
  __pyx_L12:;

  /* "hug/decorators.py":325
 *             input_parameters['body'] = None
 * 
 *         errors = {}             # <<<<<<<<<<<<<<
 *         for key, type_handler in input_transformations.items():
 *             try:
 */
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_errors = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "hug/decorators.py":326
 * 
 *         errors = {}
 *         for key, type_handler in input_transformations.items():             # <<<<<<<<<<<<<<
 *             try:
 *                 if key in input_parameters:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_input_transformations)) { __Pyx_RaiseClosureNameError("input_transformations"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(__pyx_cur_scope->__pyx_v_input_transformations == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "items");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = __Pyx_PyDict_Items(__pyx_cur_scope->__pyx_v_input_transformations); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_7(__pyx_t_4);
      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 = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
      PyObject* sequence = __pyx_t_5;
      #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 = 326; __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_11 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_11 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_11);
      #else
      __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      #endif
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_9 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_12 = Py_TYPE(__pyx_t_9)->tp_iternext;
      index = 0; __pyx_t_2 = __pyx_t_12(__pyx_t_9); if (unlikely(!__pyx_t_2)) goto __pyx_L22_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      index = 1; __pyx_t_11 = __pyx_t_12(__pyx_t_9); if (unlikely(!__pyx_t_11)) goto __pyx_L22_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_11);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_9), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_12 = NULL;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L23_unpacking_done;
      __pyx_L22_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_12 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L23_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_type_handler, __pyx_t_11);
    __pyx_t_11 = 0;

    /* "hug/decorators.py":327
 *         errors = {}
 *         for key, type_handler in input_transformations.items():
 *             try:             # <<<<<<<<<<<<<<
 *                 if key in input_parameters:
 *                     input_parameters[key] = type_handler(input_parameters[key])
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_15);
      /*try:*/ {

        /* "hug/decorators.py":328
 *         for key, type_handler in input_transformations.items():
 *             try:
 *                 if key in input_parameters:             # <<<<<<<<<<<<<<
 *                     input_parameters[key] = type_handler(input_parameters[key])
 *             except InvalidTypeData as error:
 */
        __pyx_t_10 = (__Pyx_PyDict_ContainsTF(__pyx_v_key, __pyx_v_input_parameters, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
        __pyx_t_1 = (__pyx_t_10 != 0);
        if (__pyx_t_1) {

          /* "hug/decorators.py":329
 *             try:
 *                 if key in input_parameters:
 *                     input_parameters[key] = type_handler(input_parameters[key])             # <<<<<<<<<<<<<<
 *             except InvalidTypeData as error:
 *                 errors[key] = error.reasons or str(error.message)
 */
          __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_input_parameters, __pyx_v_key); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L24_error;};
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_INCREF(__pyx_v_type_handler);
          __pyx_t_2 = __pyx_v_type_handler; __pyx_t_9 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_9)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_9);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
            }
          }
          if (!__pyx_t_9) {
            __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_GOTREF(__pyx_t_5);
          } else {
            __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __pyx_t_9 = NULL;
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_11);
            __pyx_t_11 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(PyDict_SetItem(__pyx_v_input_parameters, __pyx_v_key, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "hug/decorators.py":328
 *         for key, type_handler in input_transformations.items():
 *             try:
 *                 if key in input_parameters:             # <<<<<<<<<<<<<<
 *                     input_parameters[key] = type_handler(input_parameters[key])
 *             except InvalidTypeData as error:
 */
        }

        /* "hug/decorators.py":327
 *         errors = {}
 *         for key, type_handler in input_transformations.items():
 *             try:             # <<<<<<<<<<<<<<
 *                 if key in input_parameters:
 *                     input_parameters[key] = type_handler(input_parameters[key])
 */
      }
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      goto __pyx_L31_try_end;
      __pyx_L24_error:;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "hug/decorators.py":330
 *                 if key in input_parameters:
 *                     input_parameters[key] = type_handler(input_parameters[key])
 *             except InvalidTypeData as error:             # <<<<<<<<<<<<<<
 *                 errors[key] = error.reasons or str(error.message)
 *             except Exception as error:
 */
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_InvalidTypeData); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_16 = PyErr_ExceptionMatches(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_16) {
        __Pyx_AddTraceback("hug.decorators._create_interface.interface", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_2, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_XDECREF_SET(__pyx_v_error, __pyx_t_2);

        /* "hug/decorators.py":331
 *                     input_parameters[key] = type_handler(input_parameters[key])
 *             except InvalidTypeData as error:
 *                 errors[key] = error.reasons or str(error.message)             # <<<<<<<<<<<<<<
 *             except Exception as error:
 *                 if hasattr(error, 'args') and error.args:
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_error, __pyx_n_s_reasons); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
        if (!__pyx_t_1) {
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        } else {
          __Pyx_INCREF(__pyx_t_9);
          __pyx_t_11 = __pyx_t_9;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L35_bool_binop_done;
        }
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_error, __pyx_n_s_message); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
        __Pyx_GOTREF(__pyx_t_17);
        __Pyx_GIVEREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_17, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_11 = __pyx_t_9;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_L35_bool_binop_done:;
        if (unlikely(PyDict_SetItem(__pyx_v_errors, __pyx_v_key, __pyx_t_11) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L25_exception_handled;
      }

      /* "hug/decorators.py":332
 *             except InvalidTypeData as error:
 *                 errors[key] = error.reasons or str(error.message)
 *             except Exception as error:             # <<<<<<<<<<<<<<
 *                 if hasattr(error, 'args') and error.args:
 *                     errors[key] = error.args[0]
 */
      __pyx_t_16 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
      if (__pyx_t_16) {
        __Pyx_AddTraceback("hug.decorators._create_interface.interface", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_2, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_XDECREF_SET(__pyx_v_error, __pyx_t_2);

        /* "hug/decorators.py":333
 *                 errors[key] = error.reasons or str(error.message)
 *             except Exception as error:
 *                 if hasattr(error, 'args') and error.args:             # <<<<<<<<<<<<<<
 *                     errors[key] = error.args[0]
 *                 else:
 */
        __pyx_t_10 = PyObject_HasAttr(__pyx_v_error, __pyx_n_s_args); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
        __pyx_t_3 = (__pyx_t_10 != 0);
        if (__pyx_t_3) {
        } else {
          __pyx_t_1 = __pyx_t_3;
          goto __pyx_L40_bool_binop_done;
        }
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_error, __pyx_n_s_args); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_1 = __pyx_t_3;
        __pyx_L40_bool_binop_done:;
        if (__pyx_t_1) {

          /* "hug/decorators.py":334
 *             except Exception as error:
 *                 if hasattr(error, 'args') and error.args:
 *                     errors[key] = error.args[0]             # <<<<<<<<<<<<<<
 *                 else:
 *                     errors[key] = str(error)
 */
          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_error, __pyx_n_s_args); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_11, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;};
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(PyDict_SetItem(__pyx_v_errors, __pyx_v_key, __pyx_t_9) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

          /* "hug/decorators.py":333
 *                 errors[key] = error.reasons or str(error.message)
 *             except Exception as error:
 *                 if hasattr(error, 'args') and error.args:             # <<<<<<<<<<<<<<
 *                     errors[key] = error.args[0]
 *                 else:
 */
          goto __pyx_L39;
        }

        /* "hug/decorators.py":336
 *                     errors[key] = error.args[0]
 *                 else:
 *                     errors[key] = str(error)             # <<<<<<<<<<<<<<
 * 
 *         if 'request' in accepted_parameters:
 */
        /*else*/ {
          __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_INCREF(__pyx_v_error);
          __Pyx_GIVEREF(__pyx_v_error);
          PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_error);
          __pyx_t_11 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_9, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(PyDict_SetItem(__pyx_v_errors, __pyx_v_key, __pyx_t_11) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
        __pyx_L39:;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L25_exception_handled;
      }
      goto __pyx_L26_except_error;
      __pyx_L26_except_error:;

      /* "hug/decorators.py":327
 *         errors = {}
 *         for key, type_handler in input_transformations.items():
 *             try:             # <<<<<<<<<<<<<<
 *                 if key in input_parameters:
 *                     input_parameters[key] = type_handler(input_parameters[key])
 */
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_XGIVEREF(__pyx_t_15);
      __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
      goto __pyx_L1_error;
      __pyx_L25_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_XGIVEREF(__pyx_t_15);
      __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
      __pyx_L31_try_end:;
    }

    /* "hug/decorators.py":326
 * 
 *         errors = {}
 *         for key, type_handler in input_transformations.items():             # <<<<<<<<<<<<<<
 *             try:
 *                 if key in input_parameters:
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "hug/decorators.py":338
 *                     errors[key] = str(error)
 * 
 *         if 'request' in accepted_parameters:             # <<<<<<<<<<<<<<
 *             input_parameters['request'] = request
 *         if 'response' in accepted_parameters:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_accepted_parameters)) { __Pyx_RaiseClosureNameError("accepted_parameters"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_request, __pyx_cur_scope->__pyx_v_accepted_parameters, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "hug/decorators.py":339
 * 
 *         if 'request' in accepted_parameters:
 *             input_parameters['request'] = request             # <<<<<<<<<<<<<<
 *         if 'response' in accepted_parameters:
 *             input_parameters['response'] = response
 */
    if (unlikely(PyDict_SetItem(__pyx_v_input_parameters, __pyx_n_s_request, __pyx_v_request) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "hug/decorators.py":338
 *                     errors[key] = str(error)
 * 
 *         if 'request' in accepted_parameters:             # <<<<<<<<<<<<<<
 *             input_parameters['request'] = request
 *         if 'response' in accepted_parameters:
 */
  }

  /* "hug/decorators.py":340
 *         if 'request' in accepted_parameters:
 *             input_parameters['request'] = request
 *         if 'response' in accepted_parameters:             # <<<<<<<<<<<<<<
 *             input_parameters['response'] = response
 *         if 'api_version' in accepted_parameters:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_accepted_parameters)) { __Pyx_RaiseClosureNameError("accepted_parameters"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_response, __pyx_cur_scope->__pyx_v_accepted_parameters, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = (__pyx_t_3 != 0);
  if (__pyx_t_1) {

    /* "hug/decorators.py":341
 *             input_parameters['request'] = request
 *         if 'response' in accepted_parameters:
 *             input_parameters['response'] = response             # <<<<<<<<<<<<<<
 *         if 'api_version' in accepted_parameters:
 *             input_parameters['api_version'] = api_version
 */
    if (unlikely(PyDict_SetItem(__pyx_v_input_parameters, __pyx_n_s_response, __pyx_v_response) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "hug/decorators.py":340
 *         if 'request' in accepted_parameters:
 *             input_parameters['request'] = request
 *         if 'response' in accepted_parameters:             # <<<<<<<<<<<<<<
 *             input_parameters['response'] = response
 *         if 'api_version' in accepted_parameters:
 */
  }

  /* "hug/decorators.py":342
 *         if 'response' in accepted_parameters:
 *             input_parameters['response'] = response
 *         if 'api_version' in accepted_parameters:             # <<<<<<<<<<<<<<
 *             input_parameters['api_version'] = api_version
 *         for parameter, directive in named_directives.items():
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_accepted_parameters)) { __Pyx_RaiseClosureNameError("accepted_parameters"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_api_version, __pyx_cur_scope->__pyx_v_accepted_parameters, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "hug/decorators.py":343
 *             input_parameters['response'] = response
 *         if 'api_version' in accepted_parameters:
 *             input_parameters['api_version'] = api_version             # <<<<<<<<<<<<<<
 *         for parameter, directive in named_directives.items():
 *             arguments = (defaults[parameter], ) if parameter in defaults else ()
 */
    if (unlikely(PyDict_SetItem(__pyx_v_input_parameters, __pyx_n_s_api_version, __pyx_v_api_version) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "hug/decorators.py":342
 *         if 'response' in accepted_parameters:
 *             input_parameters['response'] = response
 *         if 'api_version' in accepted_parameters:             # <<<<<<<<<<<<<<
 *             input_parameters['api_version'] = api_version
 *         for parameter, directive in named_directives.items():
 */
  }

  /* "hug/decorators.py":344
 *         if 'api_version' in accepted_parameters:
 *             input_parameters['api_version'] = api_version
 *         for parameter, directive in named_directives.items():             # <<<<<<<<<<<<<<
 *             arguments = (defaults[parameter], ) if parameter in defaults else ()
 *             input_parameters[parameter] = directive(*arguments, response=response, request=request,  module=module,
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_named_directives)) { __Pyx_RaiseClosureNameError("named_directives"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(__pyx_cur_scope->__pyx_v_named_directives == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "items");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = __Pyx_PyDict_Items(__pyx_cur_scope->__pyx_v_named_directives); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_7(__pyx_t_5);
      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 = 344; __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 = 344; __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_8 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_8 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_8);
      #else
      __pyx_t_2 = PySequence_ITEM(sequence, 0); 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_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_11 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
      index = 0; __pyx_t_2 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_2)) goto __pyx_L47_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      index = 1; __pyx_t_8 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_8)) goto __pyx_L47_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_8);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_12 = NULL;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L48_unpacking_done;
      __pyx_L47_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_12 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L48_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_parameter, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_directive, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "hug/decorators.py":345
 *             input_parameters['api_version'] = api_version
 *         for parameter, directive in named_directives.items():
 *             arguments = (defaults[parameter], ) if parameter in defaults else ()             # <<<<<<<<<<<<<<
 *             input_parameters[parameter] = directive(*arguments, response=response, request=request,  module=module,
 *                                                     api_version=api_version)
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_defaults)) { __Pyx_RaiseClosureNameError("defaults"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_parameter, __pyx_cur_scope->__pyx_v_defaults, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if ((__pyx_t_3 != 0)) {
      if (unlikely(!__pyx_cur_scope->__pyx_v_defaults)) { __Pyx_RaiseClosureNameError("defaults"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
      __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_defaults, __pyx_v_parameter); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __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 = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_4 = __pyx_t_2;
      __pyx_t_2 = 0;
    } else {
      __Pyx_INCREF(__pyx_empty_tuple);
      __pyx_t_4 = __pyx_empty_tuple;
    }
    __Pyx_XDECREF_SET(__pyx_v_arguments, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "hug/decorators.py":346
 *         for parameter, directive in named_directives.items():
 *             arguments = (defaults[parameter], ) if parameter in defaults else ()
 *             input_parameters[parameter] = directive(*arguments, response=response, request=request,  module=module,             # <<<<<<<<<<<<<<
 *                                                     api_version=api_version)
 *         for require in required:
 */
    if (unlikely(__pyx_v_arguments == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_response, __pyx_v_response) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_request, __pyx_v_request) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (unlikely(!__pyx_cur_scope->__pyx_v_module)) { __Pyx_RaiseClosureNameError("module"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_module, __pyx_cur_scope->__pyx_v_module) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "hug/decorators.py":347
 *             arguments = (defaults[parameter], ) if parameter in defaults else ()
 *             input_parameters[parameter] = directive(*arguments, response=response, request=request,  module=module,
 *                                                     api_version=api_version)             # <<<<<<<<<<<<<<
 *         for require in required:
 *             if not require in input_parameters:
 */
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_api_version, __pyx_v_api_version) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "hug/decorators.py":346
 *         for parameter, directive in named_directives.items():
 *             arguments = (defaults[parameter], ) if parameter in defaults else ()
 *             input_parameters[parameter] = directive(*arguments, response=response, request=request,  module=module,             # <<<<<<<<<<<<<<
 *                                                     api_version=api_version)
 *         for require in required:
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_directive, __pyx_v_arguments, __pyx_t_4); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(PyDict_SetItem(__pyx_v_input_parameters, __pyx_v_parameter, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "hug/decorators.py":344
 *         if 'api_version' in accepted_parameters:
 *             input_parameters['api_version'] = api_version
 *         for parameter, directive in named_directives.items():             # <<<<<<<<<<<<<<
 *             arguments = (defaults[parameter], ) if parameter in defaults else ()
 *             input_parameters[parameter] = directive(*arguments, response=response, request=request,  module=module,
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "hug/decorators.py":348
 *             input_parameters[parameter] = directive(*arguments, response=response, request=request,  module=module,
 *                                                     api_version=api_version)
 *         for require in required:             # <<<<<<<<<<<<<<
 *             if not require in input_parameters:
 *                 errors[require] = "Required parameter not supplied"
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_required)) { __Pyx_RaiseClosureNameError("required"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_required)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_required)) {
    __pyx_t_5 = __pyx_cur_scope->__pyx_v_required; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_required); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_7(__pyx_t_5);
      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 = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_require, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "hug/decorators.py":349
 *                                                     api_version=api_version)
 *         for require in required:
 *             if not require in input_parameters:             # <<<<<<<<<<<<<<
 *                 errors[require] = "Required parameter not supplied"
 *         if errors:
 */
    __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_v_require, __pyx_v_input_parameters, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = (__pyx_t_3 != 0);
    if (__pyx_t_1) {

      /* "hug/decorators.py":350
 *         for require in required:
 *             if not require in input_parameters:
 *                 errors[require] = "Required parameter not supplied"             # <<<<<<<<<<<<<<
 *         if errors:
 *             response.data = function_output({"errors": errors}, **function_output_kwargs)
 */
      if (unlikely(PyDict_SetItem(__pyx_v_errors, __pyx_v_require, __pyx_kp_s_Required_parameter_not_supplied) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "hug/decorators.py":349
 *                                                     api_version=api_version)
 *         for require in required:
 *             if not require in input_parameters:             # <<<<<<<<<<<<<<
 *                 errors[require] = "Required parameter not supplied"
 *         if errors:
 */
    }

    /* "hug/decorators.py":348
 *             input_parameters[parameter] = directive(*arguments, response=response, request=request,  module=module,
 *                                                     api_version=api_version)
 *         for require in required:             # <<<<<<<<<<<<<<
 *             if not require in input_parameters:
 *                 errors[require] = "Required parameter not supplied"
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "hug/decorators.py":351
 *             if not require in input_parameters:
 *                 errors[require] = "Required parameter not supplied"
 *         if errors:             # <<<<<<<<<<<<<<
 *             response.data = function_output({"errors": errors}, **function_output_kwargs)
 *             response.status = HTTP_BAD_REQUEST
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_errors); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "hug/decorators.py":352
 *                 errors[require] = "Required parameter not supplied"
 *         if errors:
 *             response.data = function_output({"errors": errors}, **function_output_kwargs)             # <<<<<<<<<<<<<<
 *             response.status = HTTP_BAD_REQUEST
 *             return
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_function_output)) { __Pyx_RaiseClosureNameError("function_output"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_errors, __pyx_v_errors) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    if (unlikely(__pyx_v_function_output_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_function_output, __pyx_t_2, __pyx_v_function_output_kwargs); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_response, __pyx_n_s_data, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "hug/decorators.py":353
 *         if errors:
 *             response.data = function_output({"errors": errors}, **function_output_kwargs)
 *             response.status = HTTP_BAD_REQUEST             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_HTTP_BAD_REQUEST); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_response, __pyx_n_s_status, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "hug/decorators.py":354
 *             response.data = function_output({"errors": errors}, **function_output_kwargs)
 *             response.status = HTTP_BAD_REQUEST
 *             return             # <<<<<<<<<<<<<<
 * 
 *         if not takes_kwargs:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "hug/decorators.py":351
 *             if not require in input_parameters:
 *                 errors[require] = "Required parameter not supplied"
 *         if errors:             # <<<<<<<<<<<<<<
 *             response.data = function_output({"errors": errors}, **function_output_kwargs)
 *             response.status = HTTP_BAD_REQUEST
 */
  }

  /* "hug/decorators.py":356
 *             return
 * 
 *         if not takes_kwargs:             # <<<<<<<<<<<<<<
 *             input_parameters = {key: value for key, value in input_parameters.items() if key in accepted_parameters}
 * 
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_takes_kwargs)) { __Pyx_RaiseClosureNameError("takes_kwargs"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_takes_kwargs); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((!__pyx_t_1) != 0);
  if (__pyx_t_3) {

    /* "hug/decorators.py":357
 * 
 *         if not takes_kwargs:
 *             input_parameters = {key: value for key, value in input_parameters.items() if key in accepted_parameters}             # <<<<<<<<<<<<<<
 * 
 *         to_return = api_function(**input_parameters)
 */
    { /* enter inner scope */
      PyObject *__pyx_8genexpr2__pyx_v_key = NULL;
      PyObject *__pyx_8genexpr2__pyx_v_value = NULL;
      __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = __Pyx_PyDict_Items(__pyx_v_input_parameters); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
      __Pyx_GOTREF(__pyx_t_2);
      if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
        __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
        __pyx_t_7 = NULL;
      } else {
        __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      for (;;) {
        if (likely(!__pyx_t_7)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          } else {
            if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          }
        } else {
          __pyx_t_2 = __pyx_t_7(__pyx_t_4);
          if (unlikely(!__pyx_t_2)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_2);
        }
        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 = 357; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
          }
          #if CYTHON_COMPILING_IN_CPYTHON
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_11 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_11);
          #else
          __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
          __Pyx_GOTREF(__pyx_t_11);
          #endif
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_12 = Py_TYPE(__pyx_t_9)->tp_iternext;
          index = 0; __pyx_t_8 = __pyx_t_12(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L59_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_8);
          index = 1; __pyx_t_11 = __pyx_t_12(__pyx_t_9); if (unlikely(!__pyx_t_11)) goto __pyx_L59_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_11);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_9), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
          __pyx_t_12 = NULL;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L60_unpacking_done;
          __pyx_L59_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_12 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
          __pyx_L60_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_key, __pyx_t_8);
        __pyx_t_8 = 0;
        __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_value, __pyx_t_11);
        __pyx_t_11 = 0;
        if (unlikely(!__pyx_cur_scope->__pyx_v_accepted_parameters)) { __Pyx_RaiseClosureNameError("accepted_parameters"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L56_error;} }
        __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_8genexpr2__pyx_v_key, __pyx_cur_scope->__pyx_v_accepted_parameters, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
        __pyx_t_1 = (__pyx_t_3 != 0);
        if (__pyx_t_1) {
          if (unlikely(PyDict_SetItem(__pyx_t_5, (PyObject*)__pyx_8genexpr2__pyx_v_key, (PyObject*)__pyx_8genexpr2__pyx_v_value))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
        }
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_key);
      __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_value);
      goto __pyx_L62_exit_scope;
      __pyx_L56_error:;
      __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_key);
      __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_value);
      goto __pyx_L1_error;
      __pyx_L62_exit_scope:;
    } /* exit inner scope */
    __Pyx_DECREF_SET(__pyx_v_input_parameters, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "hug/decorators.py":356
 *             return
 * 
 *         if not takes_kwargs:             # <<<<<<<<<<<<<<
 *             input_parameters = {key: value for key, value in input_parameters.items() if key in accepted_parameters}
 * 
 */
  }

  /* "hug/decorators.py":359
 *             input_parameters = {key: value for key, value in input_parameters.items() if key in accepted_parameters}
 * 
 *         to_return = api_function(**input_parameters)             # <<<<<<<<<<<<<<
 *         if transform and not (isinstance(transform, type) and isinstance(to_return, transform)):
 *             if transform_args:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_api_function)) { __Pyx_RaiseClosureNameError("api_function"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_api_function, __pyx_empty_tuple, __pyx_v_input_parameters); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_to_return = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "hug/decorators.py":360
 * 
 *         to_return = api_function(**input_parameters)
 *         if transform and not (isinstance(transform, type) and isinstance(to_return, transform)):             # <<<<<<<<<<<<<<
 *             if transform_args:
 *                 extra_kwargs = {}
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_transform)) { __Pyx_RaiseClosureNameError("transform"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_transform); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L64_bool_binop_done;
  }
  if (unlikely(!__pyx_cur_scope->__pyx_v_transform)) { __Pyx_RaiseClosureNameError("transform"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_5 = __pyx_cur_scope->__pyx_v_transform;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_10 = PyType_Check(__pyx_t_5); 
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_18 = (__pyx_t_10 != 0);
  if (__pyx_t_18) {
  } else {
    __pyx_t_3 = __pyx_t_18;
    goto __pyx_L66_bool_binop_done;
  }
  if (unlikely(!__pyx_cur_scope->__pyx_v_transform)) { __Pyx_RaiseClosureNameError("transform"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_5 = __pyx_cur_scope->__pyx_v_transform;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_18 = PyObject_IsInstance(__pyx_v_to_return, __pyx_t_5); if (unlikely(__pyx_t_18 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_10 = (__pyx_t_18 != 0);
  __pyx_t_3 = __pyx_t_10;
  __pyx_L66_bool_binop_done:;
  __pyx_t_10 = ((!__pyx_t_3) != 0);
  __pyx_t_1 = __pyx_t_10;
  __pyx_L64_bool_binop_done:;
  if (__pyx_t_1) {

    /* "hug/decorators.py":361
 *         to_return = api_function(**input_parameters)
 *         if transform and not (isinstance(transform, type) and isinstance(to_return, transform)):
 *             if transform_args:             # <<<<<<<<<<<<<<
 *                 extra_kwargs = {}
 *                 if 'response' in transform_args:
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_transform_args)) { __Pyx_RaiseClosureNameError("transform_args"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_transform_args); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_1) {

      /* "hug/decorators.py":362
 *         if transform and not (isinstance(transform, type) and isinstance(to_return, transform)):
 *             if transform_args:
 *                 extra_kwargs = {}             # <<<<<<<<<<<<<<
 *                 if 'response' in transform_args:
 *                     extra_kwargs['response'] = response
 */
      __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_v_extra_kwargs = ((PyObject*)__pyx_t_5);
      __pyx_t_5 = 0;

      /* "hug/decorators.py":363
 *             if transform_args:
 *                 extra_kwargs = {}
 *                 if 'response' in transform_args:             # <<<<<<<<<<<<<<
 *                     extra_kwargs['response'] = response
 *                 if 'request' in transform_args:
 */
      if (unlikely(!__pyx_cur_scope->__pyx_v_transform_args)) { __Pyx_RaiseClosureNameError("transform_args"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
      __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_response, __pyx_cur_scope->__pyx_v_transform_args, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_10 = (__pyx_t_1 != 0);
      if (__pyx_t_10) {

        /* "hug/decorators.py":364
 *                 extra_kwargs = {}
 *                 if 'response' in transform_args:
 *                     extra_kwargs['response'] = response             # <<<<<<<<<<<<<<
 *                 if 'request' in transform_args:
 *                     extra_kwargs['request'] = request
 */
        if (unlikely(PyDict_SetItem(__pyx_v_extra_kwargs, __pyx_n_s_response, __pyx_v_response) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "hug/decorators.py":363
 *             if transform_args:
 *                 extra_kwargs = {}
 *                 if 'response' in transform_args:             # <<<<<<<<<<<<<<
 *                     extra_kwargs['response'] = response
 *                 if 'request' in transform_args:
 */
      }

      /* "hug/decorators.py":365
 *                 if 'response' in transform_args:
 *                     extra_kwargs['response'] = response
 *                 if 'request' in transform_args:             # <<<<<<<<<<<<<<
 *                     extra_kwargs['request'] = request
 *                 to_return = transform(to_return, **extra_kwargs)
 */
      if (unlikely(!__pyx_cur_scope->__pyx_v_transform_args)) { __Pyx_RaiseClosureNameError("transform_args"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
      __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_request, __pyx_cur_scope->__pyx_v_transform_args, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_1 = (__pyx_t_10 != 0);
      if (__pyx_t_1) {

        /* "hug/decorators.py":366
 *                     extra_kwargs['response'] = response
 *                 if 'request' in transform_args:
 *                     extra_kwargs['request'] = request             # <<<<<<<<<<<<<<
 *                 to_return = transform(to_return, **extra_kwargs)
 *             else:
 */
        if (unlikely(PyDict_SetItem(__pyx_v_extra_kwargs, __pyx_n_s_request, __pyx_v_request) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "hug/decorators.py":365
 *                 if 'response' in transform_args:
 *                     extra_kwargs['response'] = response
 *                 if 'request' in transform_args:             # <<<<<<<<<<<<<<
 *                     extra_kwargs['request'] = request
 *                 to_return = transform(to_return, **extra_kwargs)
 */
      }

      /* "hug/decorators.py":367
 *                 if 'request' in transform_args:
 *                     extra_kwargs['request'] = request
 *                 to_return = transform(to_return, **extra_kwargs)             # <<<<<<<<<<<<<<
 *             else:
 *                 to_return = transform(to_return)
 */
      if (unlikely(!__pyx_cur_scope->__pyx_v_transform)) { __Pyx_RaiseClosureNameError("transform"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_to_return);
      __Pyx_GIVEREF(__pyx_v_to_return);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_to_return);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_transform, __pyx_t_5, __pyx_v_extra_kwargs); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_to_return, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "hug/decorators.py":361
 *         to_return = api_function(**input_parameters)
 *         if transform and not (isinstance(transform, type) and isinstance(to_return, transform)):
 *             if transform_args:             # <<<<<<<<<<<<<<
 *                 extra_kwargs = {}
 *                 if 'response' in transform_args:
 */
      goto __pyx_L68;
    }

    /* "hug/decorators.py":369
 *                 to_return = transform(to_return, **extra_kwargs)
 *             else:
 *                 to_return = transform(to_return)             # <<<<<<<<<<<<<<
 * 
 *         to_return = function_output(to_return, **function_output_kwargs)
 */
    /*else*/ {
      if (unlikely(!__pyx_cur_scope->__pyx_v_transform)) { __Pyx_RaiseClosureNameError("transform"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_transform);
      __pyx_t_5 = __pyx_cur_scope->__pyx_v_transform; __pyx_t_2 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_to_return); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2); __pyx_t_2 = NULL;
        __Pyx_INCREF(__pyx_v_to_return);
        __Pyx_GIVEREF(__pyx_v_to_return);
        PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_to_return);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_to_return, __pyx_t_4);
      __pyx_t_4 = 0;
    }
    __pyx_L68:;

    /* "hug/decorators.py":360
 * 
 *         to_return = api_function(**input_parameters)
 *         if transform and not (isinstance(transform, type) and isinstance(to_return, transform)):             # <<<<<<<<<<<<<<
 *             if transform_args:
 *                 extra_kwargs = {}
 */
  }

  /* "hug/decorators.py":371
 *                 to_return = transform(to_return)
 * 
 *         to_return = function_output(to_return, **function_output_kwargs)             # <<<<<<<<<<<<<<
 *         if hasattr(to_return, 'read'):
 *             size = None
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_function_output)) { __Pyx_RaiseClosureNameError("function_output"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_to_return);
  __Pyx_GIVEREF(__pyx_v_to_return);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_to_return);
  if (unlikely(__pyx_v_function_output_kwargs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_function_output, __pyx_t_4, __pyx_v_function_output_kwargs); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF_SET(__pyx_v_to_return, __pyx_t_5);
  __pyx_t_5 = 0;

  /* "hug/decorators.py":372
 * 
 *         to_return = function_output(to_return, **function_output_kwargs)
 *         if hasattr(to_return, 'read'):             # <<<<<<<<<<<<<<
 *             size = None
 *             if hasattr(to_return, 'name') and os.path.isfile(to_return.name):
 */
  __pyx_t_1 = PyObject_HasAttr(__pyx_v_to_return, __pyx_n_s_read); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = (__pyx_t_1 != 0);
  if (__pyx_t_10) {

    /* "hug/decorators.py":373
 *         to_return = function_output(to_return, **function_output_kwargs)
 *         if hasattr(to_return, 'read'):
 *             size = None             # <<<<<<<<<<<<<<
 *             if hasattr(to_return, 'name') and os.path.isfile(to_return.name):
 *                 size = os.path.getsize(to_return.name)
 */
    __Pyx_INCREF(Py_None);
    __pyx_v_size = Py_None;

    /* "hug/decorators.py":374
 *         if hasattr(to_return, 'read'):
 *             size = None
 *             if hasattr(to_return, 'name') and os.path.isfile(to_return.name):             # <<<<<<<<<<<<<<
 *                 size = os.path.getsize(to_return.name)
 *             if request.range and size:
 */
    __pyx_t_1 = PyObject_HasAttr(__pyx_v_to_return, __pyx_n_s_name); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = (__pyx_t_1 != 0);
    if (__pyx_t_3) {
    } else {
      __pyx_t_10 = __pyx_t_3;
      goto __pyx_L73_bool_binop_done;
    }
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_isfile); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_to_return, __pyx_n_s_name); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_2) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_11); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); __pyx_t_2 = NULL;
      __Pyx_GIVEREF(__pyx_t_11);
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_11);
      __pyx_t_11 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_10 = __pyx_t_3;
    __pyx_L73_bool_binop_done:;
    if (__pyx_t_10) {

      /* "hug/decorators.py":375
 *             size = None
 *             if hasattr(to_return, 'name') and os.path.isfile(to_return.name):
 *                 size = os.path.getsize(to_return.name)             # <<<<<<<<<<<<<<
 *             if request.range and size:
 *                 start, end = request.range
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_getsize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_to_return, __pyx_n_s_name); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_11 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_11) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_11); __pyx_t_11 = NULL;
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __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_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_size, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "hug/decorators.py":374
 *         if hasattr(to_return, 'read'):
 *             size = None
 *             if hasattr(to_return, 'name') and os.path.isfile(to_return.name):             # <<<<<<<<<<<<<<
 *                 size = os.path.getsize(to_return.name)
 *             if request.range and size:
 */
    }

    /* "hug/decorators.py":376
 *             if hasattr(to_return, 'name') and os.path.isfile(to_return.name):
 *                 size = os.path.getsize(to_return.name)
 *             if request.range and size:             # <<<<<<<<<<<<<<
 *                 start, end = request.range
 *                 if end < 0:
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_request, __pyx_n_s_range); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_3) {
    } else {
      __pyx_t_10 = __pyx_t_3;
      goto __pyx_L76_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_size); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = __pyx_t_3;
    __pyx_L76_bool_binop_done:;
    if (__pyx_t_10) {

      /* "hug/decorators.py":377
 *                 size = os.path.getsize(to_return.name)
 *             if request.range and size:
 *                 start, end = request.range             # <<<<<<<<<<<<<<
 *                 if end < 0:
 *                     end = size + end
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_request, __pyx_n_s_range); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
        PyObject* sequence = __pyx_t_5;
        #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 = 377; __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_2 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_2);
        #else
        __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        #endif
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_12 = Py_TYPE(__pyx_t_8)->tp_iternext;
        index = 0; __pyx_t_4 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L78_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_4);
        index = 1; __pyx_t_2 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L78_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_2);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_12 = NULL;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L79_unpacking_done;
        __pyx_L78_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_12 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L79_unpacking_done:;
      }
      __pyx_v_start = __pyx_t_4;
      __pyx_t_4 = 0;
      __pyx_v_end = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "hug/decorators.py":378
 *             if request.range and size:
 *                 start, end = request.range
 *                 if end < 0:             # <<<<<<<<<<<<<<
 *                     end = size + end
 *                 end = min(end, size)
 */
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_end, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_10) {

        /* "hug/decorators.py":379
 *                 start, end = request.range
 *                 if end < 0:
 *                     end = size + end             # <<<<<<<<<<<<<<
 *                 end = min(end, size)
 *                 length = end - start + 1
 */
        __pyx_t_5 = PyNumber_Add(__pyx_v_size, __pyx_v_end); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF_SET(__pyx_v_end, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "hug/decorators.py":378
 *             if request.range and size:
 *                 start, end = request.range
 *                 if end < 0:             # <<<<<<<<<<<<<<
 *                     end = size + end
 *                 end = min(end, size)
 */
      }

      /* "hug/decorators.py":380
 *                 if end < 0:
 *                     end = size + end
 *                 end = min(end, size)             # <<<<<<<<<<<<<<
 *                 length = end - start + 1
 *                 to_return.seek(start)
 */
      __Pyx_INCREF(__pyx_v_size);
      __pyx_t_5 = __pyx_v_size;
      __Pyx_INCREF(__pyx_v_end);
      __pyx_t_2 = __pyx_v_end;
      __pyx_t_8 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (__pyx_t_10) {
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_4 = __pyx_t_5;
      } else {
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_4 = __pyx_t_2;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __pyx_t_4;
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_end, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "hug/decorators.py":381
 *                     end = size + end
 *                 end = min(end, size)
 *                 length = end - start + 1             # <<<<<<<<<<<<<<
 *                 to_return.seek(start)
 *                 response.data = to_return.read(length)
 */
      __pyx_t_5 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_5, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_length = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "hug/decorators.py":382
 *                 end = min(end, size)
 *                 length = end - start + 1
 *                 to_return.seek(start)             # <<<<<<<<<<<<<<
 *                 response.data = to_return.read(length)
 *                 response.status = falcon.HTTP_206
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_to_return, __pyx_n_s_seek); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_start); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); __pyx_t_2 = NULL;
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_start);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "hug/decorators.py":383
 *                 length = end - start + 1
 *                 to_return.seek(start)
 *                 response.data = to_return.read(length)             # <<<<<<<<<<<<<<
 *                 response.status = falcon.HTTP_206
 *                 response.content_range = (start, end, size)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_to_return, __pyx_n_s_read); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (!__pyx_t_8) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_length);
        __Pyx_GIVEREF(__pyx_v_length);
        PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_length);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __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_5); __pyx_t_5 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_response, __pyx_n_s_data, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "hug/decorators.py":384
 *                 to_return.seek(start)
 *                 response.data = to_return.read(length)
 *                 response.status = falcon.HTTP_206             # <<<<<<<<<<<<<<
 *                 response.content_range = (start, end, size)
 *                 to_return.close()
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_falcon); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_HTTP_206); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_response, __pyx_n_s_status, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "hug/decorators.py":385
 *                 response.data = to_return.read(length)
 *                 response.status = falcon.HTTP_206
 *                 response.content_range = (start, end, size)             # <<<<<<<<<<<<<<
 *                 to_return.close()
 *             else:
 */
      __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_start);
      __Pyx_GIVEREF(__pyx_v_start);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_start);
      __Pyx_INCREF(__pyx_v_end);
      __Pyx_GIVEREF(__pyx_v_end);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_end);
      __Pyx_INCREF(__pyx_v_size);
      __Pyx_GIVEREF(__pyx_v_size);
      PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_size);
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_response, __pyx_n_s_content_range, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "hug/decorators.py":386
 *                 response.status = falcon.HTTP_206
 *                 response.content_range = (start, end, size)
 *                 to_return.close()             # <<<<<<<<<<<<<<
 *             else:
 *                 response.stream = to_return
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_to_return, __pyx_n_s_close); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (__pyx_t_2) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else {
        __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __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;

      /* "hug/decorators.py":376
 *             if hasattr(to_return, 'name') and os.path.isfile(to_return.name):
 *                 size = os.path.getsize(to_return.name)
 *             if request.range and size:             # <<<<<<<<<<<<<<
 *                 start, end = request.range
 *                 if end < 0:
 */
      goto __pyx_L75;
    }

    /* "hug/decorators.py":388
 *                 to_return.close()
 *             else:
 *                 response.stream = to_return             # <<<<<<<<<<<<<<
 *                 if size:
 *                     response.stream_len = size
 */
    /*else*/ {
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_response, __pyx_n_s_stream, __pyx_v_to_return) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "hug/decorators.py":389
 *             else:
 *                 response.stream = to_return
 *                 if size:             # <<<<<<<<<<<<<<
 *                     response.stream_len = size
 *         else:
 */
      __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_size); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__pyx_t_10) {

        /* "hug/decorators.py":390
 *                 response.stream = to_return
 *                 if size:
 *                     response.stream_len = size             # <<<<<<<<<<<<<<
 *         else:
 *             response.data = to_return
 */
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_response, __pyx_n_s_stream_len, __pyx_v_size) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "hug/decorators.py":389
 *             else:
 *                 response.stream = to_return
 *                 if size:             # <<<<<<<<<<<<<<
 *                     response.stream_len = size
 *         else:
 */
      }
    }
    __pyx_L75:;

    /* "hug/decorators.py":372
 * 
 *         to_return = function_output(to_return, **function_output_kwargs)
 *         if hasattr(to_return, 'read'):             # <<<<<<<<<<<<<<
 *             size = None
 *             if hasattr(to_return, 'name') and os.path.isfile(to_return.name):
 */
    goto __pyx_L71;
  }

  /* "hug/decorators.py":392
 *                     response.stream_len = size
 *         else:
 *             response.data = to_return             # <<<<<<<<<<<<<<
 * 
 *     if versions:
 */
  /*else*/ {
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_response, __pyx_n_s_data, __pyx_v_to_return) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L71:;

  /* "hug/decorators.py":286
 *         input_transformations[name] = transformer
 * 
 *     def interface(request, response, api_version=None, **kwargs):             # <<<<<<<<<<<<<<
 *         if set_status:
 *             response.status = set_status
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("hug.decorators._create_interface.interface", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_function_output_kwargs);
  __Pyx_XDECREF(__pyx_v_requirement);
  __Pyx_XDECREF(__pyx_v_conclusion);
  __Pyx_XDECREF(__pyx_v_input_parameters);
  __Pyx_XDECREF(__pyx_v_body);
  __Pyx_XDECREF(__pyx_v_body_formatting_handler);
  __Pyx_XDECREF(__pyx_v_errors);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_type_handler);
  __Pyx_XDECREF(__pyx_v_error);
  __Pyx_XDECREF(__pyx_v_parameter);
  __Pyx_XDECREF(__pyx_v_directive);
  __Pyx_XDECREF(__pyx_v_arguments);
  __Pyx_XDECREF(__pyx_v_require);
  __Pyx_XDECREF(__pyx_v_to_return);
  __Pyx_XDECREF(__pyx_v_extra_kwargs);
  __Pyx_XDECREF(__pyx_v_size);
  __Pyx_XDECREF(__pyx_v_start);
  __Pyx_XDECREF(__pyx_v_end);
  __Pyx_XDECREF(__pyx_v_length);
  __Pyx_XDECREF(__pyx_v_api_version);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":400
 *     if named_directives and not getattr(api_function, 'without_directives', None):
 *         @wraps(api_function)
 *         def callable_method(*args, **kwargs):             # <<<<<<<<<<<<<<
 *             for parameter, directive in named_directives.items():
 *                 if parameter in kwargs:
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_17_create_interface_3callable_method(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3hug_10decorators_17_create_interface_3callable_method = {"callable_method", (PyCFunction)__pyx_pw_3hug_10decorators_17_create_interface_3callable_method, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3hug_10decorators_17_create_interface_3callable_method(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("callable_method (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "callable_method", 1))) return NULL;
  __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_3hug_10decorators_17_create_interface_2callable_method(__pyx_self, __pyx_v_args, __pyx_v_kwargs);

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

/* "hug/decorators.py":406
 *                 arguments = (defaults[parameter], ) if parameter in defaults else ()
 *                 kwargs[parameter] = directive(*arguments, module=module,
 *                                     api_version=max(versions, key=lambda version: version or -1) if versions else None)             # <<<<<<<<<<<<<<
 *             return api_function(*args, **kwargs)
 *         callable_method.interface = interface
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_17_create_interface_15callable_method_lambda(PyObject *__pyx_self, PyObject *__pyx_v_version); /*proto*/
static PyMethodDef __pyx_mdef_3hug_10decorators_17_create_interface_15callable_method_lambda = {"lambda", (PyCFunction)__pyx_pw_3hug_10decorators_17_create_interface_15callable_method_lambda, METH_O, 0};
static PyObject *__pyx_pw_3hug_10decorators_17_create_interface_15callable_method_lambda(PyObject *__pyx_self, PyObject *__pyx_v_version) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda(__pyx_self, ((PyObject *)__pyx_v_version));

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

static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_version) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_version); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!__pyx_t_2) {
  } else {
    __Pyx_INCREF(__pyx_v_version);
    __pyx_t_1 = __pyx_v_version;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyInt_From_long(-1L); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("hug.decorators._create_interface.callable_method.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":400
 *     if named_directives and not getattr(api_function, 'without_directives', None):
 *         @wraps(api_function)
 *         def callable_method(*args, **kwargs):             # <<<<<<<<<<<<<<
 *             for parameter, directive in named_directives.items():
 *                 if parameter in kwargs:
 */

static PyObject *__pyx_pf_3hug_10decorators_17_create_interface_2callable_method(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_6__create_interface *__pyx_cur_scope;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_6__create_interface *__pyx_outer_scope;
  PyObject *__pyx_v_parameter = NULL;
  PyObject *__pyx_v_directive = NULL;
  PyObject *__pyx_v_arguments = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("callable_method", 0);
  __pyx_outer_scope = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_6__create_interface *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "hug/decorators.py":401
 *         @wraps(api_function)
 *         def callable_method(*args, **kwargs):
 *             for parameter, directive in named_directives.items():             # <<<<<<<<<<<<<<
 *                 if parameter in kwargs:
 *                     continue
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_named_directives)) { __Pyx_RaiseClosureNameError("named_directives"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(__pyx_cur_scope->__pyx_v_named_directives == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "items");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyDict_Items(__pyx_cur_scope->__pyx_v_named_directives); 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);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; 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);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; 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);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    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 = 401; __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_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 = 401; __pyx_clineno = __LINE__; goto __pyx_L1_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 = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_parameter, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_directive, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "hug/decorators.py":402
 *         def callable_method(*args, **kwargs):
 *             for parameter, directive in named_directives.items():
 *                 if parameter in kwargs:             # <<<<<<<<<<<<<<
 *                     continue
 *                 arguments = (defaults[parameter], ) if parameter in defaults else ()
 */
    __pyx_t_9 = (__Pyx_PyDict_ContainsTF(__pyx_v_parameter, __pyx_v_kwargs, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = (__pyx_t_9 != 0);
    if (__pyx_t_10) {

      /* "hug/decorators.py":403
 *             for parameter, directive in named_directives.items():
 *                 if parameter in kwargs:
 *                     continue             # <<<<<<<<<<<<<<
 *                 arguments = (defaults[parameter], ) if parameter in defaults else ()
 *                 kwargs[parameter] = directive(*arguments, module=module,
 */
      goto __pyx_L3_continue;

      /* "hug/decorators.py":402
 *         def callable_method(*args, **kwargs):
 *             for parameter, directive in named_directives.items():
 *                 if parameter in kwargs:             # <<<<<<<<<<<<<<
 *                     continue
 *                 arguments = (defaults[parameter], ) if parameter in defaults else ()
 */
    }

    /* "hug/decorators.py":404
 *                 if parameter in kwargs:
 *                     continue
 *                 arguments = (defaults[parameter], ) if parameter in defaults else ()             # <<<<<<<<<<<<<<
 *                 kwargs[parameter] = directive(*arguments, module=module,
 *                                     api_version=max(versions, key=lambda version: version or -1) if versions else None)
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_defaults)) { __Pyx_RaiseClosureNameError("defaults"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_v_parameter, __pyx_cur_scope->__pyx_v_defaults, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if ((__pyx_t_10 != 0)) {
      if (unlikely(!__pyx_cur_scope->__pyx_v_defaults)) { __Pyx_RaiseClosureNameError("defaults"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
      __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_defaults, __pyx_v_parameter); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_1 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {
      __Pyx_INCREF(__pyx_empty_tuple);
      __pyx_t_1 = __pyx_empty_tuple;
    }
    __Pyx_XDECREF_SET(__pyx_v_arguments, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "hug/decorators.py":405
 *                     continue
 *                 arguments = (defaults[parameter], ) if parameter in defaults else ()
 *                 kwargs[parameter] = directive(*arguments, module=module,             # <<<<<<<<<<<<<<
 *                                     api_version=max(versions, key=lambda version: version or -1) if versions else None)
 *             return api_function(*args, **kwargs)
 */
    if (unlikely(__pyx_v_arguments == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = PyDict_New(); 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);
    if (unlikely(!__pyx_cur_scope->__pyx_v_module)) { __Pyx_RaiseClosureNameError("module"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_module, __pyx_cur_scope->__pyx_v_module) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "hug/decorators.py":406
 *                 arguments = (defaults[parameter], ) if parameter in defaults else ()
 *                 kwargs[parameter] = directive(*arguments, module=module,
 *                                     api_version=max(versions, key=lambda version: version or -1) if versions else None)             # <<<<<<<<<<<<<<
 *             return api_function(*args, **kwargs)
 *         callable_method.interface = interface
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_versions)) { __Pyx_RaiseClosureNameError("versions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_versions); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_10) {
      if (unlikely(!__pyx_cur_scope->__pyx_v_versions)) { __Pyx_RaiseClosureNameError("versions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_versions);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_versions);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_cur_scope->__pyx_v_versions);
      __pyx_t_7 = PyDict_New(); 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_t_11 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_17_create_interface_15callable_method_lambda, 0, __pyx_n_s_create_interface_locals_callabl, NULL, __pyx_n_s_hug_decorators, __pyx_d, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_key, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_5 = __pyx_t_11;
      __pyx_t_11 = 0;
    } else {
      __Pyx_INCREF(Py_None);
      __pyx_t_5 = Py_None;
    }
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_api_version, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "hug/decorators.py":405
 *                     continue
 *                 arguments = (defaults[parameter], ) if parameter in defaults else ()
 *                 kwargs[parameter] = directive(*arguments, module=module,             # <<<<<<<<<<<<<<
 *                                     api_version=max(versions, key=lambda version: version or -1) if versions else None)
 *             return api_function(*args, **kwargs)
 */
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_directive, __pyx_v_arguments, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_v_parameter, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "hug/decorators.py":401
 *         @wraps(api_function)
 *         def callable_method(*args, **kwargs):
 *             for parameter, directive in named_directives.items():             # <<<<<<<<<<<<<<
 *                 if parameter in kwargs:
 *                     continue
 */
    __pyx_L3_continue:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "hug/decorators.py":407
 *                 kwargs[parameter] = directive(*arguments, module=module,
 *                                     api_version=max(versions, key=lambda version: version or -1) if versions else None)
 *             return api_function(*args, **kwargs)             # <<<<<<<<<<<<<<
 *         callable_method.interface = interface
 *         callable_method.without_directives = api_function
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_api_function)) { __Pyx_RaiseClosureNameError("api_function"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_api_function, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "hug/decorators.py":400
 *     if named_directives and not getattr(api_function, 'without_directives', None):
 *         @wraps(api_function)
 *         def callable_method(*args, **kwargs):             # <<<<<<<<<<<<<<
 *             for parameter, directive in named_directives.items():
 *                 if parameter in kwargs:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("hug.decorators._create_interface.callable_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_parameter);
  __Pyx_XDECREF(__pyx_v_directive);
  __Pyx_XDECREF(__pyx_v_arguments);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":232
 * 
 * 
 * def _create_interface(module, api_function, parameters=None, defaults={}, output=None, versions=None,             # <<<<<<<<<<<<<<
 *                       parse_body=True, set_status=False, transform=None, requires=()):
 *     '''Creates the request handling interface method for the given API function'''
 */

static PyObject *__pyx_pf_3hug_10decorators_16_create_interface(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_module, PyObject *__pyx_v_api_function, PyObject *__pyx_v_parameters, PyObject *__pyx_v_defaults, PyObject *__pyx_v_output, PyObject *__pyx_v_versions, PyObject *__pyx_v_parse_body, PyObject *__pyx_v_set_status, PyObject *__pyx_v_transform, PyObject *__pyx_v_requires) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_6__create_interface *__pyx_cur_scope;
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_v_default = NULL;
  PyObject *__pyx_v_directives = NULL;
  PyObject *__pyx_v_use_directives = NULL;
  PyObject *__pyx_v_output_type = NULL;
  int __pyx_v_is_method;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_transformer = NULL;
  PyObject *__pyx_v_interface = 0;
  PyObject *__pyx_v_callable_method = NULL;
  PyObject *__pyx_v_p = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_create_interface", 0);
  __pyx_cur_scope = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_6__create_interface *)__pyx_tp_new_3hug_10decorators___pyx_scope_struct_6__create_interface(__pyx_ptype_3hug_10decorators___pyx_scope_struct_6__create_interface, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_module = __pyx_v_module;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_module);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_module);
  __pyx_cur_scope->__pyx_v_api_function = __pyx_v_api_function;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_api_function);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_api_function);
  __pyx_cur_scope->__pyx_v_defaults = __pyx_v_defaults;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_defaults);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_defaults);
  __pyx_cur_scope->__pyx_v_versions = __pyx_v_versions;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_versions);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_versions);
  __pyx_cur_scope->__pyx_v_parse_body = __pyx_v_parse_body;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_parse_body);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_parse_body);
  __pyx_cur_scope->__pyx_v_set_status = __pyx_v_set_status;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_set_status);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_set_status);
  __pyx_cur_scope->__pyx_v_transform = __pyx_v_transform;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_transform);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_transform);
  __pyx_cur_scope->__pyx_v_requires = __pyx_v_requires;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_requires);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_requires);

  /* "hug/decorators.py":235
 *                       parse_body=True, set_status=False, transform=None, requires=()):
 *     '''Creates the request handling interface method for the given API function'''
 *     if not parameters:             # <<<<<<<<<<<<<<
 *         accepted_parameters = api_function.__code__.co_varnames[:api_function.__code__.co_argcount]
 *         defaults = {}
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_parameters); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "hug/decorators.py":236
 *     '''Creates the request handling interface method for the given API function'''
 *     if not parameters:
 *         accepted_parameters = api_function.__code__.co_varnames[:api_function.__code__.co_argcount]             # <<<<<<<<<<<<<<
 *         defaults = {}
 *         for index, default in enumerate(reversed(api_function.__defaults__ or ())):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_api_function, __pyx_n_s_code); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_co_varnames); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __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_cur_scope->__pyx_v_api_function, __pyx_n_s_code); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_co_argcount); 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);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, 0, NULL, &__pyx_t_5, NULL, 0, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __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_5); __pyx_t_5 = 0;
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_cur_scope->__pyx_v_accepted_parameters = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "hug/decorators.py":237
 *     if not parameters:
 *         accepted_parameters = api_function.__code__.co_varnames[:api_function.__code__.co_argcount]
 *         defaults = {}             # <<<<<<<<<<<<<<
 *         for index, default in enumerate(reversed(api_function.__defaults__ or ())):
 *             defaults[accepted_parameters[-(index + 1)]] = default
 */
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_defaults);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_defaults, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;

    /* "hug/decorators.py":238
 *         accepted_parameters = api_function.__code__.co_varnames[:api_function.__code__.co_argcount]
 *         defaults = {}
 *         for index, default in enumerate(reversed(api_function.__defaults__ or ())):             # <<<<<<<<<<<<<<
 *             defaults[accepted_parameters[-(index + 1)]] = default
 * 
 */
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_3 = __pyx_int_0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_api_function, __pyx_n_s_defaults_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!__pyx_t_2) {
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = __pyx_t_4;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L6_bool_binop_done;
    }
    __Pyx_INCREF(__pyx_empty_tuple);
    __pyx_t_5 = __pyx_empty_tuple;
    __pyx_L6_bool_binop_done:;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_reversed, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
      __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_7(__pyx_t_4);
        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 = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_v_default, __pyx_t_5);
      __pyx_t_5 = 0;
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_3);
      __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "hug/decorators.py":239
 *         defaults = {}
 *         for index, default in enumerate(reversed(api_function.__defaults__ or ())):
 *             defaults[accepted_parameters[-(index + 1)]] = default             # <<<<<<<<<<<<<<
 * 
 *         required = accepted_parameters[:-(len(api_function.__defaults__ or ())) or None]
 */
      __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_index, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = PyNumber_Negative(__pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_accepted_parameters, __pyx_t_8); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(PyObject_SetItem(__pyx_cur_scope->__pyx_v_defaults, __pyx_t_5, __pyx_v_default) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "hug/decorators.py":238
 *         accepted_parameters = api_function.__code__.co_varnames[:api_function.__code__.co_argcount]
 *         defaults = {}
 *         for index, default in enumerate(reversed(api_function.__defaults__ or ())):             # <<<<<<<<<<<<<<
 *             defaults[accepted_parameters[-(index + 1)]] = default
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "hug/decorators.py":241
 *             defaults[accepted_parameters[-(index + 1)]] = default
 * 
 *         required = accepted_parameters[:-(len(api_function.__defaults__ or ())) or None]             # <<<<<<<<<<<<<<
 *     else:
 *         accepted_parameters = tuple(parameters)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_api_function, __pyx_n_s_defaults_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!__pyx_t_2) {
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_4 = __pyx_t_5;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L10_bool_binop_done;
    }
    __Pyx_INCREF(__pyx_empty_tuple);
    __pyx_t_4 = __pyx_empty_tuple;
    __pyx_L10_bool_binop_done:;
    __pyx_t_6 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_9 = (-__pyx_t_6);
    if (!__pyx_t_9) {
    } else {
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L8_bool_binop_done;
    }
    __Pyx_INCREF(Py_None);
    __pyx_t_3 = Py_None;
    __pyx_L8_bool_binop_done:;
    __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_accepted_parameters, 0, 0, NULL, &__pyx_t_3, NULL, 0, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_cur_scope->__pyx_v_required = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "hug/decorators.py":235
 *                       parse_body=True, set_status=False, transform=None, requires=()):
 *     '''Creates the request handling interface method for the given API function'''
 *     if not parameters:             # <<<<<<<<<<<<<<
 *         accepted_parameters = api_function.__code__.co_varnames[:api_function.__code__.co_argcount]
 *         defaults = {}
 */
    goto __pyx_L3;
  }

  /* "hug/decorators.py":243
 *         required = accepted_parameters[:-(len(api_function.__defaults__ or ())) or None]
 *     else:
 *         accepted_parameters = tuple(parameters)             # <<<<<<<<<<<<<<
 *         required = tuple([p for p in accepted_parameters if p not in defaults])
 * 
 */
  /*else*/ {
    __pyx_t_4 = PySequence_Tuple(__pyx_v_parameters); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_cur_scope->__pyx_v_accepted_parameters = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "hug/decorators.py":244
 *     else:
 *         accepted_parameters = tuple(parameters)
 *         required = tuple([p for p in accepted_parameters if p not in defaults])             # <<<<<<<<<<<<<<
 * 
 *     takes_kwargs = bool(api_function.__code__.co_flags & 0x08)
 */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __pyx_cur_scope->__pyx_v_accepted_parameters; __Pyx_INCREF(__pyx_t_3); __pyx_t_9 = 0;
    for (;;) {
      if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_5); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_p, __pyx_cur_scope->__pyx_v_defaults, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_1 = (__pyx_t_2 != 0);
      if (__pyx_t_1) {
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_v_p))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyList_AsTuple(((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_cur_scope->__pyx_v_required = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "hug/decorators.py":246
 *         required = tuple([p for p in accepted_parameters if p not in defaults])
 * 
 *     takes_kwargs = bool(api_function.__code__.co_flags & 0x08)             # <<<<<<<<<<<<<<
 *     function_output = output or module.__hug__.output_format
 *     function_output_args = (AUTO_INCLUDE.intersection(function_output.__code__.co_varnames) if
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_api_function, __pyx_n_s_code); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_co_flags); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __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_PyInt_AndObjC(__pyx_t_4, __pyx_int_8, 0x08, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyBool_FromLong((!(!__pyx_t_1))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_takes_kwargs = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "hug/decorators.py":247
 * 
 *     takes_kwargs = bool(api_function.__code__.co_flags & 0x08)
 *     function_output = output or module.__hug__.output_format             # <<<<<<<<<<<<<<
 *     function_output_args = (AUTO_INCLUDE.intersection(function_output.__code__.co_varnames) if
 *                             hasattr(function_output, '__code__') else ())
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_output); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!__pyx_t_1) {
  } else {
    __Pyx_INCREF(__pyx_v_output);
    __pyx_t_3 = __pyx_v_output;
    goto __pyx_L15_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_module, __pyx_n_s_hug_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_output_format_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_3 = __pyx_t_5;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_L15_bool_binop_done:;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_function_output = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "hug/decorators.py":249
 *     function_output = output or module.__hug__.output_format
 *     function_output_args = (AUTO_INCLUDE.intersection(function_output.__code__.co_varnames) if
 *                             hasattr(function_output, '__code__') else ())             # <<<<<<<<<<<<<<
 *     default_kwargs = {}
 *     directives = module.__hug__.directives()
 */
  __pyx_t_5 = __pyx_cur_scope->__pyx_v_function_output;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_1 = PyObject_HasAttr(__pyx_t_5, __pyx_n_s_code); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if ((__pyx_t_1 != 0)) {

    /* "hug/decorators.py":248
 *     takes_kwargs = bool(api_function.__code__.co_flags & 0x08)
 *     function_output = output or module.__hug__.output_format
 *     function_output_args = (AUTO_INCLUDE.intersection(function_output.__code__.co_varnames) if             # <<<<<<<<<<<<<<
 *                             hasattr(function_output, '__code__') else ())
 *     default_kwargs = {}
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_AUTO_INCLUDE); 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_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_intersection); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_function_output, __pyx_n_s_code); 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_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_co_varnames); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_GIVEREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); 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_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_3 = __pyx_t_5;
    __pyx_t_5 = 0;
  } else {

    /* "hug/decorators.py":249
 *     function_output = output or module.__hug__.output_format
 *     function_output_args = (AUTO_INCLUDE.intersection(function_output.__code__.co_varnames) if
 *                             hasattr(function_output, '__code__') else ())             # <<<<<<<<<<<<<<
 *     default_kwargs = {}
 *     directives = module.__hug__.directives()
 */
    __Pyx_INCREF(__pyx_empty_tuple);
    __pyx_t_3 = __pyx_empty_tuple;
  }
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_function_output_args = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "hug/decorators.py":250
 *     function_output_args = (AUTO_INCLUDE.intersection(function_output.__code__.co_varnames) if
 *                             hasattr(function_output, '__code__') else ())
 *     default_kwargs = {}             # <<<<<<<<<<<<<<
 *     directives = module.__hug__.directives()
 *     use_directives = set(accepted_parameters).intersection(directives.keys())
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_default_kwargs = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "hug/decorators.py":251
 *                             hasattr(function_output, '__code__') else ())
 *     default_kwargs = {}
 *     directives = module.__hug__.directives()             # <<<<<<<<<<<<<<
 *     use_directives = set(accepted_parameters).intersection(directives.keys())
 *     if transform is None and not isinstance(api_function.__annotations__.get('return', None), (str, type(None))):
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_module, __pyx_n_s_hug_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_directives); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_v_directives = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "hug/decorators.py":252
 *     default_kwargs = {}
 *     directives = module.__hug__.directives()
 *     use_directives = set(accepted_parameters).intersection(directives.keys())             # <<<<<<<<<<<<<<
 *     if transform is None and not isinstance(api_function.__annotations__.get('return', None), (str, type(None))):
 *         transform = api_function.__annotations__['return']
 */
  __pyx_t_8 = PySet_New(__pyx_cur_scope->__pyx_v_accepted_parameters); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_intersection); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_directives, __pyx_n_s_keys); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_10 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_11))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_11, function);
    }
  }
  if (__pyx_t_10) {
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_10); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  } else {
    __pyx_t_8 = __Pyx_PyObject_CallNoArg(__pyx_t_11); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_11)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_11) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = NULL;
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_use_directives = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "hug/decorators.py":253
 *     directives = module.__hug__.directives()
 *     use_directives = set(accepted_parameters).intersection(directives.keys())
 *     if transform is None and not isinstance(api_function.__annotations__.get('return', None), (str, type(None))):             # <<<<<<<<<<<<<<
 *         transform = api_function.__annotations__['return']
 * 
 */
  __pyx_t_2 = (__pyx_cur_scope->__pyx_v_transform == Py_None);
  __pyx_t_12 = (__pyx_t_2 != 0);
  if (__pyx_t_12) {
  } else {
    __pyx_t_1 = __pyx_t_12;
    goto __pyx_L18_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_api_function, __pyx_n_s_annotations); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __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_PyObject_Call(__pyx_t_5, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_INCREF(((PyObject *)Py_TYPE(Py_None)));
  __pyx_t_5 = ((PyObject *)Py_TYPE(Py_None));
  __pyx_t_2 = PyString_Check(__pyx_t_3); 
  __pyx_t_13 = (__pyx_t_2 != 0);
  if (!__pyx_t_13) {
  } else {
    __pyx_t_12 = __pyx_t_13;
    goto __pyx_L20_bool_binop_done;
  }
  __pyx_t_13 = PyObject_IsInstance(__pyx_t_3, __pyx_t_5); 
  __pyx_t_2 = (__pyx_t_13 != 0);
  __pyx_t_12 = __pyx_t_2;
  __pyx_L20_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = ((!(__pyx_t_12 != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L18_bool_binop_done:;
  if (__pyx_t_1) {

    /* "hug/decorators.py":254
 *     use_directives = set(accepted_parameters).intersection(directives.keys())
 *     if transform is None and not isinstance(api_function.__annotations__.get('return', None), (str, type(None))):
 *         transform = api_function.__annotations__['return']             # <<<<<<<<<<<<<<
 * 
 *     if hasattr(transform, 'dump'):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_api_function, __pyx_n_s_annotations); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_return); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_transform);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_transform, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;

    /* "hug/decorators.py":253
 *     directives = module.__hug__.directives()
 *     use_directives = set(accepted_parameters).intersection(directives.keys())
 *     if transform is None and not isinstance(api_function.__annotations__.get('return', None), (str, type(None))):             # <<<<<<<<<<<<<<
 *         transform = api_function.__annotations__['return']
 * 
 */
  }

  /* "hug/decorators.py":256
 *         transform = api_function.__annotations__['return']
 * 
 *     if hasattr(transform, 'dump'):             # <<<<<<<<<<<<<<
 *         transform = transform.dump
 *         output_type = transform
 */
  __pyx_t_5 = __pyx_cur_scope->__pyx_v_transform;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_1 = PyObject_HasAttr(__pyx_t_5, __pyx_n_s_dump); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "hug/decorators.py":257
 * 
 *     if hasattr(transform, 'dump'):
 *         transform = transform.dump             # <<<<<<<<<<<<<<
 *         output_type = transform
 *     else:
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_transform, __pyx_n_s_dump); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_transform);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_transform, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;

    /* "hug/decorators.py":258
 *     if hasattr(transform, 'dump'):
 *         transform = transform.dump
 *         output_type = transform             # <<<<<<<<<<<<<<
 *     else:
 *         output_type = transform or api_function.__annotations__.get('return', None)
 */
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_transform);
    __pyx_v_output_type = __pyx_cur_scope->__pyx_v_transform;

    /* "hug/decorators.py":256
 *         transform = api_function.__annotations__['return']
 * 
 *     if hasattr(transform, 'dump'):             # <<<<<<<<<<<<<<
 *         transform = transform.dump
 *         output_type = transform
 */
    goto __pyx_L22;
  }

  /* "hug/decorators.py":260
 *         output_type = transform
 *     else:
 *         output_type = transform or api_function.__annotations__.get('return', None)             # <<<<<<<<<<<<<<
 * 
 *     if transform and hasattr(transform, '__code__'):
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_transform); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!__pyx_t_2) {
    } else {
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_transform);
      __pyx_t_5 = __pyx_cur_scope->__pyx_v_transform;
      goto __pyx_L23_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_api_function, __pyx_n_s_annotations); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5 = __pyx_t_3;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_L23_bool_binop_done:;
    __pyx_v_output_type = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __pyx_L22:;

  /* "hug/decorators.py":262
 *         output_type = transform or api_function.__annotations__.get('return', None)
 * 
 *     if transform and hasattr(transform, '__code__'):             # <<<<<<<<<<<<<<
 *         transform_args = AUTO_INCLUDE.intersection(transform.__code__.co_varnames)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_transform); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L26_bool_binop_done;
  }
  __pyx_t_5 = __pyx_cur_scope->__pyx_v_transform;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_1 = PyObject_HasAttr(__pyx_t_5, __pyx_n_s_code); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_12 = (__pyx_t_1 != 0);
  __pyx_t_2 = __pyx_t_12;
  __pyx_L26_bool_binop_done:;
  if (__pyx_t_2) {

    /* "hug/decorators.py":263
 * 
 *     if transform and hasattr(transform, '__code__'):
 *         transform_args = AUTO_INCLUDE.intersection(transform.__code__.co_varnames)             # <<<<<<<<<<<<<<
 * 
 *     is_method = False
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_AUTO_INCLUDE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_intersection); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_transform, __pyx_n_s_code); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_co_varnames); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_cur_scope->__pyx_v_transform_args = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "hug/decorators.py":262
 *         output_type = transform or api_function.__annotations__.get('return', None)
 * 
 *     if transform and hasattr(transform, '__code__'):             # <<<<<<<<<<<<<<
 *         transform_args = AUTO_INCLUDE.intersection(transform.__code__.co_varnames)
 * 
 */
  }

  /* "hug/decorators.py":265
 *         transform_args = AUTO_INCLUDE.intersection(transform.__code__.co_varnames)
 * 
 *     is_method = False             # <<<<<<<<<<<<<<
 *     if 'method' in api_function.__class__.__name__:
 *         is_method = True
 */
  __pyx_v_is_method = 0;

  /* "hug/decorators.py":266
 * 
 *     is_method = False
 *     if 'method' in api_function.__class__.__name__:             # <<<<<<<<<<<<<<
 *         is_method = True
 *         required = required[1:]
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_api_function, __pyx_n_s_class); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_method, __pyx_t_10, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_12 = (__pyx_t_2 != 0);
  if (__pyx_t_12) {

    /* "hug/decorators.py":267
 *     is_method = False
 *     if 'method' in api_function.__class__.__name__:
 *         is_method = True             # <<<<<<<<<<<<<<
 *         required = required[1:]
 * 
 */
    __pyx_v_is_method = 1;

    /* "hug/decorators.py":268
 *     if 'method' in api_function.__class__.__name__:
 *         is_method = True
 *         required = required[1:]             # <<<<<<<<<<<<<<
 * 
 *     input_transformations = {}
 */
    __pyx_t_10 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_required, 1, 0, NULL, NULL, &__pyx_slice__24, 1, 0, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_required);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_required, __pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    __pyx_t_10 = 0;

    /* "hug/decorators.py":266
 * 
 *     is_method = False
 *     if 'method' in api_function.__class__.__name__:             # <<<<<<<<<<<<<<
 *         is_method = True
 *         required = required[1:]
 */
  }

  /* "hug/decorators.py":270
 *         required = required[1:]
 * 
 *     input_transformations = {}             # <<<<<<<<<<<<<<
 *     named_directives = {directive_name: directives[directive_name] for directive_name in use_directives}
 *     for name, transformer in api_function.__annotations__.items():
 */
  __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_cur_scope->__pyx_v_input_transformations = ((PyObject*)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "hug/decorators.py":271
 * 
 *     input_transformations = {}
 *     named_directives = {directive_name: directives[directive_name] for directive_name in use_directives}             # <<<<<<<<<<<<<<
 *     for name, transformer in api_function.__annotations__.items():
 *         if isinstance(transformer, str):
 */
  { /* enter inner scope */
    PyObject *__pyx_8genexpr1__pyx_v_directive_name = NULL;
    __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
    __Pyx_GOTREF(__pyx_t_10);
    if (likely(PyList_CheckExact(__pyx_v_use_directives)) || PyTuple_CheckExact(__pyx_v_use_directives)) {
      __pyx_t_5 = __pyx_v_use_directives; __Pyx_INCREF(__pyx_t_5); __pyx_t_9 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_use_directives); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
    }
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_11 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_11); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
          #else
          __pyx_t_11 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
          __Pyx_GOTREF(__pyx_t_11);
          #endif
        } else {
          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_11); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
          #else
          __pyx_t_11 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
          __Pyx_GOTREF(__pyx_t_11);
          #endif
        }
      } else {
        __pyx_t_11 = __pyx_t_7(__pyx_t_5);
        if (unlikely(!__pyx_t_11)) {
          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 = 271; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_11);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_directive_name, __pyx_t_11);
      __pyx_t_11 = 0;
      __pyx_t_11 = PyObject_GetItem(__pyx_v_directives, __pyx_8genexpr1__pyx_v_directive_name); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L31_error;};
      __Pyx_GOTREF(__pyx_t_11);
      if (unlikely(PyDict_SetItem(__pyx_t_10, (PyObject*)__pyx_8genexpr1__pyx_v_directive_name, (PyObject*)__pyx_t_11))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_directive_name);
    goto __pyx_L34_exit_scope;
    __pyx_L31_error:;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_directive_name);
    goto __pyx_L1_error;
    __pyx_L34_exit_scope:;
  } /* exit inner scope */
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_cur_scope->__pyx_v_named_directives = ((PyObject*)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "hug/decorators.py":272
 *     input_transformations = {}
 *     named_directives = {directive_name: directives[directive_name] for directive_name in use_directives}
 *     for name, transformer in api_function.__annotations__.items():             # <<<<<<<<<<<<<<
 *         if isinstance(transformer, str):
 *             continue
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_api_function, __pyx_n_s_annotations); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_items); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_11))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_11);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_11, function);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_10 = __Pyx_PyObject_CallNoArg(__pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) {
    __pyx_t_11 = __pyx_t_10; __Pyx_INCREF(__pyx_t_11); __pyx_t_9 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_7 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_11))) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_11)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_10 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_10 = PySequence_ITEM(__pyx_t_11, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        #endif
      } else {
        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_10 = PySequence_ITEM(__pyx_t_11, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        #endif
      }
    } else {
      __pyx_t_10 = __pyx_t_7(__pyx_t_11);
      if (unlikely(!__pyx_t_10)) {
        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 = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_10);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_10))) || (PyList_CheckExact(__pyx_t_10))) {
      PyObject* sequence = __pyx_t_10;
      #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 = 272; __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_8 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_8 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_8);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      #endif
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_3 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_14 = Py_TYPE(__pyx_t_3)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_5)) goto __pyx_L37_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_8 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_8)) goto __pyx_L37_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_8);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_14 = NULL;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L38_unpacking_done;
      __pyx_L37_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_14 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L38_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_transformer, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "hug/decorators.py":273
 *     named_directives = {directive_name: directives[directive_name] for directive_name in use_directives}
 *     for name, transformer in api_function.__annotations__.items():
 *         if isinstance(transformer, str):             # <<<<<<<<<<<<<<
 *             continue
 *         elif hasattr(transformer, 'directive'):
 */
    __pyx_t_12 = PyString_Check(__pyx_v_transformer); 
    __pyx_t_2 = (__pyx_t_12 != 0);
    if (__pyx_t_2) {

      /* "hug/decorators.py":274
 *     for name, transformer in api_function.__annotations__.items():
 *         if isinstance(transformer, str):
 *             continue             # <<<<<<<<<<<<<<
 *         elif hasattr(transformer, 'directive'):
 *             named_directives[name] = transformer
 */
      goto __pyx_L35_continue;

      /* "hug/decorators.py":273
 *     named_directives = {directive_name: directives[directive_name] for directive_name in use_directives}
 *     for name, transformer in api_function.__annotations__.items():
 *         if isinstance(transformer, str):             # <<<<<<<<<<<<<<
 *             continue
 *         elif hasattr(transformer, 'directive'):
 */
    }

    /* "hug/decorators.py":275
 *         if isinstance(transformer, str):
 *             continue
 *         elif hasattr(transformer, 'directive'):             # <<<<<<<<<<<<<<
 *             named_directives[name] = transformer
 *             continue
 */
    __pyx_t_2 = PyObject_HasAttr(__pyx_v_transformer, __pyx_n_s_directive); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_12 = (__pyx_t_2 != 0);
    if (__pyx_t_12) {

      /* "hug/decorators.py":276
 *             continue
 *         elif hasattr(transformer, 'directive'):
 *             named_directives[name] = transformer             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
      if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_named_directives, __pyx_v_name, __pyx_v_transformer) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "hug/decorators.py":277
 *         elif hasattr(transformer, 'directive'):
 *             named_directives[name] = transformer
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         if hasattr(transformer, 'load'):
 */
      goto __pyx_L35_continue;

      /* "hug/decorators.py":275
 *         if isinstance(transformer, str):
 *             continue
 *         elif hasattr(transformer, 'directive'):             # <<<<<<<<<<<<<<
 *             named_directives[name] = transformer
 *             continue
 */
    }

    /* "hug/decorators.py":279
 *             continue
 * 
 *         if hasattr(transformer, 'load'):             # <<<<<<<<<<<<<<
 *             transformer = _marshmallow_schema(transformer)
 *         elif hasattr(transformer, 'deserialize'):
 */
    __pyx_t_12 = PyObject_HasAttr(__pyx_v_transformer, __pyx_n_s_load); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = (__pyx_t_12 != 0);
    if (__pyx_t_2) {

      /* "hug/decorators.py":280
 * 
 *         if hasattr(transformer, 'load'):
 *             transformer = _marshmallow_schema(transformer)             # <<<<<<<<<<<<<<
 *         elif hasattr(transformer, 'deserialize'):
 *             transformer = transformer.deserialize
 */
      __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_marshmallow_schema); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_transformer); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
      } else {
        __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_INCREF(__pyx_v_transformer);
        __Pyx_GIVEREF(__pyx_v_transformer);
        PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_transformer);
        __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_3, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF_SET(__pyx_v_transformer, __pyx_t_10);
      __pyx_t_10 = 0;

      /* "hug/decorators.py":279
 *             continue
 * 
 *         if hasattr(transformer, 'load'):             # <<<<<<<<<<<<<<
 *             transformer = _marshmallow_schema(transformer)
 *         elif hasattr(transformer, 'deserialize'):
 */
      goto __pyx_L40;
    }

    /* "hug/decorators.py":281
 *         if hasattr(transformer, 'load'):
 *             transformer = _marshmallow_schema(transformer)
 *         elif hasattr(transformer, 'deserialize'):             # <<<<<<<<<<<<<<
 *             transformer = transformer.deserialize
 * 
 */
    __pyx_t_2 = PyObject_HasAttr(__pyx_v_transformer, __pyx_n_s_deserialize); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_12 = (__pyx_t_2 != 0);
    if (__pyx_t_12) {

      /* "hug/decorators.py":282
 *             transformer = _marshmallow_schema(transformer)
 *         elif hasattr(transformer, 'deserialize'):
 *             transformer = transformer.deserialize             # <<<<<<<<<<<<<<
 * 
 *         input_transformations[name] = transformer
 */
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_transformer, __pyx_n_s_deserialize); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF_SET(__pyx_v_transformer, __pyx_t_10);
      __pyx_t_10 = 0;

      /* "hug/decorators.py":281
 *         if hasattr(transformer, 'load'):
 *             transformer = _marshmallow_schema(transformer)
 *         elif hasattr(transformer, 'deserialize'):             # <<<<<<<<<<<<<<
 *             transformer = transformer.deserialize
 * 
 */
    }
    __pyx_L40:;

    /* "hug/decorators.py":284
 *             transformer = transformer.deserialize
 * 
 *         input_transformations[name] = transformer             # <<<<<<<<<<<<<<
 * 
 *     def interface(request, response, api_version=None, **kwargs):
 */
    if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_input_transformations, __pyx_v_name, __pyx_v_transformer) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "hug/decorators.py":272
 *     input_transformations = {}
 *     named_directives = {directive_name: directives[directive_name] for directive_name in use_directives}
 *     for name, transformer in api_function.__annotations__.items():             # <<<<<<<<<<<<<<
 *         if isinstance(transformer, str):
 *             continue
 */
    __pyx_L35_continue:;
  }
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "hug/decorators.py":286
 *         input_transformations[name] = transformer
 * 
 *     def interface(request, response, api_version=None, **kwargs):             # <<<<<<<<<<<<<<
 *         if set_status:
 *             response.status = set_status
 */
  __pyx_t_11 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_17_create_interface_1interface, 0, __pyx_n_s_create_interface_locals_interfa, ((PyObject*)__pyx_cur_scope), __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_tuple__27);
  __pyx_v_interface = __pyx_t_11;
  __pyx_t_11 = 0;

  /* "hug/decorators.py":394
 *             response.data = to_return
 * 
 *     if versions:             # <<<<<<<<<<<<<<
 *         module.__hug__.versions.update(versions)
 * 
 */
  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_versions); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_12) {

    /* "hug/decorators.py":395
 * 
 *     if versions:
 *         module.__hug__.versions.update(versions)             # <<<<<<<<<<<<<<
 * 
 *     callable_method = api_function
 */
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_module, __pyx_n_s_hug_3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_versions); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_update); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_cur_scope->__pyx_v_versions); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
    } else {
      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8); __pyx_t_8 = NULL;
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_versions);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_versions);
      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_cur_scope->__pyx_v_versions);
      __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_3, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

    /* "hug/decorators.py":394
 *             response.data = to_return
 * 
 *     if versions:             # <<<<<<<<<<<<<<
 *         module.__hug__.versions.update(versions)
 * 
 */
  }

  /* "hug/decorators.py":397
 *         module.__hug__.versions.update(versions)
 * 
 *     callable_method = api_function             # <<<<<<<<<<<<<<
 *     if named_directives and not getattr(api_function, 'without_directives', None):
 *         @wraps(api_function)
 */
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_api_function);
  __pyx_v_callable_method = __pyx_cur_scope->__pyx_v_api_function;

  /* "hug/decorators.py":398
 * 
 *     callable_method = api_function
 *     if named_directives and not getattr(api_function, 'without_directives', None):             # <<<<<<<<<<<<<<
 *         @wraps(api_function)
 *         def callable_method(*args, **kwargs):
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_named_directives); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {
  } else {
    __pyx_t_12 = __pyx_t_2;
    goto __pyx_L43_bool_binop_done;
  }
  __pyx_t_11 = __pyx_cur_scope->__pyx_v_api_function;
  __Pyx_INCREF(__pyx_t_11);
  __pyx_t_10 = __Pyx_GetAttr3(__pyx_t_11, __pyx_n_s_without_directives, Py_None); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_1 = ((!__pyx_t_2) != 0);
  __pyx_t_12 = __pyx_t_1;
  __pyx_L43_bool_binop_done:;
  if (__pyx_t_12) {

    /* "hug/decorators.py":399
 *     callable_method = api_function
 *     if named_directives and not getattr(api_function, 'without_directives', None):
 *         @wraps(api_function)             # <<<<<<<<<<<<<<
 *         def callable_method(*args, **kwargs):
 *             for parameter, directive in named_directives.items():
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_cur_scope->__pyx_v_api_function); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); __pyx_t_8 = NULL;
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_api_function);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_api_function);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_cur_scope->__pyx_v_api_function);
      __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "hug/decorators.py":400
 *     if named_directives and not getattr(api_function, 'without_directives', None):
 *         @wraps(api_function)
 *         def callable_method(*args, **kwargs):             # <<<<<<<<<<<<<<
 *             for parameter, directive in named_directives.items():
 *                 if parameter in kwargs:
 */
    __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_17_create_interface_3callable_method, 0, __pyx_n_s_create_interface_locals_callabl_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_11);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_11, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_10);
    } else {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_8, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF_SET(__pyx_v_callable_method, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "hug/decorators.py":408
 *                                     api_version=max(versions, key=lambda version: version or -1) if versions else None)
 *             return api_function(*args, **kwargs)
 *         callable_method.interface = interface             # <<<<<<<<<<<<<<
 *         callable_method.without_directives = api_function
 * 
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_callable_method, __pyx_n_s_interface, __pyx_v_interface) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "hug/decorators.py":409
 *             return api_function(*args, **kwargs)
 *         callable_method.interface = interface
 *         callable_method.without_directives = api_function             # <<<<<<<<<<<<<<
 * 
 *     if is_method:
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_callable_method, __pyx_n_s_without_directives, __pyx_cur_scope->__pyx_v_api_function) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "hug/decorators.py":398
 * 
 *     callable_method = api_function
 *     if named_directives and not getattr(api_function, 'without_directives', None):             # <<<<<<<<<<<<<<
 *         @wraps(api_function)
 *         def callable_method(*args, **kwargs):
 */
  }

  /* "hug/decorators.py":411
 *         callable_method.without_directives = api_function
 * 
 *     if is_method:             # <<<<<<<<<<<<<<
 *         api_function.__dict__['interface'] = interface
 *     else:
 */
  __pyx_t_12 = (__pyx_v_is_method != 0);
  if (__pyx_t_12) {

    /* "hug/decorators.py":412
 * 
 *     if is_method:
 *         api_function.__dict__['interface'] = interface             # <<<<<<<<<<<<<<
 *     else:
 *         api_function.interface = interface
 */
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_api_function, __pyx_n_s_dict); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    if (unlikely(PyObject_SetItem(__pyx_t_10, __pyx_n_s_interface, __pyx_v_interface) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "hug/decorators.py":411
 *         callable_method.without_directives = api_function
 * 
 *     if is_method:             # <<<<<<<<<<<<<<
 *         api_function.__dict__['interface'] = interface
 *     else:
 */
    goto __pyx_L45;
  }

  /* "hug/decorators.py":414
 *         api_function.__dict__['interface'] = interface
 *     else:
 *         api_function.interface = interface             # <<<<<<<<<<<<<<
 *     interface.api_function = api_function
 *     interface.output_format = function_output
 */
  /*else*/ {
    if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_api_function, __pyx_n_s_interface, __pyx_v_interface) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L45:;

  /* "hug/decorators.py":415
 *     else:
 *         api_function.interface = interface
 *     interface.api_function = api_function             # <<<<<<<<<<<<<<
 *     interface.output_format = function_output
 *     interface.defaults = defaults
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_interface, __pyx_n_s_api_function, __pyx_cur_scope->__pyx_v_api_function) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":416
 *         api_function.interface = interface
 *     interface.api_function = api_function
 *     interface.output_format = function_output             # <<<<<<<<<<<<<<
 *     interface.defaults = defaults
 *     interface.accepted_parameters = accepted_parameters
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_interface, __pyx_n_s_output_format_2, __pyx_cur_scope->__pyx_v_function_output) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":417
 *     interface.api_function = api_function
 *     interface.output_format = function_output
 *     interface.defaults = defaults             # <<<<<<<<<<<<<<
 *     interface.accepted_parameters = accepted_parameters
 *     interface.content_type = function_output.content_type
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_interface, __pyx_n_s_defaults, __pyx_cur_scope->__pyx_v_defaults) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":418
 *     interface.output_format = function_output
 *     interface.defaults = defaults
 *     interface.accepted_parameters = accepted_parameters             # <<<<<<<<<<<<<<
 *     interface.content_type = function_output.content_type
 *     interface.required = required
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_interface, __pyx_n_s_accepted_parameters, __pyx_cur_scope->__pyx_v_accepted_parameters) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":419
 *     interface.defaults = defaults
 *     interface.accepted_parameters = accepted_parameters
 *     interface.content_type = function_output.content_type             # <<<<<<<<<<<<<<
 *     interface.required = required
 *     interface.output_type = output_type if isinstance(output_type, (str, type(None))) else output_type.__doc__
 */
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_function_output, __pyx_n_s_content_type); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_interface, __pyx_n_s_content_type, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "hug/decorators.py":420
 *     interface.accepted_parameters = accepted_parameters
 *     interface.content_type = function_output.content_type
 *     interface.required = required             # <<<<<<<<<<<<<<
 *     interface.output_type = output_type if isinstance(output_type, (str, type(None))) else output_type.__doc__
 *     return (interface, callable_method)
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_interface, __pyx_n_s_required, __pyx_cur_scope->__pyx_v_required) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":421
 *     interface.content_type = function_output.content_type
 *     interface.required = required
 *     interface.output_type = output_type if isinstance(output_type, (str, type(None))) else output_type.__doc__             # <<<<<<<<<<<<<<
 *     return (interface, callable_method)
 * 
 */
  __Pyx_INCREF(((PyObject *)Py_TYPE(Py_None)));
  __pyx_t_11 = ((PyObject *)Py_TYPE(Py_None));
  __pyx_t_1 = PyString_Check(__pyx_v_output_type); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_12 = __pyx_t_2;
    goto __pyx_L46_bool_binop_done;
  }
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_output_type, __pyx_t_11); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  __pyx_t_12 = __pyx_t_1;
  __pyx_L46_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if ((__pyx_t_12 != 0)) {
    __Pyx_INCREF(__pyx_v_output_type);
    __pyx_t_10 = __pyx_v_output_type;
  } else {
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_type, __pyx_n_s_doc); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_10 = __pyx_t_11;
    __pyx_t_11 = 0;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_interface, __pyx_n_s_output_type, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "hug/decorators.py":422
 *     interface.required = required
 *     interface.output_type = output_type if isinstance(output_type, (str, type(None))) else output_type.__doc__
 *     return (interface, callable_method)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_INCREF(__pyx_v_interface);
  __Pyx_GIVEREF(__pyx_v_interface);
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_interface);
  __Pyx_INCREF(__pyx_v_callable_method);
  __Pyx_GIVEREF(__pyx_v_callable_method);
  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_callable_method);
  __pyx_r = __pyx_t_10;
  __pyx_t_10 = 0;
  goto __pyx_L0;

  /* "hug/decorators.py":232
 * 
 * 
 * def _create_interface(module, api_function, parameters=None, defaults={}, output=None, versions=None,             # <<<<<<<<<<<<<<
 *                       parse_body=True, set_status=False, transform=None, requires=()):
 *     '''Creates the request handling interface method for the given API function'''
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("hug.decorators._create_interface", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XDECREF(__pyx_v_default);
  __Pyx_XDECREF(__pyx_v_directives);
  __Pyx_XDECREF(__pyx_v_use_directives);
  __Pyx_XDECREF(__pyx_v_output_type);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_transformer);
  __Pyx_XDECREF(__pyx_v_interface);
  __Pyx_XDECREF(__pyx_v_callable_method);
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":425
 * 
 * 
 * def not_found(output=None, versions=None, parse_body=False, transform=None, requires=()):             # <<<<<<<<<<<<<<
 *     '''A decorator to register a 404 handler'''
 *     versions = (versions, ) if isinstance(versions, (int, float, None.__class__)) else versions
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_19not_found(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3hug_10decorators_18not_found[] = "A decorator to register a 404 handler";
static PyMethodDef __pyx_mdef_3hug_10decorators_19not_found = {"not_found", (PyCFunction)__pyx_pw_3hug_10decorators_19not_found, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3hug_10decorators_18not_found};
static PyObject *__pyx_pw_3hug_10decorators_19not_found(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_output = 0;
  PyObject *__pyx_v_versions = 0;
  PyObject *__pyx_v_parse_body = 0;
  PyObject *__pyx_v_transform = 0;
  PyObject *__pyx_v_requires = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("not_found (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_output,&__pyx_n_s_versions,&__pyx_n_s_parse_body,&__pyx_n_s_transform,&__pyx_n_s_requires,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[0] = ((PyObject *)((PyObject *)Py_None));
    values[1] = ((PyObject *)((PyObject *)Py_None));
    values[2] = ((PyObject *)((PyObject *)Py_False));
    values[3] = ((PyObject *)((PyObject *)Py_None));
    values[4] = ((PyObject *)((PyObject*)__pyx_empty_tuple));
    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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_output);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_versions);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parse_body);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_transform);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_requires);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "not_found") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_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;
      }
    }
    __pyx_v_output = values[0];
    __pyx_v_versions = values[1];
    __pyx_v_parse_body = values[2];
    __pyx_v_transform = values[3];
    __pyx_v_requires = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("not_found", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("hug.decorators.not_found", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3hug_10decorators_18not_found(__pyx_self, __pyx_v_output, __pyx_v_versions, __pyx_v_parse_body, __pyx_v_transform, __pyx_v_requires);

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

/* "hug/decorators.py":430
 *     requires = (requires, ) if not isinstance(requires, (tuple, list)) else requires
 * 
 *     def decorator(api_function):             # <<<<<<<<<<<<<<
 *         module = _api_module(api_function.__module__)
 *         (interface, callable_method) = _create_interface(module, api_function, output=output,
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_9not_found_1decorator(PyObject *__pyx_self, PyObject *__pyx_v_api_function); /*proto*/
static PyMethodDef __pyx_mdef_3hug_10decorators_9not_found_1decorator = {"decorator", (PyCFunction)__pyx_pw_3hug_10decorators_9not_found_1decorator, METH_O, 0};
static PyObject *__pyx_pw_3hug_10decorators_9not_found_1decorator(PyObject *__pyx_self, PyObject *__pyx_v_api_function) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decorator (wrapper)", 0);
  __pyx_r = __pyx_pf_3hug_10decorators_9not_found_decorator(__pyx_self, ((PyObject *)__pyx_v_api_function));

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

static PyObject *__pyx_pf_3hug_10decorators_9not_found_decorator(PyObject *__pyx_self, PyObject *__pyx_v_api_function) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_7_not_found *__pyx_cur_scope;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_7_not_found *__pyx_outer_scope;
  PyObject *__pyx_v_module = NULL;
  PyObject *__pyx_v_interface = NULL;
  PyObject *__pyx_v_callable_method = NULL;
  PyObject *__pyx_v_version = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  Py_ssize_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decorator", 0);
  __pyx_outer_scope = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_7_not_found *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "hug/decorators.py":431
 * 
 *     def decorator(api_function):
 *         module = _api_module(api_function.__module__)             # <<<<<<<<<<<<<<
 *         (interface, callable_method) = _create_interface(module, api_function, output=output,
 *                                                          versions=versions, parse_body=parse_body,
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_api_module); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_api_function, __pyx_n_s_module_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __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_2); __pyx_t_2 = 0;
  __pyx_v_module = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "hug/decorators.py":432
 *     def decorator(api_function):
 *         module = _api_module(api_function.__module__)
 *         (interface, callable_method) = _create_interface(module, api_function, output=output,             # <<<<<<<<<<<<<<
 *                                                          versions=versions, parse_body=parse_body,
 *                                                          set_status=falcon.HTTP_NOT_FOUND, transform=transform,
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_create_interface); 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_t_2 = PyTuple_New(2); 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_module);
  __Pyx_GIVEREF(__pyx_v_module);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_module);
  __Pyx_INCREF(__pyx_v_api_function);
  __Pyx_GIVEREF(__pyx_v_api_function);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_api_function);
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (unlikely(!__pyx_cur_scope->__pyx_v_output)) { __Pyx_RaiseClosureNameError("output"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_output, __pyx_cur_scope->__pyx_v_output) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":433
 *         module = _api_module(api_function.__module__)
 *         (interface, callable_method) = _create_interface(module, api_function, output=output,
 *                                                          versions=versions, parse_body=parse_body,             # <<<<<<<<<<<<<<
 *                                                          set_status=falcon.HTTP_NOT_FOUND, transform=transform,
 *                                                          requires=requires)
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_versions)) { __Pyx_RaiseClosureNameError("versions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_versions, __pyx_cur_scope->__pyx_v_versions) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_v_parse_body)) { __Pyx_RaiseClosureNameError("parse_body"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_parse_body, __pyx_cur_scope->__pyx_v_parse_body) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":434
 *         (interface, callable_method) = _create_interface(module, api_function, output=output,
 *                                                          versions=versions, parse_body=parse_body,
 *                                                          set_status=falcon.HTTP_NOT_FOUND, transform=transform,             # <<<<<<<<<<<<<<
 *                                                          requires=requires)
 * 
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_falcon); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_HTTP_NOT_FOUND); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __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_t_5, __pyx_n_s_set_status, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_cur_scope->__pyx_v_transform)) { __Pyx_RaiseClosureNameError("transform"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_transform, __pyx_cur_scope->__pyx_v_transform) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":435
 *                                                          versions=versions, parse_body=parse_body,
 *                                                          set_status=falcon.HTTP_NOT_FOUND, transform=transform,
 *                                                          requires=requires)             # <<<<<<<<<<<<<<
 * 
 *         for version in versions:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_requires)) { __Pyx_RaiseClosureNameError("requires"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_requires, __pyx_cur_scope->__pyx_v_requires) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":432
 *     def decorator(api_function):
 *         module = _api_module(api_function.__module__)
 *         (interface, callable_method) = _create_interface(module, api_function, output=output,             # <<<<<<<<<<<<<<
 *                                                          versions=versions, parse_body=parse_body,
 *                                                          set_status=falcon.HTTP_NOT_FOUND, transform=transform,
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __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_5); __pyx_t_5 = 0;
  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 = 432; __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_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); 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);
    #endif
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext;
    index = 0; __pyx_t_5 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_interface = __pyx_t_5;
  __pyx_t_5 = 0;
  __pyx_v_callable_method = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "hug/decorators.py":437
 *                                                          requires=requires)
 * 
 *         for version in versions:             # <<<<<<<<<<<<<<
 *             module.__hug__.set_not_found_handler(interface, version)
 * 
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_versions)) { __Pyx_RaiseClosureNameError("versions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_versions)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_versions)) {
    __pyx_t_4 = __pyx_cur_scope->__pyx_v_versions; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_versions); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_8(__pyx_t_4);
      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 = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_version, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "hug/decorators.py":438
 * 
 *         for version in versions:
 *             module.__hug__.set_not_found_handler(interface, version)             # <<<<<<<<<<<<<<
 * 
 *         return callable_method
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_module, __pyx_n_s_hug_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_set_not_found_handler); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_9 = 1;
      }
    }
    __pyx_t_3 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_v_interface);
    __Pyx_GIVEREF(__pyx_v_interface);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_9, __pyx_v_interface);
    __Pyx_INCREF(__pyx_v_version);
    __Pyx_GIVEREF(__pyx_v_version);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_9, __pyx_v_version);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __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;

    /* "hug/decorators.py":437
 *                                                          requires=requires)
 * 
 *         for version in versions:             # <<<<<<<<<<<<<<
 *             module.__hug__.set_not_found_handler(interface, version)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "hug/decorators.py":440
 *             module.__hug__.set_not_found_handler(interface, version)
 * 
 *         return callable_method             # <<<<<<<<<<<<<<
 *     return decorator
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_callable_method);
  __pyx_r = __pyx_v_callable_method;
  goto __pyx_L0;

  /* "hug/decorators.py":430
 *     requires = (requires, ) if not isinstance(requires, (tuple, list)) else requires
 * 
 *     def decorator(api_function):             # <<<<<<<<<<<<<<
 *         module = _api_module(api_function.__module__)
 *         (interface, callable_method) = _create_interface(module, api_function, output=output,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("hug.decorators.not_found.decorator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_module);
  __Pyx_XDECREF(__pyx_v_interface);
  __Pyx_XDECREF(__pyx_v_callable_method);
  __Pyx_XDECREF(__pyx_v_version);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":425
 * 
 * 
 * def not_found(output=None, versions=None, parse_body=False, transform=None, requires=()):             # <<<<<<<<<<<<<<
 *     '''A decorator to register a 404 handler'''
 *     versions = (versions, ) if isinstance(versions, (int, float, None.__class__)) else versions
 */

static PyObject *__pyx_pf_3hug_10decorators_18not_found(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_output, PyObject *__pyx_v_versions, PyObject *__pyx_v_parse_body, PyObject *__pyx_v_transform, PyObject *__pyx_v_requires) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_7_not_found *__pyx_cur_scope;
  PyObject *__pyx_v_decorator = 0;
  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_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("not_found", 0);
  __pyx_cur_scope = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_7_not_found *)__pyx_tp_new_3hug_10decorators___pyx_scope_struct_7_not_found(__pyx_ptype_3hug_10decorators___pyx_scope_struct_7_not_found, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_output = __pyx_v_output;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_output);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_output);
  __pyx_cur_scope->__pyx_v_versions = __pyx_v_versions;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_versions);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_versions);
  __pyx_cur_scope->__pyx_v_parse_body = __pyx_v_parse_body;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_parse_body);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_parse_body);
  __pyx_cur_scope->__pyx_v_transform = __pyx_v_transform;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_transform);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_transform);
  __pyx_cur_scope->__pyx_v_requires = __pyx_v_requires;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_requires);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_requires);

  /* "hug/decorators.py":427
 * def not_found(output=None, versions=None, parse_body=False, transform=None, requires=()):
 *     '''A decorator to register a 404 handler'''
 *     versions = (versions, ) if isinstance(versions, (int, float, None.__class__)) else versions             # <<<<<<<<<<<<<<
 *     requires = (requires, ) if not isinstance(requires, (tuple, list)) else requires
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(Py_None, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __pyx_cur_scope->__pyx_v_versions;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = PyInt_Check(__pyx_t_4); 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (!__pyx_t_6) {
  } else {
    __pyx_t_3 = __pyx_t_6;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_4 = __pyx_cur_scope->__pyx_v_versions;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_6 = PyFloat_Check(__pyx_t_4); 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_3 = __pyx_t_5;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_4 = __pyx_cur_scope->__pyx_v_versions;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = PyObject_IsInstance(__pyx_t_4, __pyx_t_2); 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  __pyx_t_3 = __pyx_t_6;
  __pyx_L3_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((__pyx_t_3 != 0)) {
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_versions);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_versions);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_versions);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_versions);
    __pyx_t_1 = __pyx_cur_scope->__pyx_v_versions;
  }
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_versions);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_versions, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "hug/decorators.py":428
 *     '''A decorator to register a 404 handler'''
 *     versions = (versions, ) if isinstance(versions, (int, float, None.__class__)) else versions
 *     requires = (requires, ) if not isinstance(requires, (tuple, list)) else requires             # <<<<<<<<<<<<<<
 * 
 *     def decorator(api_function):
 */
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_requires;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_6 = PyTuple_Check(__pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_3 = __pyx_t_5;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_requires;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = PyList_Check(__pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  __pyx_t_3 = __pyx_t_6;
  __pyx_L6_bool_binop_done:;
  if (((!(__pyx_t_3 != 0)) != 0)) {
    __pyx_t_2 = PyTuple_New(1); 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_INCREF(__pyx_cur_scope->__pyx_v_requires);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_requires);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_requires);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_requires);
    __pyx_t_1 = __pyx_cur_scope->__pyx_v_requires;
  }
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_requires);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_requires, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "hug/decorators.py":430
 *     requires = (requires, ) if not isinstance(requires, (tuple, list)) else requires
 * 
 *     def decorator(api_function):             # <<<<<<<<<<<<<<
 *         module = _api_module(api_function.__module__)
 *         (interface, callable_method) = _create_interface(module, api_function, output=output,
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_9not_found_1decorator, 0, __pyx_n_s_not_found_locals_decorator, ((PyObject*)__pyx_cur_scope), __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_decorator = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "hug/decorators.py":441
 * 
 *         return callable_method
 *     return decorator             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_decorator);
  __pyx_r = __pyx_v_decorator;
  goto __pyx_L0;

  /* "hug/decorators.py":425
 * 
 * 
 * def not_found(output=None, versions=None, parse_body=False, transform=None, requires=()):             # <<<<<<<<<<<<<<
 *     '''A decorator to register a 404 handler'''
 *     versions = (versions, ) if isinstance(versions, (int, float, None.__class__)) else versions
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("hug.decorators.not_found", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_decorator);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":444
 * 
 * 
 * def call(urls=None, accept=HTTP_METHODS, parameters=None, defaults={}, output=None, examples=(), versions=None,             # <<<<<<<<<<<<<<
 *          parse_body=True, transform=None, requires=()):
 *     '''Defines the base Hug API creating decorator, which exposes normal python methods as HTTP APIs'''
 */

static PyObject *__pyx_pf_3hug_10decorators_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);

  /* "hug/decorators.py":445
 * 
 * def call(urls=None, accept=HTTP_METHODS, parameters=None, defaults={}, output=None, examples=(), versions=None,
 *          parse_body=True, transform=None, requires=()):             # <<<<<<<<<<<<<<
 *     '''Defines the base Hug API creating decorator, which exposes normal python methods as HTTP APIs'''
 *     urls = (urls, ) if isinstance(urls, str) else urls
 */
  __pyx_t_1 = PyTuple_New(10); 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(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_None));
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_accept);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_accept);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_accept);
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)Py_None));
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_defaults);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_defaults);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_defaults);
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)Py_None));
  __Pyx_INCREF(((PyObject*)__pyx_empty_tuple));
  __Pyx_GIVEREF(((PyObject*)__pyx_empty_tuple));
  PyTuple_SET_ITEM(__pyx_t_1, 5, ((PyObject*)__pyx_empty_tuple));
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 6, ((PyObject *)Py_None));
  __Pyx_INCREF(((PyObject *)Py_True));
  __Pyx_GIVEREF(((PyObject *)Py_True));
  PyTuple_SET_ITEM(__pyx_t_1, 7, ((PyObject *)Py_True));
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 8, ((PyObject *)Py_None));
  __Pyx_INCREF(((PyObject*)__pyx_empty_tuple));
  __Pyx_GIVEREF(((PyObject*)__pyx_empty_tuple));
  PyTuple_SET_ITEM(__pyx_t_1, 9, ((PyObject*)__pyx_empty_tuple));

  /* "hug/decorators.py":444
 * 
 * 
 * def call(urls=None, accept=HTTP_METHODS, parameters=None, defaults={}, output=None, examples=(), versions=None,             # <<<<<<<<<<<<<<
 *          parse_body=True, transform=None, requires=()):
 *     '''Defines the base Hug API creating decorator, which exposes normal python methods as HTTP APIs'''
 */
  __pyx_t_2 = PyTuple_New(2); 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_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, 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("hug.decorators.__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_3hug_10decorators_21call(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3hug_10decorators_20call[] = "Defines the base Hug API creating decorator, which exposes normal python methods as HTTP APIs";
static PyMethodDef __pyx_mdef_3hug_10decorators_21call = {"call", (PyCFunction)__pyx_pw_3hug_10decorators_21call, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3hug_10decorators_20call};
static PyObject *__pyx_pw_3hug_10decorators_21call(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_urls = 0;
  PyObject *__pyx_v_accept = 0;
  PyObject *__pyx_v_parameters = 0;
  PyObject *__pyx_v_defaults = 0;
  PyObject *__pyx_v_output = 0;
  PyObject *__pyx_v_examples = 0;
  PyObject *__pyx_v_versions = 0;
  PyObject *__pyx_v_parse_body = 0;
  PyObject *__pyx_v_transform = 0;
  PyObject *__pyx_v_requires = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("call (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_urls,&__pyx_n_s_accept,&__pyx_n_s_parameters,&__pyx_n_s_defaults,&__pyx_n_s_output,&__pyx_n_s_examples,&__pyx_n_s_versions,&__pyx_n_s_parse_body,&__pyx_n_s_transform,&__pyx_n_s_requires,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[0] = ((PyObject *)((PyObject *)Py_None));
    values[1] = __pyx_dynamic_args->__pyx_arg_accept;
    values[2] = ((PyObject *)((PyObject *)Py_None));
    values[3] = __pyx_dynamic_args->__pyx_arg_defaults;
    values[4] = ((PyObject *)((PyObject *)Py_None));
    values[5] = ((PyObject *)((PyObject*)__pyx_empty_tuple));
    values[6] = ((PyObject *)((PyObject *)Py_None));
    values[7] = ((PyObject *)((PyObject *)Py_True));
    values[8] = ((PyObject *)((PyObject *)Py_None));
    values[9] = ((PyObject *)((PyObject*)__pyx_empty_tuple));
    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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_urls);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_accept);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parameters);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_defaults);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_output);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_examples);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_versions);
          if (value) { values[6] = value; kw_args--; }
        }
        case  7:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parse_body);
          if (value) { values[7] = value; kw_args--; }
        }
        case  8:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_transform);
          if (value) { values[8] = value; kw_args--; }
        }
        case  9:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_requires);
          if (value) { values[9] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "call") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __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);
        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;
      }
    }
    __pyx_v_urls = values[0];
    __pyx_v_accept = values[1];
    __pyx_v_parameters = values[2];
    __pyx_v_defaults = values[3];
    __pyx_v_output = values[4];
    __pyx_v_examples = values[5];
    __pyx_v_versions = values[6];
    __pyx_v_parse_body = values[7];
    __pyx_v_transform = values[8];
    __pyx_v_requires = values[9];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("call", 0, 0, 10, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("hug.decorators.call", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3hug_10decorators_20call(__pyx_self, __pyx_v_urls, __pyx_v_accept, __pyx_v_parameters, __pyx_v_defaults, __pyx_v_output, __pyx_v_examples, __pyx_v_versions, __pyx_v_parse_body, __pyx_v_transform, __pyx_v_requires);

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

/* "hug/decorators.py":452
 *     requires = (requires, ) if not isinstance(requires, (tuple, list)) else requires
 * 
 *     def decorator(api_function):             # <<<<<<<<<<<<<<
 *         module = _api_module(api_function.__module__)
 *         (interface, callable_method) = _create_interface(module, api_function, output=output,
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_4call_1decorator(PyObject *__pyx_self, PyObject *__pyx_v_api_function); /*proto*/
static PyMethodDef __pyx_mdef_3hug_10decorators_4call_1decorator = {"decorator", (PyCFunction)__pyx_pw_3hug_10decorators_4call_1decorator, METH_O, 0};
static PyObject *__pyx_pw_3hug_10decorators_4call_1decorator(PyObject *__pyx_self, PyObject *__pyx_v_api_function) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decorator (wrapper)", 0);
  __pyx_r = __pyx_pf_3hug_10decorators_4call_decorator(__pyx_self, ((PyObject *)__pyx_v_api_function));

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

static PyObject *__pyx_pf_3hug_10decorators_4call_decorator(PyObject *__pyx_self, PyObject *__pyx_v_api_function) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_8_call *__pyx_cur_scope;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_8_call *__pyx_outer_scope;
  PyObject *__pyx_v_module = NULL;
  PyObject *__pyx_v_interface = NULL;
  PyObject *__pyx_v_callable_method = NULL;
  PyObject *__pyx_v_use_examples = NULL;
  PyObject *__pyx_v_url = NULL;
  PyObject *__pyx_v_handlers = NULL;
  PyObject *__pyx_v_method = NULL;
  PyObject *__pyx_v_version_mapping = NULL;
  PyObject *__pyx_v_version = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  Py_ssize_t __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  PyObject *__pyx_t_15 = NULL;
  Py_ssize_t __pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *(*__pyx_t_18)(PyObject *);
  Py_ssize_t __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decorator", 0);
  __pyx_outer_scope = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_8_call *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "hug/decorators.py":453
 * 
 *     def decorator(api_function):
 *         module = _api_module(api_function.__module__)             # <<<<<<<<<<<<<<
 *         (interface, callable_method) = _create_interface(module, api_function, output=output,
 *                                                          parameters=parameters, defaults=defaults,
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_api_module); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_api_function, __pyx_n_s_module_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __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_2); __pyx_t_2 = 0;
  __pyx_v_module = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "hug/decorators.py":454
 *     def decorator(api_function):
 *         module = _api_module(api_function.__module__)
 *         (interface, callable_method) = _create_interface(module, api_function, output=output,             # <<<<<<<<<<<<<<
 *                                                          parameters=parameters, defaults=defaults,
 *                                                          versions=versions, parse_body=parse_body, transform=transform,
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_create_interface); 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_t_2 = PyTuple_New(2); 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_module);
  __Pyx_GIVEREF(__pyx_v_module);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_module);
  __Pyx_INCREF(__pyx_v_api_function);
  __Pyx_GIVEREF(__pyx_v_api_function);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_api_function);
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (unlikely(!__pyx_cur_scope->__pyx_v_output)) { __Pyx_RaiseClosureNameError("output"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_output, __pyx_cur_scope->__pyx_v_output) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":455
 *         module = _api_module(api_function.__module__)
 *         (interface, callable_method) = _create_interface(module, api_function, output=output,
 *                                                          parameters=parameters, defaults=defaults,             # <<<<<<<<<<<<<<
 *                                                          versions=versions, parse_body=parse_body, transform=transform,
 *                                                          requires=requires)
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_parameters)) { __Pyx_RaiseClosureNameError("parameters"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_parameters, __pyx_cur_scope->__pyx_v_parameters) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_v_defaults)) { __Pyx_RaiseClosureNameError("defaults"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_defaults, __pyx_cur_scope->__pyx_v_defaults) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":456
 *         (interface, callable_method) = _create_interface(module, api_function, output=output,
 *                                                          parameters=parameters, defaults=defaults,
 *                                                          versions=versions, parse_body=parse_body, transform=transform,             # <<<<<<<<<<<<<<
 *                                                          requires=requires)
 * 
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_versions)) { __Pyx_RaiseClosureNameError("versions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_versions, __pyx_cur_scope->__pyx_v_versions) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_v_parse_body)) { __Pyx_RaiseClosureNameError("parse_body"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_parse_body, __pyx_cur_scope->__pyx_v_parse_body) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_v_transform)) { __Pyx_RaiseClosureNameError("transform"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_transform, __pyx_cur_scope->__pyx_v_transform) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":457
 *                                                          parameters=parameters, defaults=defaults,
 *                                                          versions=versions, parse_body=parse_body, transform=transform,
 *                                                          requires=requires)             # <<<<<<<<<<<<<<
 * 
 *         use_examples = examples
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_requires)) { __Pyx_RaiseClosureNameError("requires"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_requires, __pyx_cur_scope->__pyx_v_requires) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":454
 *     def decorator(api_function):
 *         module = _api_module(api_function.__module__)
 *         (interface, callable_method) = _create_interface(module, api_function, output=output,             # <<<<<<<<<<<<<<
 *                                                          parameters=parameters, defaults=defaults,
 *                                                          versions=versions, parse_body=parse_body, transform=transform,
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __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_5); __pyx_t_5 = 0;
  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 = 454; __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_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PySequence_ITEM(sequence, 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);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext;
    index = 0; __pyx_t_5 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_interface = __pyx_t_5;
  __pyx_t_5 = 0;
  __pyx_v_callable_method = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "hug/decorators.py":459
 *                                                          requires=requires)
 * 
 *         use_examples = examples             # <<<<<<<<<<<<<<
 *         if not interface.required and not use_examples:
 *             use_examples = (True, )
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_examples)) { __Pyx_RaiseClosureNameError("examples"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_examples);
  __pyx_v_use_examples = __pyx_cur_scope->__pyx_v_examples;

  /* "hug/decorators.py":460
 * 
 *         use_examples = examples
 *         if not interface.required and not use_examples:             # <<<<<<<<<<<<<<
 *             use_examples = (True, )
 *         for url in urls or ("/{0}".format(api_function.__name__), ):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_interface, __pyx_n_s_required); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_9 = ((!__pyx_t_8) != 0);
  if (__pyx_t_9) {
  } else {
    __pyx_t_7 = __pyx_t_9;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_use_examples); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((!__pyx_t_9) != 0);
  __pyx_t_7 = __pyx_t_8;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_7) {

    /* "hug/decorators.py":461
 *         use_examples = examples
 *         if not interface.required and not use_examples:
 *             use_examples = (True, )             # <<<<<<<<<<<<<<
 *         for url in urls or ("/{0}".format(api_function.__name__), ):
 *             handlers = module.__hug__.routes.setdefault(url, {})
 */
    __Pyx_INCREF(__pyx_tuple__32);
    __Pyx_DECREF_SET(__pyx_v_use_examples, __pyx_tuple__32);

    /* "hug/decorators.py":460
 * 
 *         use_examples = examples
 *         if not interface.required and not use_examples:             # <<<<<<<<<<<<<<
 *             use_examples = (True, )
 *         for url in urls or ("/{0}".format(api_function.__name__), ):
 */
  }

  /* "hug/decorators.py":462
 *         if not interface.required and not use_examples:
 *             use_examples = (True, )
 *         for url in urls or ("/{0}".format(api_function.__name__), ):             # <<<<<<<<<<<<<<
 *             handlers = module.__hug__.routes.setdefault(url, {})
 *             for method in accept:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_urls)) { __Pyx_RaiseClosureNameError("urls"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_urls); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!__pyx_t_7) {
  } else {
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_urls);
    __pyx_t_3 = __pyx_cur_scope->__pyx_v_urls;
    goto __pyx_L10_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_api_function, __pyx_n_s_name_2); 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_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_3 = __pyx_t_5;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_L10_bool_binop_done:;
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_5 = __pyx_t_3; __Pyx_INCREF(__pyx_t_5); __pyx_t_11 = 0;
    __pyx_t_12 = NULL;
  } else {
    __pyx_t_11 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_12 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_12)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_12(__pyx_t_5);
      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 = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_url, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "hug/decorators.py":463
 *             use_examples = (True, )
 *         for url in urls or ("/{0}".format(api_function.__name__), ):
 *             handlers = module.__hug__.routes.setdefault(url, {})             # <<<<<<<<<<<<<<
 *             for method in accept:
 *                 version_mapping = handlers.setdefault(method.upper(), {})
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_module, __pyx_n_s_hug_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_routes); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_setdefault); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_1 = NULL;
    __pyx_t_13 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_13 = 1;
      }
    }
    __pyx_t_4 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (__pyx_t_1) {
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = NULL;
    }
    __Pyx_INCREF(__pyx_v_url);
    __Pyx_GIVEREF(__pyx_v_url);
    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_13, __pyx_v_url);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_13, __pyx_t_10);
    __pyx_t_10 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __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;
    __Pyx_XDECREF_SET(__pyx_v_handlers, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "hug/decorators.py":464
 *         for url in urls or ("/{0}".format(api_function.__name__), ):
 *             handlers = module.__hug__.routes.setdefault(url, {})
 *             for method in accept:             # <<<<<<<<<<<<<<
 *                 version_mapping = handlers.setdefault(method.upper(), {})
 *                 for version in versions:
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_accept)) { __Pyx_RaiseClosureNameError("accept"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_accept)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_accept)) {
      __pyx_t_3 = __pyx_cur_scope->__pyx_v_accept; __Pyx_INCREF(__pyx_t_3); __pyx_t_13 = 0;
      __pyx_t_14 = NULL;
    } else {
      __pyx_t_13 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_accept); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_14 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    for (;;) {
      if (likely(!__pyx_t_14)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_14(__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 = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_v_method, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "hug/decorators.py":465
 *             handlers = module.__hug__.routes.setdefault(url, {})
 *             for method in accept:
 *                 version_mapping = handlers.setdefault(method.upper(), {})             # <<<<<<<<<<<<<<
 *                 for version in versions:
 *                     version_mapping[version] = interface
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_handlers, __pyx_n_s_setdefault); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_method, __pyx_n_s_upper); 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_15 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_15)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_15);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (__pyx_t_15) {
        __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_15); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      } else {
        __pyx_t_10 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); 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_15 = NULL;
      __pyx_t_16 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_15)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_15);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_16 = 1;
        }
      }
      __pyx_t_17 = PyTuple_New(2+__pyx_t_16); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_17);
      if (__pyx_t_15) {
        __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_15); __pyx_t_15 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_16, __pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_16, __pyx_t_1);
      __pyx_t_10 = 0;
      __pyx_t_1 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_17, 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_17); __pyx_t_17 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_version_mapping, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "hug/decorators.py":466
 *             for method in accept:
 *                 version_mapping = handlers.setdefault(method.upper(), {})
 *                 for version in versions:             # <<<<<<<<<<<<<<
 *                     version_mapping[version] = interface
 *                     module.__hug__.versioned.setdefault(version, {})[callable_method.__name__] = callable_method
 */
      if (unlikely(!__pyx_cur_scope->__pyx_v_versions)) { __Pyx_RaiseClosureNameError("versions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
      if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_versions)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_versions)) {
        __pyx_t_2 = __pyx_cur_scope->__pyx_v_versions; __Pyx_INCREF(__pyx_t_2); __pyx_t_16 = 0;
        __pyx_t_18 = NULL;
      } else {
        __pyx_t_16 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_versions); 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_t_18 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      for (;;) {
        if (likely(!__pyx_t_18)) {
          if (likely(PyList_CheckExact(__pyx_t_2))) {
            if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_2)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_16); __Pyx_INCREF(__pyx_t_4); __pyx_t_16++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          } else {
            if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_16); __Pyx_INCREF(__pyx_t_4); __pyx_t_16++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          }
        } else {
          __pyx_t_4 = __pyx_t_18(__pyx_t_2);
          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 = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_XDECREF_SET(__pyx_v_version, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "hug/decorators.py":467
 *                 version_mapping = handlers.setdefault(method.upper(), {})
 *                 for version in versions:
 *                     version_mapping[version] = interface             # <<<<<<<<<<<<<<
 *                     module.__hug__.versioned.setdefault(version, {})[callable_method.__name__] = callable_method
 * 
 */
        if (unlikely(PyObject_SetItem(__pyx_v_version_mapping, __pyx_v_version, __pyx_v_interface) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "hug/decorators.py":468
 *                 for version in versions:
 *                     version_mapping[version] = interface
 *                     module.__hug__.versioned.setdefault(version, {})[callable_method.__name__] = callable_method             # <<<<<<<<<<<<<<
 * 
 *         interface.examples = use_examples
 */
        __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_module, __pyx_n_s_hug_3); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_17);
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_versioned); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_setdefault); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_17);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_10 = NULL;
        __pyx_t_19 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_17))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_17);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_17, function);
            __pyx_t_19 = 1;
          }
        }
        __pyx_t_15 = PyTuple_New(2+__pyx_t_19); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_15);
        if (__pyx_t_10) {
          __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_10); __pyx_t_10 = NULL;
        }
        __Pyx_INCREF(__pyx_v_version);
        __Pyx_GIVEREF(__pyx_v_version);
        PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_19, __pyx_v_version);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_19, __pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_15, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_callable_method, __pyx_n_s_name_2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_17);
        if (unlikely(PyObject_SetItem(__pyx_t_4, __pyx_t_17, __pyx_v_callable_method) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

        /* "hug/decorators.py":466
 *             for method in accept:
 *                 version_mapping = handlers.setdefault(method.upper(), {})
 *                 for version in versions:             # <<<<<<<<<<<<<<
 *                     version_mapping[version] = interface
 *                     module.__hug__.versioned.setdefault(version, {})[callable_method.__name__] = callable_method
 */
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "hug/decorators.py":464
 *         for url in urls or ("/{0}".format(api_function.__name__), ):
 *             handlers = module.__hug__.routes.setdefault(url, {})
 *             for method in accept:             # <<<<<<<<<<<<<<
 *                 version_mapping = handlers.setdefault(method.upper(), {})
 *                 for version in versions:
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "hug/decorators.py":462
 *         if not interface.required and not use_examples:
 *             use_examples = (True, )
 *         for url in urls or ("/{0}".format(api_function.__name__), ):             # <<<<<<<<<<<<<<
 *             handlers = module.__hug__.routes.setdefault(url, {})
 *             for method in accept:
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "hug/decorators.py":470
 *                     module.__hug__.versioned.setdefault(version, {})[callable_method.__name__] = callable_method
 * 
 *         interface.examples = use_examples             # <<<<<<<<<<<<<<
 *         return callable_method
 *     return decorator
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_interface, __pyx_n_s_examples, __pyx_v_use_examples) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":471
 * 
 *         interface.examples = use_examples
 *         return callable_method             # <<<<<<<<<<<<<<
 *     return decorator
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_callable_method);
  __pyx_r = __pyx_v_callable_method;
  goto __pyx_L0;

  /* "hug/decorators.py":452
 *     requires = (requires, ) if not isinstance(requires, (tuple, list)) else requires
 * 
 *     def decorator(api_function):             # <<<<<<<<<<<<<<
 *         module = _api_module(api_function.__module__)
 *         (interface, callable_method) = _create_interface(module, api_function, output=output,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("hug.decorators.call.decorator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_module);
  __Pyx_XDECREF(__pyx_v_interface);
  __Pyx_XDECREF(__pyx_v_callable_method);
  __Pyx_XDECREF(__pyx_v_use_examples);
  __Pyx_XDECREF(__pyx_v_url);
  __Pyx_XDECREF(__pyx_v_handlers);
  __Pyx_XDECREF(__pyx_v_method);
  __Pyx_XDECREF(__pyx_v_version_mapping);
  __Pyx_XDECREF(__pyx_v_version);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":444
 * 
 * 
 * def call(urls=None, accept=HTTP_METHODS, parameters=None, defaults={}, output=None, examples=(), versions=None,             # <<<<<<<<<<<<<<
 *          parse_body=True, transform=None, requires=()):
 *     '''Defines the base Hug API creating decorator, which exposes normal python methods as HTTP APIs'''
 */

static PyObject *__pyx_pf_3hug_10decorators_20call(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_urls, PyObject *__pyx_v_accept, PyObject *__pyx_v_parameters, PyObject *__pyx_v_defaults, PyObject *__pyx_v_output, PyObject *__pyx_v_examples, PyObject *__pyx_v_versions, PyObject *__pyx_v_parse_body, PyObject *__pyx_v_transform, PyObject *__pyx_v_requires) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_8_call *__pyx_cur_scope;
  PyObject *__pyx_v_decorator = 0;
  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_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("call", 0);
  __pyx_cur_scope = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_8_call *)__pyx_tp_new_3hug_10decorators___pyx_scope_struct_8_call(__pyx_ptype_3hug_10decorators___pyx_scope_struct_8_call, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_urls = __pyx_v_urls;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_urls);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_urls);
  __pyx_cur_scope->__pyx_v_accept = __pyx_v_accept;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_accept);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_accept);
  __pyx_cur_scope->__pyx_v_parameters = __pyx_v_parameters;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_parameters);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_parameters);
  __pyx_cur_scope->__pyx_v_defaults = __pyx_v_defaults;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_defaults);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_defaults);
  __pyx_cur_scope->__pyx_v_output = __pyx_v_output;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_output);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_output);
  __pyx_cur_scope->__pyx_v_examples = __pyx_v_examples;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_examples);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_examples);
  __pyx_cur_scope->__pyx_v_versions = __pyx_v_versions;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_versions);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_versions);
  __pyx_cur_scope->__pyx_v_parse_body = __pyx_v_parse_body;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_parse_body);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_parse_body);
  __pyx_cur_scope->__pyx_v_transform = __pyx_v_transform;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_transform);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_transform);
  __pyx_cur_scope->__pyx_v_requires = __pyx_v_requires;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_requires);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_requires);

  /* "hug/decorators.py":447
 *          parse_body=True, transform=None, requires=()):
 *     '''Defines the base Hug API creating decorator, which exposes normal python methods as HTTP APIs'''
 *     urls = (urls, ) if isinstance(urls, str) else urls             # <<<<<<<<<<<<<<
 *     examples = (examples, ) if isinstance(examples, str) else examples
 *     versions = (versions, ) if isinstance(versions, (int, float, None.__class__)) else versions
 */
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_urls;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = PyString_Check(__pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((__pyx_t_3 != 0)) {
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_urls);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_urls);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_urls);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_urls);
    __pyx_t_1 = __pyx_cur_scope->__pyx_v_urls;
  }
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_urls);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_urls, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "hug/decorators.py":448
 *     '''Defines the base Hug API creating decorator, which exposes normal python methods as HTTP APIs'''
 *     urls = (urls, ) if isinstance(urls, str) else urls
 *     examples = (examples, ) if isinstance(examples, str) else examples             # <<<<<<<<<<<<<<
 *     versions = (versions, ) if isinstance(versions, (int, float, None.__class__)) else versions
 *     requires = (requires, ) if not isinstance(requires, (tuple, list)) else requires
 */
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_examples;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = PyString_Check(__pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((__pyx_t_3 != 0)) {
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_examples);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_examples);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_examples);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_examples);
    __pyx_t_1 = __pyx_cur_scope->__pyx_v_examples;
  }
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_examples);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_examples, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "hug/decorators.py":449
 *     urls = (urls, ) if isinstance(urls, str) else urls
 *     examples = (examples, ) if isinstance(examples, str) else examples
 *     versions = (versions, ) if isinstance(versions, (int, float, None.__class__)) else versions             # <<<<<<<<<<<<<<
 *     requires = (requires, ) if not isinstance(requires, (tuple, list)) else requires
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(Py_None, __pyx_n_s_class); 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_t_4 = __pyx_cur_scope->__pyx_v_versions;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = PyInt_Check(__pyx_t_4); 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (!__pyx_t_6) {
  } else {
    __pyx_t_3 = __pyx_t_6;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_4 = __pyx_cur_scope->__pyx_v_versions;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_6 = PyFloat_Check(__pyx_t_4); 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_3 = __pyx_t_5;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_4 = __pyx_cur_scope->__pyx_v_versions;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = PyObject_IsInstance(__pyx_t_4, __pyx_t_2); 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  __pyx_t_3 = __pyx_t_6;
  __pyx_L3_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((__pyx_t_3 != 0)) {
    __pyx_t_2 = PyTuple_New(1); 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_INCREF(__pyx_cur_scope->__pyx_v_versions);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_versions);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_versions);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_versions);
    __pyx_t_1 = __pyx_cur_scope->__pyx_v_versions;
  }
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_versions);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_versions, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "hug/decorators.py":450
 *     examples = (examples, ) if isinstance(examples, str) else examples
 *     versions = (versions, ) if isinstance(versions, (int, float, None.__class__)) else versions
 *     requires = (requires, ) if not isinstance(requires, (tuple, list)) else requires             # <<<<<<<<<<<<<<
 * 
 *     def decorator(api_function):
 */
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_requires;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_6 = PyTuple_Check(__pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_3 = __pyx_t_5;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_requires;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = PyList_Check(__pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  __pyx_t_3 = __pyx_t_6;
  __pyx_L6_bool_binop_done:;
  if (((!(__pyx_t_3 != 0)) != 0)) {
    __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_cur_scope->__pyx_v_requires);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_requires);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_requires);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_requires);
    __pyx_t_1 = __pyx_cur_scope->__pyx_v_requires;
  }
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_requires);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_requires, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "hug/decorators.py":452
 *     requires = (requires, ) if not isinstance(requires, (tuple, list)) else requires
 * 
 *     def decorator(api_function):             # <<<<<<<<<<<<<<
 *         module = _api_module(api_function.__module__)
 *         (interface, callable_method) = _create_interface(module, api_function, output=output,
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_4call_1decorator, 0, __pyx_n_s_call_locals_decorator, ((PyObject*)__pyx_cur_scope), __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_decorator = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "hug/decorators.py":472
 *         interface.examples = use_examples
 *         return callable_method
 *     return decorator             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_decorator);
  __pyx_r = __pyx_v_decorator;
  goto __pyx_L0;

  /* "hug/decorators.py":444
 * 
 * 
 * def call(urls=None, accept=HTTP_METHODS, parameters=None, defaults={}, output=None, examples=(), versions=None,             # <<<<<<<<<<<<<<
 *          parse_body=True, transform=None, requires=()):
 *     '''Defines the base Hug API creating decorator, which exposes normal python methods as HTTP APIs'''
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("hug.decorators.call", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_decorator);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":475
 * 
 * 
 * def cli(name=None, version=None, doc=None, transform=None, output=None):             # <<<<<<<<<<<<<<
 *     '''Enables exposing a Hug compatible function as a Command Line Interface'''
 *     def decorator(api_function):
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_23cli(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_3hug_10decorators_22cli[] = "Enables exposing a Hug compatible function as a Command Line Interface";
static PyMethodDef __pyx_mdef_3hug_10decorators_23cli = {"cli", (PyCFunction)__pyx_pw_3hug_10decorators_23cli, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3hug_10decorators_22cli};
static PyObject *__pyx_pw_3hug_10decorators_23cli(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_version = 0;
  PyObject *__pyx_v_doc = 0;
  PyObject *__pyx_v_transform = 0;
  PyObject *__pyx_v_output = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cli (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_version,&__pyx_n_s_doc_2,&__pyx_n_s_transform,&__pyx_n_s_output,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[0] = ((PyObject *)((PyObject *)Py_None));
    values[1] = ((PyObject *)((PyObject *)Py_None));
    values[2] = ((PyObject *)((PyObject *)Py_None));
    values[3] = ((PyObject *)((PyObject *)Py_None));
    values[4] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_version);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_doc_2);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_transform);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_output);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cli") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_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;
      }
    }
    __pyx_v_name = values[0];
    __pyx_v_version = values[1];
    __pyx_v_doc = values[2];
    __pyx_v_transform = values[3];
    __pyx_v_output = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cli", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("hug.decorators.cli", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3hug_10decorators_22cli(__pyx_self, __pyx_v_name, __pyx_v_version, __pyx_v_doc, __pyx_v_transform, __pyx_v_output);

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

/* "hug/decorators.py":477
 * def cli(name=None, version=None, doc=None, transform=None, output=None):
 *     '''Enables exposing a Hug compatible function as a Command Line Interface'''
 *     def decorator(api_function):             # <<<<<<<<<<<<<<
 *         module = module = _api_module(api_function.__module__)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_3cli_1decorator(PyObject *__pyx_self, PyObject *__pyx_v_api_function); /*proto*/
static PyMethodDef __pyx_mdef_3hug_10decorators_3cli_1decorator = {"decorator", (PyCFunction)__pyx_pw_3hug_10decorators_3cli_1decorator, METH_O, 0};
static PyObject *__pyx_pw_3hug_10decorators_3cli_1decorator(PyObject *__pyx_self, PyObject *__pyx_v_api_function) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decorator (wrapper)", 0);
  __pyx_r = __pyx_pf_3hug_10decorators_3cli_decorator(__pyx_self, ((PyObject *)__pyx_v_api_function));

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

/* "hug/decorators.py":564
 *             parser.add_argument(*args, **kwargs)
 * 
 *         def cli_interface():             # <<<<<<<<<<<<<<
 *             pass_to_function = vars(parser.parse_args())
 *             for option, directive in named_directives.items():
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_3cli_9decorator_1cli_interface(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_3hug_10decorators_3cli_9decorator_1cli_interface = {"cli_interface", (PyCFunction)__pyx_pw_3hug_10decorators_3cli_9decorator_1cli_interface, METH_NOARGS, 0};
static PyObject *__pyx_pw_3hug_10decorators_3cli_9decorator_1cli_interface(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cli_interface (wrapper)", 0);
  __pyx_r = __pyx_pf_3hug_10decorators_3cli_9decorator_cli_interface(__pyx_self);

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

static PyObject *__pyx_pf_3hug_10decorators_3cli_9decorator_cli_interface(PyObject *__pyx_self) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_10_decorator *__pyx_cur_scope;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_10_decorator *__pyx_outer_scope;
  PyObject *__pyx_v_pass_to_function = NULL;
  PyObject *__pyx_v_option = NULL;
  PyObject *__pyx_v_directive = NULL;
  PyObject *__pyx_v_arguments = NULL;
  PyObject *__pyx_v_karg_values = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cli_interface", 0);
  __pyx_outer_scope = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_10_decorator *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "hug/decorators.py":565
 * 
 *         def cli_interface():
 *             pass_to_function = vars(parser.parse_args())             # <<<<<<<<<<<<<<
 *             for option, directive in named_directives.items():
 *                 arguments = (defaults[option], ) if option in defaults else ()
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_parser)) { __Pyx_RaiseClosureNameError("parser"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_parser, __pyx_n_s_parse_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __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 = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_vars, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_pass_to_function = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "hug/decorators.py":566
 *         def cli_interface():
 *             pass_to_function = vars(parser.parse_args())
 *             for option, directive in named_directives.items():             # <<<<<<<<<<<<<<
 *                 arguments = (defaults[option], ) if option in defaults else ()
 *                 pass_to_function[option] = directive(*arguments, module=module)
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_named_directives)) { __Pyx_RaiseClosureNameError("named_directives"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(__pyx_cur_scope->__pyx_v_named_directives == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "items");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyDict_Items(__pyx_cur_scope->__pyx_v_named_directives); 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);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; 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);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; 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);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    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 = 566; __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_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_option, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_directive, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "hug/decorators.py":567
 *             pass_to_function = vars(parser.parse_args())
 *             for option, directive in named_directives.items():
 *                 arguments = (defaults[option], ) if option in defaults else ()             # <<<<<<<<<<<<<<
 *                 pass_to_function[option] = directive(*arguments, module=module)
 * 
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_defaults)) { __Pyx_RaiseClosureNameError("defaults"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    if (unlikely(__pyx_cur_scope->__pyx_v_defaults == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = (__Pyx_PyDict_ContainsTF(__pyx_v_option, __pyx_cur_scope->__pyx_v_defaults, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if ((__pyx_t_9 != 0)) {
      if (unlikely(!__pyx_cur_scope->__pyx_v_defaults)) { __Pyx_RaiseClosureNameError("defaults"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
      if (unlikely(__pyx_cur_scope->__pyx_v_defaults == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_defaults, __pyx_v_option); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_1 = __pyx_t_3;
      __pyx_t_3 = 0;
    } else {
      __Pyx_INCREF(__pyx_empty_tuple);
      __pyx_t_1 = __pyx_empty_tuple;
    }
    __Pyx_XDECREF_SET(__pyx_v_arguments, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "hug/decorators.py":568
 *             for option, directive in named_directives.items():
 *                 arguments = (defaults[option], ) if option in defaults else ()
 *                 pass_to_function[option] = directive(*arguments, module=module)             # <<<<<<<<<<<<<<
 * 
 *             if karg_method:
 */
    if (unlikely(__pyx_v_arguments == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(!__pyx_cur_scope->__pyx_v_module)) { __Pyx_RaiseClosureNameError("module"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_module, __pyx_cur_scope->__pyx_v_module) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_directive, __pyx_v_arguments, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(PyObject_SetItem(__pyx_v_pass_to_function, __pyx_v_option, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "hug/decorators.py":566
 *         def cli_interface():
 *             pass_to_function = vars(parser.parse_args())
 *             for option, directive in named_directives.items():             # <<<<<<<<<<<<<<
 *                 arguments = (defaults[option], ) if option in defaults else ()
 *                 pass_to_function[option] = directive(*arguments, module=module)
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "hug/decorators.py":570
 *                 pass_to_function[option] = directive(*arguments, module=module)
 * 
 *             if karg_method:             # <<<<<<<<<<<<<<
 *                 karg_values = pass_to_function.pop(karg_method, ())
 *                 result = api_function(*karg_values, **pass_to_function)
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_karg_method)) { __Pyx_RaiseClosureNameError("karg_method"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_karg_method); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_9) {

    /* "hug/decorators.py":571
 * 
 *             if karg_method:
 *                 karg_values = pass_to_function.pop(karg_method, ())             # <<<<<<<<<<<<<<
 *                 result = api_function(*karg_values, **pass_to_function)
 *             else:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pass_to_function, __pyx_n_s_pop); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(!__pyx_cur_scope->__pyx_v_karg_method)) { __Pyx_RaiseClosureNameError("karg_method"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_1 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_4 = 1;
      }
    }
    __pyx_t_6 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_1) {
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL;
    }
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_karg_method);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_karg_method);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_4, __pyx_cur_scope->__pyx_v_karg_method);
    __Pyx_INCREF(__pyx_empty_tuple);
    __Pyx_GIVEREF(__pyx_empty_tuple);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_4, __pyx_empty_tuple);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_karg_values = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "hug/decorators.py":572
 *             if karg_method:
 *                 karg_values = pass_to_function.pop(karg_method, ())
 *                 result = api_function(*karg_values, **pass_to_function)             # <<<<<<<<<<<<<<
 *             else:
 *                 result = api_function(**pass_to_function)
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_api_function)) { __Pyx_RaiseClosureNameError("api_function"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_2 = PySequence_Tuple(__pyx_v_karg_values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(__pyx_v_pass_to_function == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (likely(PyDict_CheckExact(__pyx_v_pass_to_function))) {
      __pyx_t_3 = PyDict_Copy(__pyx_v_pass_to_function); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_3 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_pass_to_function, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_api_function, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_result = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "hug/decorators.py":570
 *                 pass_to_function[option] = directive(*arguments, module=module)
 * 
 *             if karg_method:             # <<<<<<<<<<<<<<
 *                 karg_values = pass_to_function.pop(karg_method, ())
 *                 result = api_function(*karg_values, **pass_to_function)
 */
    goto __pyx_L7;
  }

  /* "hug/decorators.py":574
 *                 result = api_function(*karg_values, **pass_to_function)
 *             else:
 *                 result = api_function(**pass_to_function)             # <<<<<<<<<<<<<<
 *             if output_transform:
 *                 result = output_transform(result)
 */
  /*else*/ {
    if (unlikely(!__pyx_cur_scope->__pyx_v_api_function)) { __Pyx_RaiseClosureNameError("api_function"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    if (unlikely(__pyx_v_pass_to_function == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (likely(PyDict_CheckExact(__pyx_v_pass_to_function))) {
      __pyx_t_6 = PyDict_Copy(__pyx_v_pass_to_function); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      __pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_pass_to_function, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_api_function, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_result = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_L7:;

  /* "hug/decorators.py":575
 *             else:
 *                 result = api_function(**pass_to_function)
 *             if output_transform:             # <<<<<<<<<<<<<<
 *                 result = output_transform(result)
 *             if hasattr(result, 'read'):
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_output_transform)) { __Pyx_RaiseClosureNameError("output_transform"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_output_transform); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_9) {

    /* "hug/decorators.py":576
 *                 result = api_function(**pass_to_function)
 *             if output_transform:
 *                 result = output_transform(result)             # <<<<<<<<<<<<<<
 *             if hasattr(result, 'read'):
 *                 result = result.read().decode('utf8')
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_output_transform)) { __Pyx_RaiseClosureNameError("output_transform"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_output_transform);
    __pyx_t_6 = __pyx_cur_scope->__pyx_v_output_transform; __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_2) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_result); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_1 = PyTuple_New(1+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_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = NULL;
      __Pyx_INCREF(__pyx_v_result);
      __Pyx_GIVEREF(__pyx_v_result);
      PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_result);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __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_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "hug/decorators.py":575
 *             else:
 *                 result = api_function(**pass_to_function)
 *             if output_transform:             # <<<<<<<<<<<<<<
 *                 result = output_transform(result)
 *             if hasattr(result, 'read'):
 */
  }

  /* "hug/decorators.py":577
 *             if output_transform:
 *                 result = output_transform(result)
 *             if hasattr(result, 'read'):             # <<<<<<<<<<<<<<
 *                 result = result.read().decode('utf8')
 *             if cli_interface.output is not None and result is not None:
 */
  __pyx_t_9 = PyObject_HasAttr(__pyx_v_result, __pyx_n_s_read); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = (__pyx_t_9 != 0);
  if (__pyx_t_10) {

    /* "hug/decorators.py":578
 *                 result = output_transform(result)
 *             if hasattr(result, 'read'):
 *                 result = result.read().decode('utf8')             # <<<<<<<<<<<<<<
 *             if cli_interface.output is not None and result is not None:
 *                 cli_interface.output(result)
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_read); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (__pyx_t_1) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_decode); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "hug/decorators.py":577
 *             if output_transform:
 *                 result = output_transform(result)
 *             if hasattr(result, 'read'):             # <<<<<<<<<<<<<<
 *                 result = result.read().decode('utf8')
 *             if cli_interface.output is not None and result is not None:
 */
  }

  /* "hug/decorators.py":579
 *             if hasattr(result, 'read'):
 *                 result = result.read().decode('utf8')
 *             if cli_interface.output is not None and result is not None:             # <<<<<<<<<<<<<<
 *                 cli_interface.output(result)
 *             else:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_cli_interface)) { __Pyx_RaiseClosureNameError("cli_interface"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_cli_interface, __pyx_n_s_output); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_9 = (__pyx_t_3 != Py_None);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_11 = (__pyx_t_9 != 0);
  if (__pyx_t_11) {
  } else {
    __pyx_t_10 = __pyx_t_11;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_t_11 = (__pyx_v_result != Py_None);
  __pyx_t_9 = (__pyx_t_11 != 0);
  __pyx_t_10 = __pyx_t_9;
  __pyx_L11_bool_binop_done:;
  if (__pyx_t_10) {

    /* "hug/decorators.py":580
 *                 result = result.read().decode('utf8')
 *             if cli_interface.output is not None and result is not None:
 *                 cli_interface.output(result)             # <<<<<<<<<<<<<<
 *             else:
 *                 print(result)
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_cli_interface)) { __Pyx_RaiseClosureNameError("cli_interface"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_cli_interface, __pyx_n_s_output); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_1) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_result); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = NULL;
      __Pyx_INCREF(__pyx_v_result);
      __Pyx_GIVEREF(__pyx_v_result);
      PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_result);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __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_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "hug/decorators.py":579
 *             if hasattr(result, 'read'):
 *                 result = result.read().decode('utf8')
 *             if cli_interface.output is not None and result is not None:             # <<<<<<<<<<<<<<
 *                 cli_interface.output(result)
 *             else:
 */
    goto __pyx_L10;
  }

  /* "hug/decorators.py":582
 *                 cli_interface.output(result)
 *             else:
 *                 print(result)             # <<<<<<<<<<<<<<
 * 
 *         callable_method = api_function
 */
  /*else*/ {
    if (__Pyx_PrintOne(0, __pyx_v_result) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L10:;

  /* "hug/decorators.py":564
 *             parser.add_argument(*args, **kwargs)
 * 
 *         def cli_interface():             # <<<<<<<<<<<<<<
 *             pass_to_function = vars(parser.parse_args())
 *             for option, directive in named_directives.items():
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("hug.decorators.cli.decorator.cli_interface", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pass_to_function);
  __Pyx_XDECREF(__pyx_v_option);
  __Pyx_XDECREF(__pyx_v_directive);
  __Pyx_XDECREF(__pyx_v_arguments);
  __Pyx_XDECREF(__pyx_v_karg_values);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":587
 *         if named_directives and not getattr(api_function, 'without_directives', None):
 *             @wraps(api_function)
 *             def callable_method(*args, **kwargs):             # <<<<<<<<<<<<<<
 *                 for parameter, directive in named_directives.items():
 *                     if parameter in kwargs:
 */

/* Python wrapper */
static PyObject *__pyx_pw_3hug_10decorators_3cli_9decorator_3callable_method(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_3hug_10decorators_3cli_9decorator_3callable_method = {"callable_method", (PyCFunction)__pyx_pw_3hug_10decorators_3cli_9decorator_3callable_method, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3hug_10decorators_3cli_9decorator_3callable_method(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("callable_method (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "callable_method", 1))) return NULL;
  __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_3hug_10decorators_3cli_9decorator_2callable_method(__pyx_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_3hug_10decorators_3cli_9decorator_2callable_method(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_10_decorator *__pyx_cur_scope;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_10_decorator *__pyx_outer_scope;
  PyObject *__pyx_v_parameter = NULL;
  PyObject *__pyx_v_directive = NULL;
  PyObject *__pyx_v_arguments = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("callable_method", 0);
  __pyx_outer_scope = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_10_decorator *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "hug/decorators.py":588
 *             @wraps(api_function)
 *             def callable_method(*args, **kwargs):
 *                 for parameter, directive in named_directives.items():             # <<<<<<<<<<<<<<
 *                     if parameter in kwargs:
 *                         continue
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_named_directives)) { __Pyx_RaiseClosureNameError("named_directives"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(__pyx_cur_scope->__pyx_v_named_directives == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "items");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyDict_Items(__pyx_cur_scope->__pyx_v_named_directives); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    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 = 588; __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_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 = 588; __pyx_clineno = __LINE__; goto __pyx_L1_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 = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_parameter, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_directive, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "hug/decorators.py":589
 *             def callable_method(*args, **kwargs):
 *                 for parameter, directive in named_directives.items():
 *                     if parameter in kwargs:             # <<<<<<<<<<<<<<
 *                         continue
 *                     arguments = (defaults[parameter], ) if parameter in defaults else ()
 */
    __pyx_t_9 = (__Pyx_PyDict_ContainsTF(__pyx_v_parameter, __pyx_v_kwargs, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = (__pyx_t_9 != 0);
    if (__pyx_t_10) {

      /* "hug/decorators.py":590
 *                 for parameter, directive in named_directives.items():
 *                     if parameter in kwargs:
 *                         continue             # <<<<<<<<<<<<<<
 *                     arguments = (defaults[parameter], ) if parameter in defaults else ()
 *                     kwargs[parameter] = directive(*arguments, module=module)
 */
      goto __pyx_L3_continue;

      /* "hug/decorators.py":589
 *             def callable_method(*args, **kwargs):
 *                 for parameter, directive in named_directives.items():
 *                     if parameter in kwargs:             # <<<<<<<<<<<<<<
 *                         continue
 *                     arguments = (defaults[parameter], ) if parameter in defaults else ()
 */
    }

    /* "hug/decorators.py":591
 *                     if parameter in kwargs:
 *                         continue
 *                     arguments = (defaults[parameter], ) if parameter in defaults else ()             # <<<<<<<<<<<<<<
 *                     kwargs[parameter] = directive(*arguments, module=module)
 *                 return api_function(*args, **kwargs)
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_defaults)) { __Pyx_RaiseClosureNameError("defaults"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    if (unlikely(__pyx_cur_scope->__pyx_v_defaults == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_10 = (__Pyx_PyDict_ContainsTF(__pyx_v_parameter, __pyx_cur_scope->__pyx_v_defaults, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if ((__pyx_t_10 != 0)) {
      if (unlikely(!__pyx_cur_scope->__pyx_v_defaults)) { __Pyx_RaiseClosureNameError("defaults"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
      if (unlikely(__pyx_cur_scope->__pyx_v_defaults == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_defaults, __pyx_v_parameter); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_1 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {
      __Pyx_INCREF(__pyx_empty_tuple);
      __pyx_t_1 = __pyx_empty_tuple;
    }
    __Pyx_XDECREF_SET(__pyx_v_arguments, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "hug/decorators.py":592
 *                         continue
 *                     arguments = (defaults[parameter], ) if parameter in defaults else ()
 *                     kwargs[parameter] = directive(*arguments, module=module)             # <<<<<<<<<<<<<<
 *                 return api_function(*args, **kwargs)
 *             callable_method.without_directives = api_function
 */
    if (unlikely(__pyx_v_arguments == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(!__pyx_cur_scope->__pyx_v_module)) { __Pyx_RaiseClosureNameError("module"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_module, __pyx_cur_scope->__pyx_v_module) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_directive, __pyx_v_arguments, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_v_parameter, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "hug/decorators.py":588
 *             @wraps(api_function)
 *             def callable_method(*args, **kwargs):
 *                 for parameter, directive in named_directives.items():             # <<<<<<<<<<<<<<
 *                     if parameter in kwargs:
 *                         continue
 */
    __pyx_L3_continue:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "hug/decorators.py":593
 *                     arguments = (defaults[parameter], ) if parameter in defaults else ()
 *                     kwargs[parameter] = directive(*arguments, module=module)
 *                 return api_function(*args, **kwargs)             # <<<<<<<<<<<<<<
 *             callable_method.without_directives = api_function
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_api_function)) { __Pyx_RaiseClosureNameError("api_function"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_api_function, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "hug/decorators.py":587
 *         if named_directives and not getattr(api_function, 'without_directives', None):
 *             @wraps(api_function)
 *             def callable_method(*args, **kwargs):             # <<<<<<<<<<<<<<
 *                 for parameter, directive in named_directives.items():
 *                     if parameter in kwargs:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("hug.decorators.cli.decorator.callable_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_parameter);
  __Pyx_XDECREF(__pyx_v_directive);
  __Pyx_XDECREF(__pyx_v_arguments);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":477
 * def cli(name=None, version=None, doc=None, transform=None, output=None):
 *     '''Enables exposing a Hug compatible function as a Command Line Interface'''
 *     def decorator(api_function):             # <<<<<<<<<<<<<<
 *         module = module = _api_module(api_function.__module__)
 * 
 */

static PyObject *__pyx_pf_3hug_10decorators_3cli_decorator(PyObject *__pyx_self, PyObject *__pyx_v_api_function) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_10_decorator *__pyx_cur_scope;
  PyObject *__pyx_v_takes_kargs = NULL;
  PyObject *__pyx_v_accepted_parameters = NULL;
  int __pyx_v_nargs_set;
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_v_default = NULL;
  PyObject *__pyx_v_required = NULL;
  PyObject *__pyx_v_directives = NULL;
  PyObject *__pyx_v_use_directives = NULL;
  int __pyx_v_is_method;
  PyObject *__pyx_v_used_options = NULL;
  PyObject *__pyx_v_annotations = NULL;
  PyObject *__pyx_v_option = NULL;
  PyObject *__pyx_v_args = NULL;
  PyObject *__pyx_v_short_option = NULL;
  PyObject *__pyx_v_kwargs = NULL;
  PyObject *__pyx_v_annotation = NULL;
  PyObject *__pyx_v_callable_method = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decorator", 0);
  __pyx_cur_scope = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_10_decorator *)__pyx_tp_new_3hug_10decorators___pyx_scope_struct_10_decorator(__pyx_ptype_3hug_10decorators___pyx_scope_struct_10_decorator, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_9_cli *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_v_api_function = __pyx_v_api_function;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_api_function);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_api_function);

  /* "hug/decorators.py":478
 *     '''Enables exposing a Hug compatible function as a Command Line Interface'''
 *     def decorator(api_function):
 *         module = module = _api_module(api_function.__module__)             # <<<<<<<<<<<<<<
 * 
 *         takes_kargs = bool(api_function.__code__.co_flags & 0x04)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_api_module); 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_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_api_function, __pyx_n_s_module_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); 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_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_module = __pyx_t_1;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_module);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_module, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "hug/decorators.py":480
 *         module = module = _api_module(api_function.__module__)
 * 
 *         takes_kargs = bool(api_function.__code__.co_flags & 0x04)             # <<<<<<<<<<<<<<
 *         if takes_kargs:
 *             accepted_parameters = api_function.__code__.co_varnames[:api_function.__code__.co_argcount + 1]
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_api_function, __pyx_n_s_code); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_co_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __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_PyInt_AndObjC(__pyx_t_2, __pyx_int_4, 0x04, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __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 = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_takes_kargs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "hug/decorators.py":481
 * 
 *         takes_kargs = bool(api_function.__code__.co_flags & 0x04)
 *         if takes_kargs:             # <<<<<<<<<<<<<<
 *             accepted_parameters = api_function.__code__.co_varnames[:api_function.__code__.co_argcount + 1]
 *             karg_method = accepted_parameters[-1]
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_takes_kargs); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_6) {

    /* "hug/decorators.py":482
 *         takes_kargs = bool(api_function.__code__.co_flags & 0x04)
 *         if takes_kargs:
 *             accepted_parameters = api_function.__code__.co_varnames[:api_function.__code__.co_argcount + 1]             # <<<<<<<<<<<<<<
 *             karg_method = accepted_parameters[-1]
 *             nargs_set = True
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_api_function, __pyx_n_s_code); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_co_varnames); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __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_api_function, __pyx_n_s_code); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_co_argcount); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_5, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __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_GetSlice(__pyx_t_2, 0, 0, NULL, &__pyx_t_1, NULL, 0, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __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_accepted_parameters = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "hug/decorators.py":483
 *         if takes_kargs:
 *             accepted_parameters = api_function.__code__.co_varnames[:api_function.__code__.co_argcount + 1]
 *             karg_method = accepted_parameters[-1]             # <<<<<<<<<<<<<<
 *             nargs_set = True
 *         else:
 */
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_accepted_parameters, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_cur_scope->__pyx_v_karg_method = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "hug/decorators.py":484
 *             accepted_parameters = api_function.__code__.co_varnames[:api_function.__code__.co_argcount + 1]
 *             karg_method = accepted_parameters[-1]
 *             nargs_set = True             # <<<<<<<<<<<<<<
 *         else:
 *             karg_method = None
 */
    __pyx_v_nargs_set = 1;

    /* "hug/decorators.py":481
 * 
 *         takes_kargs = bool(api_function.__code__.co_flags & 0x04)
 *         if takes_kargs:             # <<<<<<<<<<<<<<
 *             accepted_parameters = api_function.__code__.co_varnames[:api_function.__code__.co_argcount + 1]
 *             karg_method = accepted_parameters[-1]
 */
    goto __pyx_L3;
  }

  /* "hug/decorators.py":486
 *             nargs_set = True
 *         else:
 *             karg_method = None             # <<<<<<<<<<<<<<
 *             accepted_parameters = api_function.__code__.co_varnames[:api_function.__code__.co_argcount]
 *             nargs_set = False
 */
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __pyx_cur_scope->__pyx_v_karg_method = Py_None;

    /* "hug/decorators.py":487
 *         else:
 *             karg_method = None
 *             accepted_parameters = api_function.__code__.co_varnames[:api_function.__code__.co_argcount]             # <<<<<<<<<<<<<<
 *             nargs_set = False
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_api_function, __pyx_n_s_code); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_co_varnames); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __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_api_function, __pyx_n_s_code); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_co_argcount); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __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_GetSlice(__pyx_t_1, 0, 0, NULL, &__pyx_t_2, NULL, 0, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __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_v_accepted_parameters = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "hug/decorators.py":488
 *             karg_method = None
 *             accepted_parameters = api_function.__code__.co_varnames[:api_function.__code__.co_argcount]
 *             nargs_set = False             # <<<<<<<<<<<<<<
 * 
 *         defaults = {}
 */
    __pyx_v_nargs_set = 0;
  }
  __pyx_L3:;

  /* "hug/decorators.py":490
 *             nargs_set = False
 * 
 *         defaults = {}             # <<<<<<<<<<<<<<
 *         for index, default in enumerate(reversed(api_function.__defaults__ or ())):
 *             defaults[accepted_parameters[-(index + 1)]] = default
 */
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_cur_scope->__pyx_v_defaults = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "hug/decorators.py":491
 * 
 *         defaults = {}
 *         for index, default in enumerate(reversed(api_function.__defaults__ or ())):             # <<<<<<<<<<<<<<
 *             defaults[accepted_parameters[-(index + 1)]] = default
 * 
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_5 = __pyx_int_0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_api_function, __pyx_n_s_defaults_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!__pyx_t_6) {
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = __pyx_t_1;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L6_bool_binop_done;
  }
  __Pyx_INCREF(__pyx_empty_tuple);
  __pyx_t_2 = __pyx_empty_tuple;
  __pyx_L6_bool_binop_done:;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_reversed, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_8(__pyx_t_1);
      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 = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_default, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_5);
    __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_5, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5);
    __pyx_t_5 = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "hug/decorators.py":492
 *         defaults = {}
 *         for index, default in enumerate(reversed(api_function.__defaults__ or ())):
 *             defaults[accepted_parameters[-(index + 1)]] = default             # <<<<<<<<<<<<<<
 * 
 *         required = accepted_parameters[:-(len(api_function.__defaults__ or ())) or None]
 */
    __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_index, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_Negative(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __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_GetItem(__pyx_v_accepted_parameters, __pyx_t_3); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_defaults, __pyx_t_2, __pyx_v_default) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "hug/decorators.py":491
 * 
 *         defaults = {}
 *         for index, default in enumerate(reversed(api_function.__defaults__ or ())):             # <<<<<<<<<<<<<<
 *             defaults[accepted_parameters[-(index + 1)]] = default
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "hug/decorators.py":494
 *             defaults[accepted_parameters[-(index + 1)]] = default
 * 
 *         required = accepted_parameters[:-(len(api_function.__defaults__ or ())) or None]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_api_function, __pyx_n_s_defaults_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!__pyx_t_6) {
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L10_bool_binop_done;
  }
  __Pyx_INCREF(__pyx_empty_tuple);
  __pyx_t_1 = __pyx_empty_tuple;
  __pyx_L10_bool_binop_done:;
  __pyx_t_7 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_9 = (-__pyx_t_7);
  if (!__pyx_t_9) {
  } else {
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L8_bool_binop_done;
  }
  __Pyx_INCREF(Py_None);
  __pyx_t_5 = Py_None;
  __pyx_L8_bool_binop_done:;
  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_accepted_parameters, 0, 0, NULL, &__pyx_t_5, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_required = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "hug/decorators.py":497
 * 
 * 
 *         directives = module.__hug__.directives()             # <<<<<<<<<<<<<<
 *         use_directives = set(accepted_parameters).intersection(directives.keys())
 *         output_transform = transform or api_function.__annotations__.get('return', None)
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_module, __pyx_n_s_hug_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_directives); 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_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__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_2); __pyx_t_2 = 0;
  __pyx_v_directives = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "hug/decorators.py":498
 * 
 *         directives = module.__hug__.directives()
 *         use_directives = set(accepted_parameters).intersection(directives.keys())             # <<<<<<<<<<<<<<
 *         output_transform = transform or api_function.__annotations__.get('return', None)
 * 
 */
  __pyx_t_2 = PySet_New(__pyx_v_accepted_parameters); 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_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_intersection); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_directives, __pyx_n_s_keys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); 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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_use_directives = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "hug/decorators.py":499
 *         directives = module.__hug__.directives()
 *         use_directives = set(accepted_parameters).intersection(directives.keys())
 *         output_transform = transform or api_function.__annotations__.get('return', None)             # <<<<<<<<<<<<<<
 * 
 *         is_method = False
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_transform)) { __Pyx_RaiseClosureNameError("transform"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_transform); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!__pyx_t_6) {
  } else {
    __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_transform);
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_transform;
    goto __pyx_L12_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_api_function, __pyx_n_s_annotations); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __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_Call(__pyx_t_4, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_1 = __pyx_t_5;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_L12_bool_binop_done:;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_output_transform = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "hug/decorators.py":501
 *         output_transform = transform or api_function.__annotations__.get('return', None)
 * 
 *         is_method = False             # <<<<<<<<<<<<<<
 *         if 'method' in api_function.__class__.__name__:
 *             is_method = True
 */
  __pyx_v_is_method = 0;

  /* "hug/decorators.py":502
 * 
 *         is_method = False
 *         if 'method' in api_function.__class__.__name__:             # <<<<<<<<<<<<<<
 *             is_method = True
 *             required = required[1:]
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_api_function, __pyx_n_s_class); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_method, __pyx_t_5, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_10 = (__pyx_t_6 != 0);
  if (__pyx_t_10) {

    /* "hug/decorators.py":503
 *         is_method = False
 *         if 'method' in api_function.__class__.__name__:
 *             is_method = True             # <<<<<<<<<<<<<<
 *             required = required[1:]
 *             accepted_parameters = accepted_parameters[1:]
 */
    __pyx_v_is_method = 1;

    /* "hug/decorators.py":504
 *         if 'method' in api_function.__class__.__name__:
 *             is_method = True
 *             required = required[1:]             # <<<<<<<<<<<<<<
 *             accepted_parameters = accepted_parameters[1:]
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_required, 1, 0, NULL, NULL, &__pyx_slice__37, 1, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_required, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "hug/decorators.py":505
 *             is_method = True
 *             required = required[1:]
 *             accepted_parameters = accepted_parameters[1:]             # <<<<<<<<<<<<<<
 * 
 *         used_options = {'h', 'help'}
 */
    __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_accepted_parameters, 1, 0, NULL, NULL, &__pyx_slice__38, 1, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_accepted_parameters, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "hug/decorators.py":502
 * 
 *         is_method = False
 *         if 'method' in api_function.__class__.__name__:             # <<<<<<<<<<<<<<
 *             is_method = True
 *             required = required[1:]
 */
  }

  /* "hug/decorators.py":507
 *             accepted_parameters = accepted_parameters[1:]
 * 
 *         used_options = {'h', 'help'}             # <<<<<<<<<<<<<<
 *         parser = argparse.ArgumentParser(description=doc or api_function.__doc__)
 *         if version:
 */
  __pyx_t_5 = PySet_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PySet_Add(__pyx_t_5, __pyx_n_s_h) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PySet_Add(__pyx_t_5, __pyx_n_s_help) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_used_options = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "hug/decorators.py":508
 * 
 *         used_options = {'h', 'help'}
 *         parser = argparse.ArgumentParser(description=doc or api_function.__doc__)             # <<<<<<<<<<<<<<
 *         if version:
 *             parser.add_argument('-v', '--version', action='version',
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_argparse); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ArgumentParser); 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_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_doc)) { __Pyx_RaiseClosureNameError("doc"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_doc); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!__pyx_t_10) {
  } else {
    __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_doc);
    __pyx_t_4 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_doc;
    goto __pyx_L15_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_api_function, __pyx_n_s_doc); 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_t_2);
  __pyx_t_4 = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_L15_bool_binop_done:;
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_description, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __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_5); __pyx_t_5 = 0;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_cur_scope->__pyx_v_parser = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "hug/decorators.py":509
 *         used_options = {'h', 'help'}
 *         parser = argparse.ArgumentParser(description=doc or api_function.__doc__)
 *         if version:             # <<<<<<<<<<<<<<
 *             parser.add_argument('-v', '--version', action='version',
 *                                 version="{0} {1}".format(name or api_function.__name__, version))
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_version)) { __Pyx_RaiseClosureNameError("version"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_version); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_10) {

    /* "hug/decorators.py":510
 *         parser = argparse.ArgumentParser(description=doc or api_function.__doc__)
 *         if version:
 *             parser.add_argument('-v', '--version', action='version',             # <<<<<<<<<<<<<<
 *                                 version="{0} {1}".format(name or api_function.__name__, version))
 *             used_options.update(('v', 'version'))
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_parser, __pyx_n_s_add_argument); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_action, __pyx_n_s_version) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "hug/decorators.py":511
 *         if version:
 *             parser.add_argument('-v', '--version', action='version',
 *                                 version="{0} {1}".format(name or api_function.__name__, version))             # <<<<<<<<<<<<<<
 *             used_options.update(('v', 'version'))
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_1, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_name)) { __Pyx_RaiseClosureNameError("name"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_name); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!__pyx_t_10) {
    } else {
      __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_name);
      __pyx_t_3 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_name;
      goto __pyx_L18_bool_binop_done;
    }
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_api_function, __pyx_n_s_name_2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_INCREF(__pyx_t_11);
    __pyx_t_3 = __pyx_t_11;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_L18_bool_binop_done:;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_version)) { __Pyx_RaiseClosureNameError("version"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_11 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_9 = 1;
      }
    }
    __pyx_t_12 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    if (__pyx_t_11) {
      __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_9, __pyx_t_3);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_version);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_version);
    PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_9, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_version);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __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_2); __pyx_t_2 = 0;
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_version, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "hug/decorators.py":510
 *         parser = argparse.ArgumentParser(description=doc or api_function.__doc__)
 *         if version:
 *             parser.add_argument('-v', '--version', action='version',             # <<<<<<<<<<<<<<
 *                                 version="{0} {1}".format(name or api_function.__name__, version))
 *             used_options.update(('v', 'version'))
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__39, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __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;

    /* "hug/decorators.py":512
 *             parser.add_argument('-v', '--version', action='version',
 *                                 version="{0} {1}".format(name or api_function.__name__, version))
 *             used_options.update(('v', 'version'))             # <<<<<<<<<<<<<<
 * 
 *         annotations = api_function.__annotations__
 */
    __pyx_t_13 = __Pyx_PySet_Update(__pyx_v_used_options, __pyx_tuple__40); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "hug/decorators.py":509
 *         used_options = {'h', 'help'}
 *         parser = argparse.ArgumentParser(description=doc or api_function.__doc__)
 *         if version:             # <<<<<<<<<<<<<<
 *             parser.add_argument('-v', '--version', action='version',
 *                                 version="{0} {1}".format(name or api_function.__name__, version))
 */
  }

  /* "hug/decorators.py":514
 *             used_options.update(('v', 'version'))
 * 
 *         annotations = api_function.__annotations__             # <<<<<<<<<<<<<<
 *         named_directives = {directive_name: directives[directive_name] for directive_name in use_directives}
 *         for option in accepted_parameters:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_api_function, __pyx_n_s_annotations); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_annotations = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "hug/decorators.py":515
 * 
 *         annotations = api_function.__annotations__
 *         named_directives = {directive_name: directives[directive_name] for directive_name in use_directives}             # <<<<<<<<<<<<<<
 *         for option in accepted_parameters:
 *             if option in use_directives:
 */
  { /* enter inner scope */
    PyObject *__pyx_8genexpr3__pyx_v_directive_name = NULL;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L22_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(__pyx_v_use_directives)) || PyTuple_CheckExact(__pyx_v_use_directives)) {
      __pyx_t_5 = __pyx_v_use_directives; __Pyx_INCREF(__pyx_t_5); __pyx_t_9 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_use_directives); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L22_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L22_error;}
    }
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L22_error;}
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L22_error;}
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L22_error;}
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L22_error;}
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_8(__pyx_t_5);
        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 = 515; __pyx_clineno = __LINE__; goto __pyx_L22_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_directive_name, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_GetItem(__pyx_v_directives, __pyx_8genexpr3__pyx_v_directive_name); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L22_error;};
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_8genexpr3__pyx_v_directive_name, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L22_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_directive_name);
    goto __pyx_L25_exit_scope;
    __pyx_L22_error:;
    __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_directive_name);
    goto __pyx_L1_error;
    __pyx_L25_exit_scope:;
  } /* exit inner scope */
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_named_directives = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "hug/decorators.py":516
 *         annotations = api_function.__annotations__
 *         named_directives = {directive_name: directives[directive_name] for directive_name in use_directives}
 *         for option in accepted_parameters:             # <<<<<<<<<<<<<<
 *             if option in use_directives:
 *                 continue
 */
  if (likely(PyList_CheckExact(__pyx_v_accepted_parameters)) || PyTuple_CheckExact(__pyx_v_accepted_parameters)) {
    __pyx_t_1 = __pyx_v_accepted_parameters; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_accepted_parameters); 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_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_5); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_5); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_8(__pyx_t_1);
      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 = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_option, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "hug/decorators.py":517
 *         named_directives = {directive_name: directives[directive_name] for directive_name in use_directives}
 *         for option in accepted_parameters:
 *             if option in use_directives:             # <<<<<<<<<<<<<<
 *                 continue
 *             elif hasattr(annotations.get(option, None), 'directive'):
 */
    __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_v_option, __pyx_v_use_directives, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = (__pyx_t_10 != 0);
    if (__pyx_t_6) {

      /* "hug/decorators.py":518
 *         for option in accepted_parameters:
 *             if option in use_directives:
 *                 continue             # <<<<<<<<<<<<<<
 *             elif hasattr(annotations.get(option, None), 'directive'):
 *                 named_directives[option] = annotations[option]
 */
      goto __pyx_L26_continue;

      /* "hug/decorators.py":517
 *         named_directives = {directive_name: directives[directive_name] for directive_name in use_directives}
 *         for option in accepted_parameters:
 *             if option in use_directives:             # <<<<<<<<<<<<<<
 *                 continue
 *             elif hasattr(annotations.get(option, None), 'directive'):
 */
    }

    /* "hug/decorators.py":519
 *             if option in use_directives:
 *                 continue
 *             elif hasattr(annotations.get(option, None), 'directive'):             # <<<<<<<<<<<<<<
 *                 named_directives[option] = annotations[option]
 *                 continue
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_annotations, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    __pyx_t_12 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_option);
    __Pyx_GIVEREF(__pyx_v_option);
    PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_7, __pyx_v_option);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_7, Py_None);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = PyObject_HasAttr(__pyx_t_5, __pyx_n_s_directive); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_10 = (__pyx_t_6 != 0);
    if (__pyx_t_10) {

      /* "hug/decorators.py":520
 *                 continue
 *             elif hasattr(annotations.get(option, None), 'directive'):
 *                 named_directives[option] = annotations[option]             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_5 = PyObject_GetItem(__pyx_v_annotations, __pyx_v_option); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_named_directives, __pyx_v_option, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "hug/decorators.py":521
 *             elif hasattr(annotations.get(option, None), 'directive'):
 *                 named_directives[option] = annotations[option]
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             if option in required:
 */
      goto __pyx_L26_continue;

      /* "hug/decorators.py":519
 *             if option in use_directives:
 *                 continue
 *             elif hasattr(annotations.get(option, None), 'directive'):             # <<<<<<<<<<<<<<
 *                 named_directives[option] = annotations[option]
 *                 continue
 */
    }

    /* "hug/decorators.py":523
 *                 continue
 * 
 *             if option in required:             # <<<<<<<<<<<<<<
 *                 args = (option, )
 *             else:
 */
    __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_v_option, __pyx_v_required, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = (__pyx_t_10 != 0);
    if (__pyx_t_6) {

      /* "hug/decorators.py":524
 * 
 *             if option in required:
 *                 args = (option, )             # <<<<<<<<<<<<<<
 *             else:
 *                 short_option = option[0]
 */
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_option);
      __Pyx_GIVEREF(__pyx_v_option);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_option);
      __Pyx_XDECREF_SET(__pyx_v_args, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "hug/decorators.py":523
 *                 continue
 * 
 *             if option in required:             # <<<<<<<<<<<<<<
 *                 args = (option, )
 *             else:
 */
      goto __pyx_L29;
    }

    /* "hug/decorators.py":526
 *                 args = (option, )
 *             else:
 *                 short_option = option[0]             # <<<<<<<<<<<<<<
 *                 while short_option in used_options and len(short_option) < len(option):
 *                     short_option = option[:len(short_option) + 1]
 */
    /*else*/ {
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_option, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_v_short_option, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "hug/decorators.py":527
 *             else:
 *                 short_option = option[0]
 *                 while short_option in used_options and len(short_option) < len(option):             # <<<<<<<<<<<<<<
 *                     short_option = option[:len(short_option) + 1]
 * 
 */
      while (1) {
        __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_v_short_option, __pyx_v_used_options, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_14 = (__pyx_t_10 != 0);
        if (__pyx_t_14) {
        } else {
          __pyx_t_6 = __pyx_t_14;
          goto __pyx_L32_bool_binop_done;
        }
        __pyx_t_7 = PyObject_Length(__pyx_v_short_option); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_15 = PyObject_Length(__pyx_v_option); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_14 = ((__pyx_t_7 < __pyx_t_15) != 0);
        __pyx_t_6 = __pyx_t_14;
        __pyx_L32_bool_binop_done:;
        if (!__pyx_t_6) break;

        /* "hug/decorators.py":528
 *                 short_option = option[0]
 *                 while short_option in used_options and len(short_option) < len(option):
 *                     short_option = option[:len(short_option) + 1]             # <<<<<<<<<<<<<<
 * 
 *                 used_options.add(short_option)
 */
        __pyx_t_15 = PyObject_Length(__pyx_v_short_option); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_option, 0, (__pyx_t_15 + 1), NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF_SET(__pyx_v_short_option, __pyx_t_5);
        __pyx_t_5 = 0;
      }

      /* "hug/decorators.py":530
 *                     short_option = option[:len(short_option) + 1]
 * 
 *                 used_options.add(short_option)             # <<<<<<<<<<<<<<
 *                 used_options.add(option)
 *                 if short_option != option:
 */
      __pyx_t_13 = PySet_Add(__pyx_v_used_options, __pyx_v_short_option); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "hug/decorators.py":531
 * 
 *                 used_options.add(short_option)
 *                 used_options.add(option)             # <<<<<<<<<<<<<<
 *                 if short_option != option:
 *                     args = ('-{0}'.format(short_option), '--{0}'.format(option))
 */
      __pyx_t_13 = PySet_Add(__pyx_v_used_options, __pyx_v_option); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "hug/decorators.py":532
 *                 used_options.add(short_option)
 *                 used_options.add(option)
 *                 if short_option != option:             # <<<<<<<<<<<<<<
 *                     args = ('-{0}'.format(short_option), '--{0}'.format(option))
 *                 else:
 */
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_short_option, __pyx_v_option, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {

        /* "hug/decorators.py":533
 *                 used_options.add(option)
 *                 if short_option != option:
 *                     args = ('-{0}'.format(short_option), '--{0}'.format(option))             # <<<<<<<<<<<<<<
 *                 else:
 *                     args = ('--{0}'.format(option), )
 */
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_2, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_12 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        if (!__pyx_t_12) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_short_option); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_12); __pyx_t_12 = NULL;
          __Pyx_INCREF(__pyx_v_short_option);
          __Pyx_GIVEREF(__pyx_v_short_option);
          PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_short_option);
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __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_4); __pyx_t_4 = 0;
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_3, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_12 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        if (!__pyx_t_12) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_option); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_12); __pyx_t_12 = NULL;
          __Pyx_INCREF(__pyx_v_option);
          __Pyx_GIVEREF(__pyx_v_option);
          PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_option);
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __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 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
        __pyx_t_5 = 0;
        __pyx_t_4 = 0;
        __Pyx_XDECREF_SET(__pyx_v_args, ((PyObject*)__pyx_t_2));
        __pyx_t_2 = 0;

        /* "hug/decorators.py":532
 *                 used_options.add(short_option)
 *                 used_options.add(option)
 *                 if short_option != option:             # <<<<<<<<<<<<<<
 *                     args = ('-{0}'.format(short_option), '--{0}'.format(option))
 *                 else:
 */
        goto __pyx_L34;
      }

      /* "hug/decorators.py":535
 *                     args = ('-{0}'.format(short_option), '--{0}'.format(option))
 *                 else:
 *                     args = ('--{0}'.format(option), )             # <<<<<<<<<<<<<<
 * 
 *             kwargs = {}
 */
      /*else*/ {
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_3, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        if (!__pyx_t_5) {
          __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_option); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
        } else {
          __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
          __Pyx_INCREF(__pyx_v_option);
          __Pyx_GIVEREF(__pyx_v_option);
          PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_option);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __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;
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_XDECREF_SET(__pyx_v_args, ((PyObject*)__pyx_t_4));
        __pyx_t_4 = 0;
      }
      __pyx_L34:;
    }
    __pyx_L29:;

    /* "hug/decorators.py":537
 *                     args = ('--{0}'.format(option), )
 * 
 *             kwargs = {}             # <<<<<<<<<<<<<<
 *             if option in defaults:
 *                 kwargs['default'] = defaults[option]
 */
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_kwargs, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "hug/decorators.py":538
 * 
 *             kwargs = {}
 *             if option in defaults:             # <<<<<<<<<<<<<<
 *                 kwargs['default'] = defaults[option]
 *             if option in annotations:
 */
    __pyx_t_6 = (__Pyx_PyDict_ContainsTF(__pyx_v_option, __pyx_cur_scope->__pyx_v_defaults, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = (__pyx_t_6 != 0);
    if (__pyx_t_14) {

      /* "hug/decorators.py":539
 *             kwargs = {}
 *             if option in defaults:
 *                 kwargs['default'] = defaults[option]             # <<<<<<<<<<<<<<
 *             if option in annotations:
 *                 annotation = annotations[option]
 */
      __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_defaults, __pyx_v_option); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_default, __pyx_t_4) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "hug/decorators.py":538
 * 
 *             kwargs = {}
 *             if option in defaults:             # <<<<<<<<<<<<<<
 *                 kwargs['default'] = defaults[option]
 *             if option in annotations:
 */
    }

    /* "hug/decorators.py":540
 *             if option in defaults:
 *                 kwargs['default'] = defaults[option]
 *             if option in annotations:             # <<<<<<<<<<<<<<
 *                 annotation = annotations[option]
 *                 if isinstance(annotation, str):
 */
    __pyx_t_14 = (__Pyx_PySequence_ContainsTF(__pyx_v_option, __pyx_v_annotations, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = (__pyx_t_14 != 0);
    if (__pyx_t_6) {

      /* "hug/decorators.py":541
 *                 kwargs['default'] = defaults[option]
 *             if option in annotations:
 *                 annotation = annotations[option]             # <<<<<<<<<<<<<<
 *                 if isinstance(annotation, str):
 *                     kwargs['help'] = annotation
 */
      __pyx_t_4 = PyObject_GetItem(__pyx_v_annotations, __pyx_v_option); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_annotation, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "hug/decorators.py":542
 *             if option in annotations:
 *                 annotation = annotations[option]
 *                 if isinstance(annotation, str):             # <<<<<<<<<<<<<<
 *                     kwargs['help'] = annotation
 *                 else:
 */
      __pyx_t_6 = PyString_Check(__pyx_v_annotation); 
      __pyx_t_14 = (__pyx_t_6 != 0);
      if (__pyx_t_14) {

        /* "hug/decorators.py":543
 *                 annotation = annotations[option]
 *                 if isinstance(annotation, str):
 *                     kwargs['help'] = annotation             # <<<<<<<<<<<<<<
 *                 else:
 *                     kwargs['type'] = annotation
 */
        if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_help, __pyx_v_annotation) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "hug/decorators.py":542
 *             if option in annotations:
 *                 annotation = annotations[option]
 *                 if isinstance(annotation, str):             # <<<<<<<<<<<<<<
 *                     kwargs['help'] = annotation
 *                 else:
 */
        goto __pyx_L37;
      }

      /* "hug/decorators.py":545
 *                     kwargs['help'] = annotation
 *                 else:
 *                     kwargs['type'] = annotation             # <<<<<<<<<<<<<<
 *                     kwargs['help'] = annotation.__doc__
 *                     kwargs.update(getattr(annotation, 'cli_behaviour', {}))
 */
      /*else*/ {
        if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_type, __pyx_v_annotation) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "hug/decorators.py":546
 *                 else:
 *                     kwargs['type'] = annotation
 *                     kwargs['help'] = annotation.__doc__             # <<<<<<<<<<<<<<
 *                     kwargs.update(getattr(annotation, 'cli_behaviour', {}))
 *             if ((kwargs.get('type', None) == bool or kwargs.get('action', None) == 'store_true') and
 */
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_annotation, __pyx_n_s_doc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_help, __pyx_t_4) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "hug/decorators.py":547
 *                     kwargs['type'] = annotation
 *                     kwargs['help'] = annotation.__doc__
 *                     kwargs.update(getattr(annotation, 'cli_behaviour', {}))             # <<<<<<<<<<<<<<
 *             if ((kwargs.get('type', None) == bool or kwargs.get('action', None) == 'store_true') and
 *                     kwargs['default'] == False):
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_kwargs, __pyx_n_s_update); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = __Pyx_GetAttr3(__pyx_v_annotation, __pyx_n_s_cli_behaviour, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        if (!__pyx_t_3) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_3); __pyx_t_3 = NULL;
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_5);
          __pyx_t_5 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_L37:;

      /* "hug/decorators.py":540
 *             if option in defaults:
 *                 kwargs['default'] = defaults[option]
 *             if option in annotations:             # <<<<<<<<<<<<<<
 *                 annotation = annotations[option]
 *                 if isinstance(annotation, str):
 */
    }

    /* "hug/decorators.py":548
 *                     kwargs['help'] = annotation.__doc__
 *                     kwargs.update(getattr(annotation, 'cli_behaviour', {}))
 *             if ((kwargs.get('type', None) == bool or kwargs.get('action', None) == 'store_true') and             # <<<<<<<<<<<<<<
 *                     kwargs['default'] == False):
 *                 kwargs['action'] = 'store_true'
 */
    __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_v_kwargs, __pyx_n_s_type, Py_None); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!__pyx_t_6) {
    } else {
      goto __pyx_L40_next_and;
    }
    __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_kwargs, __pyx_n_s_action, Py_None); 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_t_6 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_store_true, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_6) {
    } else {
      __pyx_t_14 = __pyx_t_6;
      goto __pyx_L39_bool_binop_done;
    }
    __pyx_L40_next_and:;

    /* "hug/decorators.py":549
 *                     kwargs.update(getattr(annotation, 'cli_behaviour', {}))
 *             if ((kwargs.get('type', None) == bool or kwargs.get('action', None) == 'store_true') and
 *                     kwargs['default'] == False):             # <<<<<<<<<<<<<<
 *                 kwargs['action'] = 'store_true'
 *                 kwargs.pop('type', None)
 */
    __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_kwargs, __pyx_n_s_default); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, Py_False, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_14 = __pyx_t_6;
    __pyx_L39_bool_binop_done:;

    /* "hug/decorators.py":548
 *                     kwargs['help'] = annotation.__doc__
 *                     kwargs.update(getattr(annotation, 'cli_behaviour', {}))
 *             if ((kwargs.get('type', None) == bool or kwargs.get('action', None) == 'store_true') and             # <<<<<<<<<<<<<<
 *                     kwargs['default'] == False):
 *                 kwargs['action'] = 'store_true'
 */
    if (__pyx_t_14) {

      /* "hug/decorators.py":550
 *             if ((kwargs.get('type', None) == bool or kwargs.get('action', None) == 'store_true') and
 *                     kwargs['default'] == False):
 *                 kwargs['action'] = 'store_true'             # <<<<<<<<<<<<<<
 *                 kwargs.pop('type', None)
 *             elif kwargs.get('action', None) == 'store_true':
 */
      if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_action, __pyx_n_s_store_true) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "hug/decorators.py":551
 *                     kwargs['default'] == False):
 *                 kwargs['action'] = 'store_true'
 *                 kwargs.pop('type', None)             # <<<<<<<<<<<<<<
 *             elif kwargs.get('action', None) == 'store_true':
 *                 kwargs.pop('action', None) == 'store_true'
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_kwargs, __pyx_n_s_pop); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __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;

      /* "hug/decorators.py":548
 *                     kwargs['help'] = annotation.__doc__
 *                     kwargs.update(getattr(annotation, 'cli_behaviour', {}))
 *             if ((kwargs.get('type', None) == bool or kwargs.get('action', None) == 'store_true') and             # <<<<<<<<<<<<<<
 *                     kwargs['default'] == False):
 *                 kwargs['action'] = 'store_true'
 */
      goto __pyx_L38;
    }

    /* "hug/decorators.py":552
 *                 kwargs['action'] = 'store_true'
 *                 kwargs.pop('type', None)
 *             elif kwargs.get('action', None) == 'store_true':             # <<<<<<<<<<<<<<
 *                 kwargs.pop('action', None) == 'store_true'
 * 
 */
    __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_kwargs, __pyx_n_s_action, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_14 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_store_true, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_14) {

      /* "hug/decorators.py":553
 *                 kwargs.pop('type', None)
 *             elif kwargs.get('action', None) == 'store_true':
 *                 kwargs.pop('action', None) == 'store_true'             # <<<<<<<<<<<<<<
 * 
 *             if option == karg_method or ():
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_kwargs, __pyx_n_s_pop); 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_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __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_RichCompare(__pyx_t_4, __pyx_n_s_store_true, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __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;

      /* "hug/decorators.py":552
 *                 kwargs['action'] = 'store_true'
 *                 kwargs.pop('type', None)
 *             elif kwargs.get('action', None) == 'store_true':             # <<<<<<<<<<<<<<
 *                 kwargs.pop('action', None) == 'store_true'
 * 
 */
    }
    __pyx_L38:;

    /* "hug/decorators.py":555
 *                 kwargs.pop('action', None) == 'store_true'
 * 
 *             if option == karg_method or ():             # <<<<<<<<<<<<<<
 *                 kwargs['nargs'] = '*'
 *             elif not nargs_set and kwargs.get('action', None) == 'append' and not option in defaults:
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_option, __pyx_cur_scope->__pyx_v_karg_method, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __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 = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!__pyx_t_6) {
    } else {
      __pyx_t_14 = __pyx_t_6;
      goto __pyx_L43_bool_binop_done;
    }
    __pyx_t_14 = 0;
    __pyx_L43_bool_binop_done:;
    if (__pyx_t_14) {

      /* "hug/decorators.py":556
 * 
 *             if option == karg_method or ():
 *                 kwargs['nargs'] = '*'             # <<<<<<<<<<<<<<
 *             elif not nargs_set and kwargs.get('action', None) == 'append' and not option in defaults:
 *                 kwargs['nargs'] = '*'
 */
      if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_nargs, __pyx_kp_s__43) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "hug/decorators.py":555
 *                 kwargs.pop('action', None) == 'store_true'
 * 
 *             if option == karg_method or ():             # <<<<<<<<<<<<<<
 *                 kwargs['nargs'] = '*'
 *             elif not nargs_set and kwargs.get('action', None) == 'append' and not option in defaults:
 */
      goto __pyx_L42;
    }

    /* "hug/decorators.py":557
 *             if option == karg_method or ():
 *                 kwargs['nargs'] = '*'
 *             elif not nargs_set and kwargs.get('action', None) == 'append' and not option in defaults:             # <<<<<<<<<<<<<<
 *                 kwargs['nargs'] = '*'
 *                 kwargs.pop('action', '')
 */
    __pyx_t_6 = ((!(__pyx_v_nargs_set != 0)) != 0);
    if (__pyx_t_6) {
    } else {
      __pyx_t_14 = __pyx_t_6;
      goto __pyx_L45_bool_binop_done;
    }
    __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_kwargs, __pyx_n_s_action, Py_None); 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_t_6 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_append, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_6) {
    } else {
      __pyx_t_14 = __pyx_t_6;
      goto __pyx_L45_bool_binop_done;
    }
    __pyx_t_6 = (__Pyx_PyDict_ContainsTF(__pyx_v_option, __pyx_cur_scope->__pyx_v_defaults, Py_NE)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = (__pyx_t_6 != 0);
    __pyx_t_14 = __pyx_t_10;
    __pyx_L45_bool_binop_done:;
    if (__pyx_t_14) {

      /* "hug/decorators.py":558
 *                 kwargs['nargs'] = '*'
 *             elif not nargs_set and kwargs.get('action', None) == 'append' and not option in defaults:
 *                 kwargs['nargs'] = '*'             # <<<<<<<<<<<<<<
 *                 kwargs.pop('action', '')
 *                 nargs_set = True
 */
      if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_nargs, __pyx_kp_s__43) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "hug/decorators.py":559
 *             elif not nargs_set and kwargs.get('action', None) == 'append' and not option in defaults:
 *                 kwargs['nargs'] = '*'
 *                 kwargs.pop('action', '')             # <<<<<<<<<<<<<<
 *                 nargs_set = True
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_kwargs, __pyx_n_s_pop); 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_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __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_4); __pyx_t_4 = 0;

      /* "hug/decorators.py":560
 *                 kwargs['nargs'] = '*'
 *                 kwargs.pop('action', '')
 *                 nargs_set = True             # <<<<<<<<<<<<<<
 * 
 *             parser.add_argument(*args, **kwargs)
 */
      __pyx_v_nargs_set = 1;

      /* "hug/decorators.py":557
 *             if option == karg_method or ():
 *                 kwargs['nargs'] = '*'
 *             elif not nargs_set and kwargs.get('action', None) == 'append' and not option in defaults:             # <<<<<<<<<<<<<<
 *                 kwargs['nargs'] = '*'
 *                 kwargs.pop('action', '')
 */
    }
    __pyx_L42:;

    /* "hug/decorators.py":562
 *                 nargs_set = True
 * 
 *             parser.add_argument(*args, **kwargs)             # <<<<<<<<<<<<<<
 * 
 *         def cli_interface():
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_parser, __pyx_n_s_add_argument); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __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;

    /* "hug/decorators.py":516
 *         annotations = api_function.__annotations__
 *         named_directives = {directive_name: directives[directive_name] for directive_name in use_directives}
 *         for option in accepted_parameters:             # <<<<<<<<<<<<<<
 *             if option in use_directives:
 *                 continue
 */
    __pyx_L26_continue:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "hug/decorators.py":564
 *             parser.add_argument(*args, **kwargs)
 * 
 *         def cli_interface():             # <<<<<<<<<<<<<<
 *             pass_to_function = vars(parser.parse_args())
 *             for option, directive in named_directives.items():
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_3cli_9decorator_1cli_interface, 0, __pyx_n_s_cli_locals_decorator_locals_cli, ((PyObject*)__pyx_cur_scope), __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__46)); 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_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_cli_interface = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "hug/decorators.py":584
 *                 print(result)
 * 
 *         callable_method = api_function             # <<<<<<<<<<<<<<
 *         if named_directives and not getattr(api_function, 'without_directives', None):
 *             @wraps(api_function)
 */
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_api_function);
  __pyx_v_callable_method = __pyx_cur_scope->__pyx_v_api_function;

  /* "hug/decorators.py":585
 * 
 *         callable_method = api_function
 *         if named_directives and not getattr(api_function, 'without_directives', None):             # <<<<<<<<<<<<<<
 *             @wraps(api_function)
 *             def callable_method(*args, **kwargs):
 */
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_named_directives); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_10) {
  } else {
    __pyx_t_14 = __pyx_t_10;
    goto __pyx_L49_bool_binop_done;
  }
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_api_function;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetAttr3(__pyx_t_1, __pyx_n_s_without_directives, Py_None); 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_1); __pyx_t_1 = 0;
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = ((!__pyx_t_10) != 0);
  __pyx_t_14 = __pyx_t_6;
  __pyx_L49_bool_binop_done:;
  if (__pyx_t_14) {

    /* "hug/decorators.py":586
 *         callable_method = api_function
 *         if named_directives and not getattr(api_function, 'without_directives', None):
 *             @wraps(api_function)             # <<<<<<<<<<<<<<
 *             def callable_method(*args, **kwargs):
 *                 for parameter, directive in named_directives.items():
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_12 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_12) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_cur_scope->__pyx_v_api_function); 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);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_12); __pyx_t_12 = NULL;
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_api_function);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_api_function);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_cur_scope->__pyx_v_api_function);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); 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_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "hug/decorators.py":587
 *         if named_directives and not getattr(api_function, 'without_directives', None):
 *             @wraps(api_function)
 *             def callable_method(*args, **kwargs):             # <<<<<<<<<<<<<<
 *                 for parameter, directive in named_directives.items():
 *                     if parameter in kwargs:
 */
    __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_3cli_9decorator_3callable_method, 0, __pyx_n_s_cli_locals_decorator_locals_call, ((PyObject*)__pyx_cur_scope), __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); 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_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_callable_method, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "hug/decorators.py":594
 *                     kwargs[parameter] = directive(*arguments, module=module)
 *                 return api_function(*args, **kwargs)
 *             callable_method.without_directives = api_function             # <<<<<<<<<<<<<<
 * 
 *         if is_method:
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_callable_method, __pyx_n_s_without_directives, __pyx_cur_scope->__pyx_v_api_function) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "hug/decorators.py":585
 * 
 *         callable_method = api_function
 *         if named_directives and not getattr(api_function, 'without_directives', None):             # <<<<<<<<<<<<<<
 *             @wraps(api_function)
 *             def callable_method(*args, **kwargs):
 */
  }

  /* "hug/decorators.py":596
 *             callable_method.without_directives = api_function
 * 
 *         if is_method:             # <<<<<<<<<<<<<<
 *             callable_method.__dict__['cli'] = cli_interface
 *         else:
 */
  __pyx_t_14 = (__pyx_v_is_method != 0);
  if (__pyx_t_14) {

    /* "hug/decorators.py":597
 * 
 *         if is_method:
 *             callable_method.__dict__['cli'] = cli_interface             # <<<<<<<<<<<<<<
 *         else:
 *             callable_method.cli = cli_interface
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_callable_method, __pyx_n_s_dict); 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);
    if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_n_s_cli, __pyx_cur_scope->__pyx_v_cli_interface) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "hug/decorators.py":596
 *             callable_method.without_directives = api_function
 * 
 *         if is_method:             # <<<<<<<<<<<<<<
 *             callable_method.__dict__['cli'] = cli_interface
 *         else:
 */
    goto __pyx_L51;
  }

  /* "hug/decorators.py":599
 *             callable_method.__dict__['cli'] = cli_interface
 *         else:
 *             callable_method.cli = cli_interface             # <<<<<<<<<<<<<<
 *         cli_interface.output = output
 *         cli_interface.karg_method = karg_method
 */
  /*else*/ {
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_callable_method, __pyx_n_s_cli, __pyx_cur_scope->__pyx_v_cli_interface) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L51:;

  /* "hug/decorators.py":600
 *         else:
 *             callable_method.cli = cli_interface
 *         cli_interface.output = output             # <<<<<<<<<<<<<<
 *         cli_interface.karg_method = karg_method
 *         return callable_method
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_output)) { __Pyx_RaiseClosureNameError("output"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_cli_interface, __pyx_n_s_output, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_output) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":601
 *             callable_method.cli = cli_interface
 *         cli_interface.output = output
 *         cli_interface.karg_method = karg_method             # <<<<<<<<<<<<<<
 *         return callable_method
 *     return decorator
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_cli_interface, __pyx_n_s_karg_method, __pyx_cur_scope->__pyx_v_karg_method) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":602
 *         cli_interface.output = output
 *         cli_interface.karg_method = karg_method
 *         return callable_method             # <<<<<<<<<<<<<<
 *     return decorator
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_callable_method);
  __pyx_r = __pyx_v_callable_method;
  goto __pyx_L0;

  /* "hug/decorators.py":477
 * def cli(name=None, version=None, doc=None, transform=None, output=None):
 *     '''Enables exposing a Hug compatible function as a Command Line Interface'''
 *     def decorator(api_function):             # <<<<<<<<<<<<<<
 *         module = module = _api_module(api_function.__module__)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("hug.decorators.cli.decorator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_takes_kargs);
  __Pyx_XDECREF(__pyx_v_accepted_parameters);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XDECREF(__pyx_v_default);
  __Pyx_XDECREF(__pyx_v_required);
  __Pyx_XDECREF(__pyx_v_directives);
  __Pyx_XDECREF(__pyx_v_use_directives);
  __Pyx_XDECREF(__pyx_v_used_options);
  __Pyx_XDECREF(__pyx_v_annotations);
  __Pyx_XDECREF(__pyx_v_option);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_short_option);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_XDECREF(__pyx_v_annotation);
  __Pyx_XDECREF(__pyx_v_callable_method);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "hug/decorators.py":475
 * 
 * 
 * def cli(name=None, version=None, doc=None, transform=None, output=None):             # <<<<<<<<<<<<<<
 *     '''Enables exposing a Hug compatible function as a Command Line Interface'''
 *     def decorator(api_function):
 */

static PyObject *__pyx_pf_3hug_10decorators_22cli(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name, PyObject *__pyx_v_version, PyObject *__pyx_v_doc, PyObject *__pyx_v_transform, PyObject *__pyx_v_output) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_9_cli *__pyx_cur_scope;
  PyObject *__pyx_v_decorator = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cli", 0);
  __pyx_cur_scope = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_9_cli *)__pyx_tp_new_3hug_10decorators___pyx_scope_struct_9_cli(__pyx_ptype_3hug_10decorators___pyx_scope_struct_9_cli, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_name = __pyx_v_name;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_name);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_name);
  __pyx_cur_scope->__pyx_v_version = __pyx_v_version;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_version);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_version);
  __pyx_cur_scope->__pyx_v_doc = __pyx_v_doc;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_doc);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_doc);
  __pyx_cur_scope->__pyx_v_transform = __pyx_v_transform;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_transform);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_transform);
  __pyx_cur_scope->__pyx_v_output = __pyx_v_output;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_output);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_output);

  /* "hug/decorators.py":477
 * def cli(name=None, version=None, doc=None, transform=None, output=None):
 *     '''Enables exposing a Hug compatible function as a Command Line Interface'''
 *     def decorator(api_function):             # <<<<<<<<<<<<<<
 *         module = module = _api_module(api_function.__module__)
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_3cli_1decorator, 0, __pyx_n_s_cli_locals_decorator, ((PyObject*)__pyx_cur_scope), __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__50)); 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_v_decorator = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "hug/decorators.py":603
 *         cli_interface.karg_method = karg_method
 *         return callable_method
 *     return decorator             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_decorator);
  __pyx_r = __pyx_v_decorator;
  goto __pyx_L0;

  /* "hug/decorators.py":475
 * 
 * 
 * def cli(name=None, version=None, doc=None, transform=None, output=None):             # <<<<<<<<<<<<<<
 *     '''Enables exposing a Hug compatible function as a Command Line Interface'''
 *     def decorator(api_function):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("hug.decorators.cli", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_decorator);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_3hug_10decorators___pyx_scope_struct__default_output_format *__pyx_freelist_3hug_10decorators___pyx_scope_struct__default_output_format[8];
static int __pyx_freecount_3hug_10decorators___pyx_scope_struct__default_output_format = 0;

static PyObject *__pyx_tp_new_3hug_10decorators___pyx_scope_struct__default_output_format(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_3hug_10decorators___pyx_scope_struct__default_output_format > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct__default_output_format)))) {
    o = (PyObject*)__pyx_freelist_3hug_10decorators___pyx_scope_struct__default_output_format[--__pyx_freecount_3hug_10decorators___pyx_scope_struct__default_output_format];
    memset(o, 0, sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct__default_output_format));
    (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_3hug_10decorators___pyx_scope_struct__default_output_format(PyObject *o) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct__default_output_format *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct__default_output_format *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_apply_globally);
  Py_CLEAR(p->__pyx_v_content_type);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_3hug_10decorators___pyx_scope_struct__default_output_format < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct__default_output_format)))) {
    __pyx_freelist_3hug_10decorators___pyx_scope_struct__default_output_format[__pyx_freecount_3hug_10decorators___pyx_scope_struct__default_output_format++] = ((struct __pyx_obj_3hug_10decorators___pyx_scope_struct__default_output_format *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_3hug_10decorators___pyx_scope_struct__default_output_format(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct__default_output_format *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct__default_output_format *)o;
  if (p->__pyx_v_apply_globally) {
    e = (*v)(p->__pyx_v_apply_globally, a); if (e) return e;
  }
  if (p->__pyx_v_content_type) {
    e = (*v)(p->__pyx_v_content_type, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3hug_10decorators___pyx_scope_struct__default_output_format(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct__default_output_format *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct__default_output_format *)o;
  tmp = ((PyObject*)p->__pyx_v_apply_globally);
  p->__pyx_v_apply_globally = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_content_type);
  p->__pyx_v_content_type = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_3hug_10decorators___pyx_scope_struct__default_output_format = {
  PyVarObject_HEAD_INIT(0, 0)
  "hug.decorators.__pyx_scope_struct__default_output_format", /*tp_name*/
  sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct__default_output_format), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3hug_10decorators___pyx_scope_struct__default_output_format, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3hug_10decorators___pyx_scope_struct__default_output_format, /*tp_traverse*/
  __pyx_tp_clear_3hug_10decorators___pyx_scope_struct__default_output_format, /*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_3hug_10decorators___pyx_scope_struct__default_output_format, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_3hug_10decorators___pyx_scope_struct_1_default_input_format *__pyx_freelist_3hug_10decorators___pyx_scope_struct_1_default_input_format[8];
static int __pyx_freecount_3hug_10decorators___pyx_scope_struct_1_default_input_format = 0;

static PyObject *__pyx_tp_new_3hug_10decorators___pyx_scope_struct_1_default_input_format(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_3hug_10decorators___pyx_scope_struct_1_default_input_format > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_1_default_input_format)))) {
    o = (PyObject*)__pyx_freelist_3hug_10decorators___pyx_scope_struct_1_default_input_format[--__pyx_freecount_3hug_10decorators___pyx_scope_struct_1_default_input_format];
    memset(o, 0, sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_1_default_input_format));
    (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_3hug_10decorators___pyx_scope_struct_1_default_input_format(PyObject *o) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_1_default_input_format *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_1_default_input_format *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_apply_globally);
  Py_CLEAR(p->__pyx_v_content_type);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_3hug_10decorators___pyx_scope_struct_1_default_input_format < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_1_default_input_format)))) {
    __pyx_freelist_3hug_10decorators___pyx_scope_struct_1_default_input_format[__pyx_freecount_3hug_10decorators___pyx_scope_struct_1_default_input_format++] = ((struct __pyx_obj_3hug_10decorators___pyx_scope_struct_1_default_input_format *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_3hug_10decorators___pyx_scope_struct_1_default_input_format(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_1_default_input_format *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_1_default_input_format *)o;
  if (p->__pyx_v_apply_globally) {
    e = (*v)(p->__pyx_v_apply_globally, a); if (e) return e;
  }
  if (p->__pyx_v_content_type) {
    e = (*v)(p->__pyx_v_content_type, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3hug_10decorators___pyx_scope_struct_1_default_input_format(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_1_default_input_format *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_1_default_input_format *)o;
  tmp = ((PyObject*)p->__pyx_v_apply_globally);
  p->__pyx_v_apply_globally = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_content_type);
  p->__pyx_v_content_type = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_3hug_10decorators___pyx_scope_struct_1_default_input_format = {
  PyVarObject_HEAD_INIT(0, 0)
  "hug.decorators.__pyx_scope_struct_1_default_input_format", /*tp_name*/
  sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_1_default_input_format), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3hug_10decorators___pyx_scope_struct_1_default_input_format, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3hug_10decorators___pyx_scope_struct_1_default_input_format, /*tp_traverse*/
  __pyx_tp_clear_3hug_10decorators___pyx_scope_struct_1_default_input_format, /*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_3hug_10decorators___pyx_scope_struct_1_default_input_format, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_3hug_10decorators___pyx_scope_struct_2_directive *__pyx_freelist_3hug_10decorators___pyx_scope_struct_2_directive[8];
static int __pyx_freecount_3hug_10decorators___pyx_scope_struct_2_directive = 0;

static PyObject *__pyx_tp_new_3hug_10decorators___pyx_scope_struct_2_directive(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_3hug_10decorators___pyx_scope_struct_2_directive > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_2_directive)))) {
    o = (PyObject*)__pyx_freelist_3hug_10decorators___pyx_scope_struct_2_directive[--__pyx_freecount_3hug_10decorators___pyx_scope_struct_2_directive];
    memset(o, 0, sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_2_directive));
    (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_3hug_10decorators___pyx_scope_struct_2_directive(PyObject *o) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_2_directive *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_2_directive *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_apply_globally);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_3hug_10decorators___pyx_scope_struct_2_directive < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_2_directive)))) {
    __pyx_freelist_3hug_10decorators___pyx_scope_struct_2_directive[__pyx_freecount_3hug_10decorators___pyx_scope_struct_2_directive++] = ((struct __pyx_obj_3hug_10decorators___pyx_scope_struct_2_directive *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_3hug_10decorators___pyx_scope_struct_2_directive(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_2_directive *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_2_directive *)o;
  if (p->__pyx_v_apply_globally) {
    e = (*v)(p->__pyx_v_apply_globally, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3hug_10decorators___pyx_scope_struct_2_directive(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_2_directive *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_2_directive *)o;
  tmp = ((PyObject*)p->__pyx_v_apply_globally);
  p->__pyx_v_apply_globally = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_3hug_10decorators___pyx_scope_struct_2_directive = {
  PyVarObject_HEAD_INIT(0, 0)
  "hug.decorators.__pyx_scope_struct_2_directive", /*tp_name*/
  sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_2_directive), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3hug_10decorators___pyx_scope_struct_2_directive, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3hug_10decorators___pyx_scope_struct_2_directive, /*tp_traverse*/
  __pyx_tp_clear_3hug_10decorators___pyx_scope_struct_2_directive, /*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_3hug_10decorators___pyx_scope_struct_2_directive, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_3hug_10decorators___pyx_scope_struct_3_extend_api *__pyx_freelist_3hug_10decorators___pyx_scope_struct_3_extend_api[8];
static int __pyx_freecount_3hug_10decorators___pyx_scope_struct_3_extend_api = 0;

static PyObject *__pyx_tp_new_3hug_10decorators___pyx_scope_struct_3_extend_api(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_3hug_10decorators___pyx_scope_struct_3_extend_api > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_3_extend_api)))) {
    o = (PyObject*)__pyx_freelist_3hug_10decorators___pyx_scope_struct_3_extend_api[--__pyx_freecount_3hug_10decorators___pyx_scope_struct_3_extend_api];
    memset(o, 0, sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_3_extend_api));
    (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_3hug_10decorators___pyx_scope_struct_3_extend_api(PyObject *o) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_3_extend_api *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_3_extend_api *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_route);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_3hug_10decorators___pyx_scope_struct_3_extend_api < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_3_extend_api)))) {
    __pyx_freelist_3hug_10decorators___pyx_scope_struct_3_extend_api[__pyx_freecount_3hug_10decorators___pyx_scope_struct_3_extend_api++] = ((struct __pyx_obj_3hug_10decorators___pyx_scope_struct_3_extend_api *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_3hug_10decorators___pyx_scope_struct_3_extend_api(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_3_extend_api *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_3_extend_api *)o;
  if (p->__pyx_v_route) {
    e = (*v)(p->__pyx_v_route, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3hug_10decorators___pyx_scope_struct_3_extend_api(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_3_extend_api *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_3_extend_api *)o;
  tmp = ((PyObject*)p->__pyx_v_route);
  p->__pyx_v_route = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_3hug_10decorators___pyx_scope_struct_3_extend_api = {
  PyVarObject_HEAD_INIT(0, 0)
  "hug.decorators.__pyx_scope_struct_3_extend_api", /*tp_name*/
  sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_3_extend_api), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3hug_10decorators___pyx_scope_struct_3_extend_api, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3hug_10decorators___pyx_scope_struct_3_extend_api, /*tp_traverse*/
  __pyx_tp_clear_3hug_10decorators___pyx_scope_struct_3_extend_api, /*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_3hug_10decorators___pyx_scope_struct_3_extend_api, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_3hug_10decorators___pyx_scope_struct_4__api_module *__pyx_freelist_3hug_10decorators___pyx_scope_struct_4__api_module[8];
static int __pyx_freecount_3hug_10decorators___pyx_scope_struct_4__api_module = 0;

static PyObject *__pyx_tp_new_3hug_10decorators___pyx_scope_struct_4__api_module(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_3hug_10decorators___pyx_scope_struct_4__api_module > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_4__api_module)))) {
    o = (PyObject*)__pyx_freelist_3hug_10decorators___pyx_scope_struct_4__api_module[--__pyx_freecount_3hug_10decorators___pyx_scope_struct_4__api_module];
    memset(o, 0, sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_4__api_module));
    (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_3hug_10decorators___pyx_scope_struct_4__api_module(PyObject *o) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_4__api_module *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_4__api_module *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_module);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_3hug_10decorators___pyx_scope_struct_4__api_module < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_4__api_module)))) {
    __pyx_freelist_3hug_10decorators___pyx_scope_struct_4__api_module[__pyx_freecount_3hug_10decorators___pyx_scope_struct_4__api_module++] = ((struct __pyx_obj_3hug_10decorators___pyx_scope_struct_4__api_module *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_3hug_10decorators___pyx_scope_struct_4__api_module(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_4__api_module *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_4__api_module *)o;
  if (p->__pyx_v_module) {
    e = (*v)(p->__pyx_v_module, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3hug_10decorators___pyx_scope_struct_4__api_module(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_4__api_module *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_4__api_module *)o;
  tmp = ((PyObject*)p->__pyx_v_module);
  p->__pyx_v_module = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_3hug_10decorators___pyx_scope_struct_4__api_module = {
  PyVarObject_HEAD_INIT(0, 0)
  "hug.decorators.__pyx_scope_struct_4__api_module", /*tp_name*/
  sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_4__api_module), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3hug_10decorators___pyx_scope_struct_4__api_module, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3hug_10decorators___pyx_scope_struct_4__api_module, /*tp_traverse*/
  __pyx_tp_clear_3hug_10decorators___pyx_scope_struct_4__api_module, /*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_3hug_10decorators___pyx_scope_struct_4__api_module, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema *__pyx_freelist_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema[8];
static int __pyx_freecount_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema = 0;

static PyObject *__pyx_tp_new_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema)))) {
    o = (PyObject*)__pyx_freelist_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema[--__pyx_freecount_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema];
    memset(o, 0, sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema));
    (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_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema(PyObject *o) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_marshmallow);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema)))) {
    __pyx_freelist_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema[__pyx_freecount_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema++] = ((struct __pyx_obj_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema *)o;
  if (p->__pyx_v_marshmallow) {
    e = (*v)(p->__pyx_v_marshmallow, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema *)o;
  tmp = ((PyObject*)p->__pyx_v_marshmallow);
  p->__pyx_v_marshmallow = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema = {
  PyVarObject_HEAD_INIT(0, 0)
  "hug.decorators.__pyx_scope_struct_5__marshmallow_schema", /*tp_name*/
  sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema, /*tp_traverse*/
  __pyx_tp_clear_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema, /*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_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_3hug_10decorators___pyx_scope_struct_6__create_interface *__pyx_freelist_3hug_10decorators___pyx_scope_struct_6__create_interface[8];
static int __pyx_freecount_3hug_10decorators___pyx_scope_struct_6__create_interface = 0;

static PyObject *__pyx_tp_new_3hug_10decorators___pyx_scope_struct_6__create_interface(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_3hug_10decorators___pyx_scope_struct_6__create_interface > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_6__create_interface)))) {
    o = (PyObject*)__pyx_freelist_3hug_10decorators___pyx_scope_struct_6__create_interface[--__pyx_freecount_3hug_10decorators___pyx_scope_struct_6__create_interface];
    memset(o, 0, sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_6__create_interface));
    (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_3hug_10decorators___pyx_scope_struct_6__create_interface(PyObject *o) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_6__create_interface *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_6__create_interface *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_accepted_parameters);
  Py_CLEAR(p->__pyx_v_api_function);
  Py_CLEAR(p->__pyx_v_default_kwargs);
  Py_CLEAR(p->__pyx_v_defaults);
  Py_CLEAR(p->__pyx_v_function_output);
  Py_CLEAR(p->__pyx_v_function_output_args);
  Py_CLEAR(p->__pyx_v_input_transformations);
  Py_CLEAR(p->__pyx_v_module);
  Py_CLEAR(p->__pyx_v_named_directives);
  Py_CLEAR(p->__pyx_v_parse_body);
  Py_CLEAR(p->__pyx_v_required);
  Py_CLEAR(p->__pyx_v_requires);
  Py_CLEAR(p->__pyx_v_set_status);
  Py_CLEAR(p->__pyx_v_takes_kwargs);
  Py_CLEAR(p->__pyx_v_transform);
  Py_CLEAR(p->__pyx_v_transform_args);
  Py_CLEAR(p->__pyx_v_versions);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_3hug_10decorators___pyx_scope_struct_6__create_interface < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_6__create_interface)))) {
    __pyx_freelist_3hug_10decorators___pyx_scope_struct_6__create_interface[__pyx_freecount_3hug_10decorators___pyx_scope_struct_6__create_interface++] = ((struct __pyx_obj_3hug_10decorators___pyx_scope_struct_6__create_interface *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_3hug_10decorators___pyx_scope_struct_6__create_interface(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_6__create_interface *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_6__create_interface *)o;
  if (p->__pyx_v_accepted_parameters) {
    e = (*v)(p->__pyx_v_accepted_parameters, a); if (e) return e;
  }
  if (p->__pyx_v_api_function) {
    e = (*v)(p->__pyx_v_api_function, a); if (e) return e;
  }
  if (p->__pyx_v_default_kwargs) {
    e = (*v)(p->__pyx_v_default_kwargs, a); if (e) return e;
  }
  if (p->__pyx_v_defaults) {
    e = (*v)(p->__pyx_v_defaults, a); if (e) return e;
  }
  if (p->__pyx_v_function_output) {
    e = (*v)(p->__pyx_v_function_output, a); if (e) return e;
  }
  if (p->__pyx_v_function_output_args) {
    e = (*v)(p->__pyx_v_function_output_args, a); if (e) return e;
  }
  if (p->__pyx_v_input_transformations) {
    e = (*v)(p->__pyx_v_input_transformations, a); if (e) return e;
  }
  if (p->__pyx_v_module) {
    e = (*v)(p->__pyx_v_module, a); if (e) return e;
  }
  if (p->__pyx_v_named_directives) {
    e = (*v)(p->__pyx_v_named_directives, a); if (e) return e;
  }
  if (p->__pyx_v_parse_body) {
    e = (*v)(p->__pyx_v_parse_body, a); if (e) return e;
  }
  if (p->__pyx_v_required) {
    e = (*v)(p->__pyx_v_required, a); if (e) return e;
  }
  if (p->__pyx_v_requires) {
    e = (*v)(p->__pyx_v_requires, a); if (e) return e;
  }
  if (p->__pyx_v_set_status) {
    e = (*v)(p->__pyx_v_set_status, a); if (e) return e;
  }
  if (p->__pyx_v_takes_kwargs) {
    e = (*v)(p->__pyx_v_takes_kwargs, a); if (e) return e;
  }
  if (p->__pyx_v_transform) {
    e = (*v)(p->__pyx_v_transform, a); if (e) return e;
  }
  if (p->__pyx_v_transform_args) {
    e = (*v)(p->__pyx_v_transform_args, a); if (e) return e;
  }
  if (p->__pyx_v_versions) {
    e = (*v)(p->__pyx_v_versions, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3hug_10decorators___pyx_scope_struct_6__create_interface(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_6__create_interface *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_6__create_interface *)o;
  tmp = ((PyObject*)p->__pyx_v_accepted_parameters);
  p->__pyx_v_accepted_parameters = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_api_function);
  p->__pyx_v_api_function = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_default_kwargs);
  p->__pyx_v_default_kwargs = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_defaults);
  p->__pyx_v_defaults = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_function_output);
  p->__pyx_v_function_output = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_function_output_args);
  p->__pyx_v_function_output_args = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_input_transformations);
  p->__pyx_v_input_transformations = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_module);
  p->__pyx_v_module = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_named_directives);
  p->__pyx_v_named_directives = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_parse_body);
  p->__pyx_v_parse_body = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_required);
  p->__pyx_v_required = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_requires);
  p->__pyx_v_requires = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_set_status);
  p->__pyx_v_set_status = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_takes_kwargs);
  p->__pyx_v_takes_kwargs = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_transform);
  p->__pyx_v_transform = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_transform_args);
  p->__pyx_v_transform_args = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_versions);
  p->__pyx_v_versions = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_3hug_10decorators___pyx_scope_struct_6__create_interface = {
  PyVarObject_HEAD_INIT(0, 0)
  "hug.decorators.__pyx_scope_struct_6__create_interface", /*tp_name*/
  sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_6__create_interface), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3hug_10decorators___pyx_scope_struct_6__create_interface, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3hug_10decorators___pyx_scope_struct_6__create_interface, /*tp_traverse*/
  __pyx_tp_clear_3hug_10decorators___pyx_scope_struct_6__create_interface, /*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_3hug_10decorators___pyx_scope_struct_6__create_interface, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_3hug_10decorators___pyx_scope_struct_7_not_found *__pyx_freelist_3hug_10decorators___pyx_scope_struct_7_not_found[8];
static int __pyx_freecount_3hug_10decorators___pyx_scope_struct_7_not_found = 0;

static PyObject *__pyx_tp_new_3hug_10decorators___pyx_scope_struct_7_not_found(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_3hug_10decorators___pyx_scope_struct_7_not_found > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_7_not_found)))) {
    o = (PyObject*)__pyx_freelist_3hug_10decorators___pyx_scope_struct_7_not_found[--__pyx_freecount_3hug_10decorators___pyx_scope_struct_7_not_found];
    memset(o, 0, sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_7_not_found));
    (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_3hug_10decorators___pyx_scope_struct_7_not_found(PyObject *o) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_7_not_found *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_7_not_found *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_output);
  Py_CLEAR(p->__pyx_v_parse_body);
  Py_CLEAR(p->__pyx_v_requires);
  Py_CLEAR(p->__pyx_v_transform);
  Py_CLEAR(p->__pyx_v_versions);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_3hug_10decorators___pyx_scope_struct_7_not_found < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_7_not_found)))) {
    __pyx_freelist_3hug_10decorators___pyx_scope_struct_7_not_found[__pyx_freecount_3hug_10decorators___pyx_scope_struct_7_not_found++] = ((struct __pyx_obj_3hug_10decorators___pyx_scope_struct_7_not_found *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_3hug_10decorators___pyx_scope_struct_7_not_found(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_7_not_found *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_7_not_found *)o;
  if (p->__pyx_v_output) {
    e = (*v)(p->__pyx_v_output, a); if (e) return e;
  }
  if (p->__pyx_v_parse_body) {
    e = (*v)(p->__pyx_v_parse_body, a); if (e) return e;
  }
  if (p->__pyx_v_requires) {
    e = (*v)(p->__pyx_v_requires, a); if (e) return e;
  }
  if (p->__pyx_v_transform) {
    e = (*v)(p->__pyx_v_transform, a); if (e) return e;
  }
  if (p->__pyx_v_versions) {
    e = (*v)(p->__pyx_v_versions, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3hug_10decorators___pyx_scope_struct_7_not_found(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_7_not_found *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_7_not_found *)o;
  tmp = ((PyObject*)p->__pyx_v_output);
  p->__pyx_v_output = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_parse_body);
  p->__pyx_v_parse_body = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_requires);
  p->__pyx_v_requires = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_transform);
  p->__pyx_v_transform = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_versions);
  p->__pyx_v_versions = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_3hug_10decorators___pyx_scope_struct_7_not_found = {
  PyVarObject_HEAD_INIT(0, 0)
  "hug.decorators.__pyx_scope_struct_7_not_found", /*tp_name*/
  sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_7_not_found), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3hug_10decorators___pyx_scope_struct_7_not_found, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3hug_10decorators___pyx_scope_struct_7_not_found, /*tp_traverse*/
  __pyx_tp_clear_3hug_10decorators___pyx_scope_struct_7_not_found, /*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_3hug_10decorators___pyx_scope_struct_7_not_found, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_3hug_10decorators___pyx_scope_struct_8_call *__pyx_freelist_3hug_10decorators___pyx_scope_struct_8_call[8];
static int __pyx_freecount_3hug_10decorators___pyx_scope_struct_8_call = 0;

static PyObject *__pyx_tp_new_3hug_10decorators___pyx_scope_struct_8_call(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_3hug_10decorators___pyx_scope_struct_8_call > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_8_call)))) {
    o = (PyObject*)__pyx_freelist_3hug_10decorators___pyx_scope_struct_8_call[--__pyx_freecount_3hug_10decorators___pyx_scope_struct_8_call];
    memset(o, 0, sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_8_call));
    (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_3hug_10decorators___pyx_scope_struct_8_call(PyObject *o) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_8_call *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_8_call *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_accept);
  Py_CLEAR(p->__pyx_v_defaults);
  Py_CLEAR(p->__pyx_v_examples);
  Py_CLEAR(p->__pyx_v_output);
  Py_CLEAR(p->__pyx_v_parameters);
  Py_CLEAR(p->__pyx_v_parse_body);
  Py_CLEAR(p->__pyx_v_requires);
  Py_CLEAR(p->__pyx_v_transform);
  Py_CLEAR(p->__pyx_v_urls);
  Py_CLEAR(p->__pyx_v_versions);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_3hug_10decorators___pyx_scope_struct_8_call < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_8_call)))) {
    __pyx_freelist_3hug_10decorators___pyx_scope_struct_8_call[__pyx_freecount_3hug_10decorators___pyx_scope_struct_8_call++] = ((struct __pyx_obj_3hug_10decorators___pyx_scope_struct_8_call *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_3hug_10decorators___pyx_scope_struct_8_call(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_8_call *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_8_call *)o;
  if (p->__pyx_v_accept) {
    e = (*v)(p->__pyx_v_accept, a); if (e) return e;
  }
  if (p->__pyx_v_defaults) {
    e = (*v)(p->__pyx_v_defaults, a); if (e) return e;
  }
  if (p->__pyx_v_examples) {
    e = (*v)(p->__pyx_v_examples, a); if (e) return e;
  }
  if (p->__pyx_v_output) {
    e = (*v)(p->__pyx_v_output, a); if (e) return e;
  }
  if (p->__pyx_v_parameters) {
    e = (*v)(p->__pyx_v_parameters, a); if (e) return e;
  }
  if (p->__pyx_v_parse_body) {
    e = (*v)(p->__pyx_v_parse_body, a); if (e) return e;
  }
  if (p->__pyx_v_requires) {
    e = (*v)(p->__pyx_v_requires, a); if (e) return e;
  }
  if (p->__pyx_v_transform) {
    e = (*v)(p->__pyx_v_transform, a); if (e) return e;
  }
  if (p->__pyx_v_urls) {
    e = (*v)(p->__pyx_v_urls, a); if (e) return e;
  }
  if (p->__pyx_v_versions) {
    e = (*v)(p->__pyx_v_versions, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3hug_10decorators___pyx_scope_struct_8_call(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_8_call *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_8_call *)o;
  tmp = ((PyObject*)p->__pyx_v_accept);
  p->__pyx_v_accept = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_defaults);
  p->__pyx_v_defaults = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_examples);
  p->__pyx_v_examples = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_output);
  p->__pyx_v_output = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_parameters);
  p->__pyx_v_parameters = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_parse_body);
  p->__pyx_v_parse_body = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_requires);
  p->__pyx_v_requires = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_transform);
  p->__pyx_v_transform = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_urls);
  p->__pyx_v_urls = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_versions);
  p->__pyx_v_versions = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_3hug_10decorators___pyx_scope_struct_8_call = {
  PyVarObject_HEAD_INIT(0, 0)
  "hug.decorators.__pyx_scope_struct_8_call", /*tp_name*/
  sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_8_call), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3hug_10decorators___pyx_scope_struct_8_call, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3hug_10decorators___pyx_scope_struct_8_call, /*tp_traverse*/
  __pyx_tp_clear_3hug_10decorators___pyx_scope_struct_8_call, /*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_3hug_10decorators___pyx_scope_struct_8_call, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_3hug_10decorators___pyx_scope_struct_9_cli *__pyx_freelist_3hug_10decorators___pyx_scope_struct_9_cli[8];
static int __pyx_freecount_3hug_10decorators___pyx_scope_struct_9_cli = 0;

static PyObject *__pyx_tp_new_3hug_10decorators___pyx_scope_struct_9_cli(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_3hug_10decorators___pyx_scope_struct_9_cli > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_9_cli)))) {
    o = (PyObject*)__pyx_freelist_3hug_10decorators___pyx_scope_struct_9_cli[--__pyx_freecount_3hug_10decorators___pyx_scope_struct_9_cli];
    memset(o, 0, sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_9_cli));
    (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_3hug_10decorators___pyx_scope_struct_9_cli(PyObject *o) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_9_cli *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_9_cli *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_doc);
  Py_CLEAR(p->__pyx_v_name);
  Py_CLEAR(p->__pyx_v_output);
  Py_CLEAR(p->__pyx_v_transform);
  Py_CLEAR(p->__pyx_v_version);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_3hug_10decorators___pyx_scope_struct_9_cli < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_9_cli)))) {
    __pyx_freelist_3hug_10decorators___pyx_scope_struct_9_cli[__pyx_freecount_3hug_10decorators___pyx_scope_struct_9_cli++] = ((struct __pyx_obj_3hug_10decorators___pyx_scope_struct_9_cli *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_3hug_10decorators___pyx_scope_struct_9_cli(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_9_cli *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_9_cli *)o;
  if (p->__pyx_v_doc) {
    e = (*v)(p->__pyx_v_doc, a); if (e) return e;
  }
  if (p->__pyx_v_name) {
    e = (*v)(p->__pyx_v_name, a); if (e) return e;
  }
  if (p->__pyx_v_output) {
    e = (*v)(p->__pyx_v_output, a); if (e) return e;
  }
  if (p->__pyx_v_transform) {
    e = (*v)(p->__pyx_v_transform, a); if (e) return e;
  }
  if (p->__pyx_v_version) {
    e = (*v)(p->__pyx_v_version, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3hug_10decorators___pyx_scope_struct_9_cli(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_9_cli *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_9_cli *)o;
  tmp = ((PyObject*)p->__pyx_v_doc);
  p->__pyx_v_doc = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_name);
  p->__pyx_v_name = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_output);
  p->__pyx_v_output = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_transform);
  p->__pyx_v_transform = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_version);
  p->__pyx_v_version = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_3hug_10decorators___pyx_scope_struct_9_cli = {
  PyVarObject_HEAD_INIT(0, 0)
  "hug.decorators.__pyx_scope_struct_9_cli", /*tp_name*/
  sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_9_cli), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3hug_10decorators___pyx_scope_struct_9_cli, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3hug_10decorators___pyx_scope_struct_9_cli, /*tp_traverse*/
  __pyx_tp_clear_3hug_10decorators___pyx_scope_struct_9_cli, /*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_3hug_10decorators___pyx_scope_struct_9_cli, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_3hug_10decorators___pyx_scope_struct_10_decorator *__pyx_freelist_3hug_10decorators___pyx_scope_struct_10_decorator[8];
static int __pyx_freecount_3hug_10decorators___pyx_scope_struct_10_decorator = 0;

static PyObject *__pyx_tp_new_3hug_10decorators___pyx_scope_struct_10_decorator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_3hug_10decorators___pyx_scope_struct_10_decorator > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_10_decorator)))) {
    o = (PyObject*)__pyx_freelist_3hug_10decorators___pyx_scope_struct_10_decorator[--__pyx_freecount_3hug_10decorators___pyx_scope_struct_10_decorator];
    memset(o, 0, sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_10_decorator));
    (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_3hug_10decorators___pyx_scope_struct_10_decorator(PyObject *o) {
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_10_decorator *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_10_decorator *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_api_function);
  Py_CLEAR(p->__pyx_v_cli_interface);
  Py_CLEAR(p->__pyx_v_defaults);
  Py_CLEAR(p->__pyx_v_karg_method);
  Py_CLEAR(p->__pyx_v_module);
  Py_CLEAR(p->__pyx_v_named_directives);
  Py_CLEAR(p->__pyx_v_output_transform);
  Py_CLEAR(p->__pyx_v_parser);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_3hug_10decorators___pyx_scope_struct_10_decorator < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_10_decorator)))) {
    __pyx_freelist_3hug_10decorators___pyx_scope_struct_10_decorator[__pyx_freecount_3hug_10decorators___pyx_scope_struct_10_decorator++] = ((struct __pyx_obj_3hug_10decorators___pyx_scope_struct_10_decorator *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_3hug_10decorators___pyx_scope_struct_10_decorator(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_10_decorator *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_10_decorator *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_api_function) {
    e = (*v)(p->__pyx_v_api_function, a); if (e) return e;
  }
  if (p->__pyx_v_cli_interface) {
    e = (*v)(p->__pyx_v_cli_interface, a); if (e) return e;
  }
  if (p->__pyx_v_defaults) {
    e = (*v)(p->__pyx_v_defaults, a); if (e) return e;
  }
  if (p->__pyx_v_karg_method) {
    e = (*v)(p->__pyx_v_karg_method, a); if (e) return e;
  }
  if (p->__pyx_v_module) {
    e = (*v)(p->__pyx_v_module, a); if (e) return e;
  }
  if (p->__pyx_v_named_directives) {
    e = (*v)(p->__pyx_v_named_directives, a); if (e) return e;
  }
  if (p->__pyx_v_output_transform) {
    e = (*v)(p->__pyx_v_output_transform, a); if (e) return e;
  }
  if (p->__pyx_v_parser) {
    e = (*v)(p->__pyx_v_parser, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3hug_10decorators___pyx_scope_struct_10_decorator(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_3hug_10decorators___pyx_scope_struct_10_decorator *p = (struct __pyx_obj_3hug_10decorators___pyx_scope_struct_10_decorator *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_3hug_10decorators___pyx_scope_struct_9_cli *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_api_function);
  p->__pyx_v_api_function = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_cli_interface);
  p->__pyx_v_cli_interface = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_defaults);
  p->__pyx_v_defaults = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_karg_method);
  p->__pyx_v_karg_method = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_module);
  p->__pyx_v_module = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_named_directives);
  p->__pyx_v_named_directives = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_output_transform);
  p->__pyx_v_output_transform = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_parser);
  p->__pyx_v_parser = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_3hug_10decorators___pyx_scope_struct_10_decorator = {
  PyVarObject_HEAD_INIT(0, 0)
  "hug.decorators.__pyx_scope_struct_10_decorator", /*tp_name*/
  sizeof(struct __pyx_obj_3hug_10decorators___pyx_scope_struct_10_decorator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3hug_10decorators___pyx_scope_struct_10_decorator, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3hug_10decorators___pyx_scope_struct_10_decorator, /*tp_traverse*/
  __pyx_tp_clear_3hug_10decorators___pyx_scope_struct_10_decorator, /*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_3hug_10decorators___pyx_scope_struct_10_decorator, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

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
    "decorators",
    __pyx_k_hug_decorators_py_Defines_the_me, /* 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_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0},
  {&__pyx_kp_s_0, __pyx_k_0, sizeof(__pyx_k_0), 0, 0, 1, 0},
  {&__pyx_kp_s_0_1, __pyx_k_0_1, sizeof(__pyx_k_0_1), 0, 0, 1, 0},
  {&__pyx_kp_s_0_2, __pyx_k_0_2, sizeof(__pyx_k_0_2), 0, 0, 1, 0},
  {&__pyx_kp_s_0_3, __pyx_k_0_3, sizeof(__pyx_k_0_3), 0, 0, 1, 0},
  {&__pyx_n_s_AUTO_INCLUDE, __pyx_k_AUTO_INCLUDE, sizeof(__pyx_k_AUTO_INCLUDE), 0, 0, 1, 1},
  {&__pyx_n_s_ArgumentParser, __pyx_k_ArgumentParser, sizeof(__pyx_k_ArgumentParser), 0, 0, 1, 1},
  {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1},
  {&__pyx_kp_s_Exposes_a_Python_method_external, __pyx_k_Exposes_a_Python_method_external, sizeof(__pyx_k_Exposes_a_Python_method_external), 0, 0, 1, 0},
  {&__pyx_n_s_HTTP_206, __pyx_k_HTTP_206, sizeof(__pyx_k_HTTP_206), 0, 0, 1, 1},
  {&__pyx_n_s_HTTP_BAD_REQUEST, __pyx_k_HTTP_BAD_REQUEST, sizeof(__pyx_k_HTTP_BAD_REQUEST), 0, 0, 1, 1},
  {&__pyx_n_s_HTTP_METHODS, __pyx_k_HTTP_METHODS, sizeof(__pyx_k_HTTP_METHODS), 0, 0, 1, 1},
  {&__pyx_n_s_HTTP_NOT_FOUND, __pyx_k_HTTP_NOT_FOUND, sizeof(__pyx_k_HTTP_NOT_FOUND), 0, 0, 1, 1},
  {&__pyx_n_s_HugAPI, __pyx_k_HugAPI, sizeof(__pyx_k_HugAPI), 0, 0, 1, 1},
  {&__pyx_n_s_HugAPI___init, __pyx_k_HugAPI___init, sizeof(__pyx_k_HugAPI___init), 0, 0, 1, 1},
  {&__pyx_n_s_HugAPI_add_directive, __pyx_k_HugAPI_add_directive, sizeof(__pyx_k_HugAPI_add_directive), 0, 0, 1, 1},
  {&__pyx_n_s_HugAPI_add_middleware, __pyx_k_HugAPI_add_middleware, sizeof(__pyx_k_HugAPI_add_middleware), 0, 0, 1, 1},
  {&__pyx_n_s_HugAPI_directive, __pyx_k_HugAPI_directive, sizeof(__pyx_k_HugAPI_directive), 0, 0, 1, 1},
  {&__pyx_n_s_HugAPI_directives, __pyx_k_HugAPI_directives, sizeof(__pyx_k_HugAPI_directives), 0, 0, 1, 1},
  {&__pyx_n_s_HugAPI_extend, __pyx_k_HugAPI_extend, sizeof(__pyx_k_HugAPI_extend), 0, 0, 1, 1},
  {&__pyx_n_s_HugAPI_input_format, __pyx_k_HugAPI_input_format, sizeof(__pyx_k_HugAPI_input_format), 0, 0, 1, 1},
  {&__pyx_n_s_HugAPI_middleware, __pyx_k_HugAPI_middleware, sizeof(__pyx_k_HugAPI_middleware), 0, 0, 1, 1},
  {&__pyx_n_s_HugAPI_not_found_handlers, __pyx_k_HugAPI_not_found_handlers, sizeof(__pyx_k_HugAPI_not_found_handlers), 0, 0, 1, 1},
  {&__pyx_n_s_HugAPI_output_format, __pyx_k_HugAPI_output_format, sizeof(__pyx_k_HugAPI_output_format), 0, 0, 1, 1},
  {&__pyx_n_s_HugAPI_serve, __pyx_k_HugAPI_serve, sizeof(__pyx_k_HugAPI_serve), 0, 0, 1, 1},
  {&__pyx_n_s_HugAPI_set_input_format, __pyx_k_HugAPI_set_input_format, sizeof(__pyx_k_HugAPI_set_input_format), 0, 0, 1, 1},
  {&__pyx_n_s_HugAPI_set_not_found_handler, __pyx_k_HugAPI_set_not_found_handler, sizeof(__pyx_k_HugAPI_set_not_found_handler), 0, 0, 1, 1},
  {&__pyx_n_s_INTRO, __pyx_k_INTRO, sizeof(__pyx_k_INTRO), 0, 0, 1, 1},
  {&__pyx_n_s_InvalidTypeData, __pyx_k_InvalidTypeData, sizeof(__pyx_k_InvalidTypeData), 0, 0, 1, 1},
  {&__pyx_kp_s_Invalid_0_passed_in, __pyx_k_Invalid_0_passed_in, sizeof(__pyx_k_Invalid_0_passed_in), 0, 0, 1, 0},
  {&__pyx_n_s_MiddlewareRouter, __pyx_k_MiddlewareRouter, sizeof(__pyx_k_MiddlewareRouter), 0, 0, 1, 1},
  {&__pyx_n_s_OrderedDict, __pyx_k_OrderedDict, sizeof(__pyx_k_OrderedDict), 0, 0, 1, 1},
  {&__pyx_kp_s_Required_parameter_not_supplied, __pyx_k_Required_parameter_not_supplied, sizeof(__pyx_k_Required_parameter_not_supplied), 0, 0, 1, 0},
  {&__pyx_kp_s_Serving_on_port_0, __pyx_k_Serving_on_port_0, sizeof(__pyx_k_Serving_on_port_0), 0, 0, 1, 0},
  {&__pyx_kp_s_Stores_the_information_necessary, __pyx_k_Stores_the_information_necessary, sizeof(__pyx_k_Stores_the_information_necessary), 0, 0, 1, 0},
  {&__pyx_kp_s__43, __pyx_k__43, sizeof(__pyx_k__43), 0, 0, 1, 0},
  {&__pyx_n_s_accept, __pyx_k_accept, sizeof(__pyx_k_accept), 0, 0, 1, 1},
  {&__pyx_n_s_accepted_parameters, __pyx_k_accepted_parameters, sizeof(__pyx_k_accepted_parameters), 0, 0, 1, 1},
  {&__pyx_n_s_action, __pyx_k_action, sizeof(__pyx_k_action), 0, 0, 1, 1},
  {&__pyx_n_s_add_argument, __pyx_k_add_argument, sizeof(__pyx_k_add_argument), 0, 0, 1, 1},
  {&__pyx_n_s_add_directive, __pyx_k_add_directive, sizeof(__pyx_k_add_directive), 0, 0, 1, 1},
  {&__pyx_n_s_add_middleware, __pyx_k_add_middleware, sizeof(__pyx_k_add_middleware), 0, 0, 1, 1},
  {&__pyx_n_s_annotation, __pyx_k_annotation, sizeof(__pyx_k_annotation), 0, 0, 1, 1},
  {&__pyx_n_s_annotations, __pyx_k_annotations, sizeof(__pyx_k_annotations), 0, 0, 1, 1},
  {&__pyx_n_s_annotations_2, __pyx_k_annotations_2, sizeof(__pyx_k_annotations_2), 0, 0, 1, 1},
  {&__pyx_n_s_api, __pyx_k_api, sizeof(__pyx_k_api), 0, 0, 1, 1},
  {&__pyx_n_s_api_auto_instantiate, __pyx_k_api_auto_instantiate, sizeof(__pyx_k_api_auto_instantiate), 0, 0, 1, 1},
  {&__pyx_n_s_api_function, __pyx_k_api_function, sizeof(__pyx_k_api_function), 0, 0, 1, 1},
  {&__pyx_n_s_api_module, __pyx_k_api_module, sizeof(__pyx_k_api_module), 0, 0, 1, 1},
  {&__pyx_n_s_api_module_locals_api_auto_inst, __pyx_k_api_module_locals_api_auto_inst, sizeof(__pyx_k_api_module_locals_api_auto_inst), 0, 0, 1, 1},
  {&__pyx_n_s_api_version, __pyx_k_api_version, sizeof(__pyx_k_api_version), 0, 0, 1, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_kp_s_application_json, __pyx_k_application_json, sizeof(__pyx_k_application_json), 0, 0, 1, 0},
  {&__pyx_n_s_apply_globally, __pyx_k_apply_globally, sizeof(__pyx_k_apply_globally), 0, 0, 1, 1},
  {&__pyx_n_s_argparse, __pyx_k_argparse, sizeof(__pyx_k_argparse), 0, 0, 1, 1},
  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
  {&__pyx_n_s_arguments, __pyx_k_arguments, sizeof(__pyx_k_arguments), 0, 0, 1, 1},
  {&__pyx_n_s_body, __pyx_k_body, sizeof(__pyx_k_body), 0, 0, 1, 1},
  {&__pyx_n_s_body_formatting_handler, __pyx_k_body_formatting_handler, sizeof(__pyx_k_body_formatting_handler), 0, 0, 1, 1},
  {&__pyx_n_s_call, __pyx_k_call, sizeof(__pyx_k_call), 0, 0, 1, 1},
  {&__pyx_n_s_call_locals_decorator, __pyx_k_call_locals_decorator, sizeof(__pyx_k_call_locals_decorator), 0, 0, 1, 1},
  {&__pyx_n_s_callable_method, __pyx_k_callable_method, sizeof(__pyx_k_callable_method), 0, 0, 1, 1},
  {&__pyx_n_s_chain, __pyx_k_chain, sizeof(__pyx_k_chain), 0, 0, 1, 1},
  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
  {&__pyx_n_s_cli, __pyx_k_cli, sizeof(__pyx_k_cli), 0, 0, 1, 1},
  {&__pyx_n_s_cli_behaviour, __pyx_k_cli_behaviour, sizeof(__pyx_k_cli_behaviour), 0, 0, 1, 1},
  {&__pyx_n_s_cli_interface, __pyx_k_cli_interface, sizeof(__pyx_k_cli_interface), 0, 0, 1, 1},
  {&__pyx_n_s_cli_locals_decorator, __pyx_k_cli_locals_decorator, sizeof(__pyx_k_cli_locals_decorator), 0, 0, 1, 1},
  {&__pyx_n_s_cli_locals_decorator_locals_call, __pyx_k_cli_locals_decorator_locals_call, sizeof(__pyx_k_cli_locals_decorator_locals_call), 0, 0, 1, 1},
  {&__pyx_n_s_cli_locals_decorator_locals_cli, __pyx_k_cli_locals_decorator_locals_cli, sizeof(__pyx_k_cli_locals_decorator_locals_cli), 0, 0, 1, 1},
  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
  {&__pyx_n_s_co_argcount, __pyx_k_co_argcount, sizeof(__pyx_k_co_argcount), 0, 0, 1, 1},
  {&__pyx_n_s_co_flags, __pyx_k_co_flags, sizeof(__pyx_k_co_flags), 0, 0, 1, 1},
  {&__pyx_n_s_co_varnames, __pyx_k_co_varnames, sizeof(__pyx_k_co_varnames), 0, 0, 1, 1},
  {&__pyx_n_s_code, __pyx_k_code, sizeof(__pyx_k_code), 0, 0, 1, 1},
  {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
  {&__pyx_n_s_conclusion, __pyx_k_conclusion, sizeof(__pyx_k_conclusion), 0, 0, 1, 1},
  {&__pyx_n_s_content_length, __pyx_k_content_length, sizeof(__pyx_k_content_length), 0, 0, 1, 1},
  {&__pyx_n_s_content_range, __pyx_k_content_range, sizeof(__pyx_k_content_range), 0, 0, 1, 1},
  {&__pyx_n_s_content_type, __pyx_k_content_type, sizeof(__pyx_k_content_type), 0, 0, 1, 1},
  {&__pyx_n_s_create_interface, __pyx_k_create_interface, sizeof(__pyx_k_create_interface), 0, 0, 1, 1},
  {&__pyx_n_s_create_interface_locals_callabl, __pyx_k_create_interface_locals_callabl, sizeof(__pyx_k_create_interface_locals_callabl), 0, 0, 1, 1},
  {&__pyx_n_s_create_interface_locals_callabl_2, __pyx_k_create_interface_locals_callabl_2, sizeof(__pyx_k_create_interface_locals_callabl_2), 0, 0, 1, 1},
  {&__pyx_n_s_create_interface_locals_interfa, __pyx_k_create_interface_locals_interfa, sizeof(__pyx_k_create_interface_locals_interfa), 0, 0, 1, 1},
  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
  {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
  {&__pyx_n_s_decorator, __pyx_k_decorator, sizeof(__pyx_k_decorator), 0, 0, 1, 1},
  {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1},
  {&__pyx_n_s_default_input_format, __pyx_k_default_input_format, sizeof(__pyx_k_default_input_format), 0, 0, 1, 1},
  {&__pyx_n_s_default_input_format_locals_deco, __pyx_k_default_input_format_locals_deco, sizeof(__pyx_k_default_input_format_locals_deco), 0, 0, 1, 1},
  {&__pyx_n_s_default_kwargs, __pyx_k_default_kwargs, sizeof(__pyx_k_default_kwargs), 0, 0, 1, 1},
  {&__pyx_n_s_default_output_format, __pyx_k_default_output_format, sizeof(__pyx_k_default_output_format), 0, 0, 1, 1},
  {&__pyx_n_s_default_output_format_locals_dec, __pyx_k_default_output_format_locals_dec, sizeof(__pyx_k_default_output_format_locals_dec), 0, 0, 1, 1},
  {&__pyx_n_s_defaults, __pyx_k_defaults, sizeof(__pyx_k_defaults), 0, 0, 1, 1},
  {&__pyx_n_s_defaults_2, __pyx_k_defaults_2, sizeof(__pyx_k_defaults_2), 0, 0, 1, 1},
  {&__pyx_n_s_description, __pyx_k_description, sizeof(__pyx_k_description), 0, 0, 1, 1},
  {&__pyx_n_s_deserialize, __pyx_k_deserialize, sizeof(__pyx_k_deserialize), 0, 0, 1, 1},
  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
  {&__pyx_n_s_directive, __pyx_k_directive, sizeof(__pyx_k_directive), 0, 0, 1, 1},
  {&__pyx_n_s_directive_locals_decorator, __pyx_k_directive_locals_decorator, sizeof(__pyx_k_directive_locals_decorator), 0, 0, 1, 1},
  {&__pyx_n_s_directive_method, __pyx_k_directive_method, sizeof(__pyx_k_directive_method), 0, 0, 1, 1},
  {&__pyx_n_s_directive_sources, __pyx_k_directive_sources, sizeof(__pyx_k_directive_sources), 0, 0, 1, 1},
  {&__pyx_n_s_directives, __pyx_k_directives, sizeof(__pyx_k_directives), 0, 0, 1, 1},
  {&__pyx_n_s_directives_2, __pyx_k_directives_2, sizeof(__pyx_k_directives_2), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_doc_2, __pyx_k_doc_2, sizeof(__pyx_k_doc_2), 0, 0, 1, 1},
  {&__pyx_n_s_dump, __pyx_k_dump, sizeof(__pyx_k_dump), 0, 0, 1, 1},
  {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 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_examples, __pyx_k_examples, sizeof(__pyx_k_examples), 0, 0, 1, 1},
  {&__pyx_n_s_extend, __pyx_k_extend, sizeof(__pyx_k_extend), 0, 0, 1, 1},
  {&__pyx_n_s_extend_api, __pyx_k_extend_api, sizeof(__pyx_k_extend_api), 0, 0, 1, 1},
  {&__pyx_n_s_extend_api_locals_decorator, __pyx_k_extend_api_locals_decorator, sizeof(__pyx_k_extend_api_locals_decorator), 0, 0, 1, 1},
  {&__pyx_n_s_extend_with, __pyx_k_extend_with, sizeof(__pyx_k_extend_with), 0, 0, 1, 1},
  {&__pyx_n_s_extra_kwargs, __pyx_k_extra_kwargs, sizeof(__pyx_k_extra_kwargs), 0, 0, 1, 1},
  {&__pyx_n_s_falcon, __pyx_k_falcon, sizeof(__pyx_k_falcon), 0, 0, 1, 1},
  {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
  {&__pyx_n_s_formatter, __pyx_k_formatter, sizeof(__pyx_k_formatter), 0, 0, 1, 1},
  {&__pyx_n_s_function_output, __pyx_k_function_output, sizeof(__pyx_k_function_output), 0, 0, 1, 1},
  {&__pyx_n_s_function_output_args, __pyx_k_function_output_args, sizeof(__pyx_k_function_output_args), 0, 0, 1, 1},
  {&__pyx_n_s_function_output_kwargs, __pyx_k_function_output_kwargs, sizeof(__pyx_k_function_output_kwargs), 0, 0, 1, 1},
  {&__pyx_n_s_functools, __pyx_k_functools, sizeof(__pyx_k_functools), 0, 0, 1, 1},
  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
  {&__pyx_n_s_getsize, __pyx_k_getsize, sizeof(__pyx_k_getsize), 0, 0, 1, 1},
  {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1},
  {&__pyx_n_s_handler, __pyx_k_handler, sizeof(__pyx_k_handler), 0, 0, 1, 1},
  {&__pyx_n_s_handlers, __pyx_k_handlers, sizeof(__pyx_k_handlers), 0, 0, 1, 1},
  {&__pyx_n_s_help, __pyx_k_help, sizeof(__pyx_k_help), 0, 0, 1, 1},
  {&__pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_k_home_tcrosley_Projects_hug_hug, sizeof(__pyx_k_home_tcrosley_Projects_hug_hug), 0, 0, 1, 0},
  {&__pyx_n_s_httpd, __pyx_k_httpd, sizeof(__pyx_k_httpd), 0, 0, 1, 1},
  {&__pyx_n_s_hug, __pyx_k_hug, sizeof(__pyx_k_hug), 0, 0, 1, 1},
  {&__pyx_n_s_hug_2, __pyx_k_hug_2, sizeof(__pyx_k_hug_2), 0, 0, 1, 1},
  {&__pyx_n_s_hug_3, __pyx_k_hug_3, sizeof(__pyx_k_hug_3), 0, 0, 1, 1},
  {&__pyx_n_s_hug_decorators, __pyx_k_hug_decorators, sizeof(__pyx_k_hug_decorators), 0, 0, 1, 1},
  {&__pyx_n_s_hug_defaults, __pyx_k_hug_defaults, sizeof(__pyx_k_hug_defaults), 0, 0, 1, 1},
  {&__pyx_n_s_hug_exceptions, __pyx_k_hug_exceptions, sizeof(__pyx_k_hug_exceptions), 0, 0, 1, 1},
  {&__pyx_n_s_hug_format, __pyx_k_hug_format, sizeof(__pyx_k_hug_format), 0, 0, 1, 1},
  {&__pyx_n_s_hug_output_format, __pyx_k_hug_output_format, sizeof(__pyx_k_hug_output_format), 0, 0, 1, 1},
  {&__pyx_n_s_hug_run, __pyx_k_hug_run, sizeof(__pyx_k_hug_run), 0, 0, 1, 1},
  {&__pyx_n_s_hug_serving, __pyx_k_hug_serving, sizeof(__pyx_k_hug_serving), 0, 0, 1, 1},
  {&__pyx_n_s_hug_wsgi, __pyx_k_hug_wsgi, sizeof(__pyx_k_hug_wsgi), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_s_input_data, __pyx_k_input_data, sizeof(__pyx_k_input_data), 0, 0, 1, 1},
  {&__pyx_n_s_input_format, __pyx_k_input_format, sizeof(__pyx_k_input_format), 0, 0, 1, 1},
  {&__pyx_n_s_input_format_2, __pyx_k_input_format_2, sizeof(__pyx_k_input_format_2), 0, 0, 1, 1},
  {&__pyx_n_s_input_format_handler, __pyx_k_input_format_handler, sizeof(__pyx_k_input_format_handler), 0, 0, 1, 1},
  {&__pyx_n_s_input_parameters, __pyx_k_input_parameters, sizeof(__pyx_k_input_parameters), 0, 0, 1, 1},
  {&__pyx_n_s_input_transformations, __pyx_k_input_transformations, sizeof(__pyx_k_input_transformations), 0, 0, 1, 1},
  {&__pyx_n_s_interface, __pyx_k_interface, sizeof(__pyx_k_interface), 0, 0, 1, 1},
  {&__pyx_n_s_intersection, __pyx_k_intersection, sizeof(__pyx_k_intersection), 0, 0, 1, 1},
  {&__pyx_n_s_is_method, __pyx_k_is_method, sizeof(__pyx_k_is_method), 0, 0, 1, 1},
  {&__pyx_n_s_isfile, __pyx_k_isfile, sizeof(__pyx_k_isfile), 0, 0, 1, 1},
  {&__pyx_n_s_item_route, __pyx_k_item_route, sizeof(__pyx_k_item_route), 0, 0, 1, 1},
  {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
  {&__pyx_n_s_itertools, __pyx_k_itertools, sizeof(__pyx_k_itertools), 0, 0, 1, 1},
  {&__pyx_n_s_karg_method, __pyx_k_karg_method, sizeof(__pyx_k_karg_method), 0, 0, 1, 1},
  {&__pyx_n_s_karg_values, __pyx_k_karg_values, sizeof(__pyx_k_karg_values), 0, 0, 1, 1},
  {&__pyx_n_s_kargs, __pyx_k_kargs, sizeof(__pyx_k_kargs), 0, 0, 1, 1},
  {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
  {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
  {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1},
  {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1},
  {&__pyx_n_s_load, __pyx_k_load, sizeof(__pyx_k_load), 0, 0, 1, 1},
  {&__pyx_n_s_loads, __pyx_k_loads, sizeof(__pyx_k_loads), 0, 0, 1, 1},
  {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_make_server, __pyx_k_make_server, sizeof(__pyx_k_make_server), 0, 0, 1, 1},
  {&__pyx_n_s_marshmallow, __pyx_k_marshmallow, sizeof(__pyx_k_marshmallow), 0, 0, 1, 1},
  {&__pyx_n_s_marshmallow_schema, __pyx_k_marshmallow_schema, sizeof(__pyx_k_marshmallow_schema), 0, 0, 1, 1},
  {&__pyx_n_s_marshmallow_schema_locals_marsh, __pyx_k_marshmallow_schema_locals_marsh, sizeof(__pyx_k_marshmallow_schema_locals_marsh), 0, 0, 1, 1},
  {&__pyx_n_s_marshmallow_type, __pyx_k_marshmallow_type, sizeof(__pyx_k_marshmallow_type), 0, 0, 1, 1},
  {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1},
  {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_method, __pyx_k_method, sizeof(__pyx_k_method), 0, 0, 1, 1},
  {&__pyx_n_s_method_handler, __pyx_k_method_handler, sizeof(__pyx_k_method_handler), 0, 0, 1, 1},
  {&__pyx_n_s_middleware, __pyx_k_middleware, sizeof(__pyx_k_middleware), 0, 0, 1, 1},
  {&__pyx_n_s_middleware_2, __pyx_k_middleware_2, sizeof(__pyx_k_middleware_2), 0, 0, 1, 1},
  {&__pyx_n_s_middleware_method, __pyx_k_middleware_method, sizeof(__pyx_k_middleware_method), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_module_2, __pyx_k_module_2, sizeof(__pyx_k_module_2), 0, 0, 1, 1},
  {&__pyx_n_s_module_name, __pyx_k_module_name, sizeof(__pyx_k_module_name), 0, 0, 1, 1},
  {&__pyx_n_s_modules, __pyx_k_modules, sizeof(__pyx_k_modules), 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_named_directives, __pyx_k_named_directives, sizeof(__pyx_k_named_directives), 0, 0, 1, 1},
  {&__pyx_n_s_namedtuple, __pyx_k_namedtuple, sizeof(__pyx_k_namedtuple), 0, 0, 1, 1},
  {&__pyx_n_s_nargs, __pyx_k_nargs, sizeof(__pyx_k_nargs), 0, 0, 1, 1},
  {&__pyx_n_s_nargs_set, __pyx_k_nargs_set, sizeof(__pyx_k_nargs_set), 0, 0, 1, 1},
  {&__pyx_n_s_no_documentation, __pyx_k_no_documentation, sizeof(__pyx_k_no_documentation), 0, 0, 1, 1},
  {&__pyx_n_s_not_found, __pyx_k_not_found, sizeof(__pyx_k_not_found), 0, 0, 1, 1},
  {&__pyx_n_s_not_found_handlers, __pyx_k_not_found_handlers, sizeof(__pyx_k_not_found_handlers), 0, 0, 1, 1},
  {&__pyx_n_s_not_found_handlers_2, __pyx_k_not_found_handlers_2, sizeof(__pyx_k_not_found_handlers_2), 0, 0, 1, 1},
  {&__pyx_n_s_not_found_locals_decorator, __pyx_k_not_found_locals_decorator, sizeof(__pyx_k_not_found_locals_decorator), 0, 0, 1, 1},
  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
  {&__pyx_n_s_option, __pyx_k_option, sizeof(__pyx_k_option), 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_format, __pyx_k_output_format, sizeof(__pyx_k_output_format), 0, 0, 1, 1},
  {&__pyx_n_s_output_format_2, __pyx_k_output_format_2, sizeof(__pyx_k_output_format_2), 0, 0, 1, 1},
  {&__pyx_n_s_output_transform, __pyx_k_output_transform, sizeof(__pyx_k_output_transform), 0, 0, 1, 1},
  {&__pyx_n_s_output_type, __pyx_k_output_type, sizeof(__pyx_k_output_type), 0, 0, 1, 1},
  {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1},
  {&__pyx_n_s_parameter, __pyx_k_parameter, sizeof(__pyx_k_parameter), 0, 0, 1, 1},
  {&__pyx_n_s_parameters, __pyx_k_parameters, sizeof(__pyx_k_parameters), 0, 0, 1, 1},
  {&__pyx_n_s_params, __pyx_k_params, sizeof(__pyx_k_params), 0, 0, 1, 1},
  {&__pyx_n_s_parse_args, __pyx_k_parse_args, sizeof(__pyx_k_parse_args), 0, 0, 1, 1},
  {&__pyx_n_s_parse_body, __pyx_k_parse_body, sizeof(__pyx_k_parse_body), 0, 0, 1, 1},
  {&__pyx_n_s_parser, __pyx_k_parser, sizeof(__pyx_k_parser), 0, 0, 1, 1},
  {&__pyx_n_s_partial, __pyx_k_partial, sizeof(__pyx_k_partial), 0, 0, 1, 1},
  {&__pyx_n_s_pass_to_function, __pyx_k_pass_to_function, sizeof(__pyx_k_pass_to_function), 0, 0, 1, 1},
  {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
  {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1},
  {&__pyx_n_s_port, __pyx_k_port, sizeof(__pyx_k_port), 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_request, __pyx_k_process_request, sizeof(__pyx_k_process_request), 0, 0, 1, 1},
  {&__pyx_n_s_process_response, __pyx_k_process_response, sizeof(__pyx_k_process_response), 0, 0, 1, 1},
  {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1},
  {&__pyx_n_s_reasons, __pyx_k_reasons, sizeof(__pyx_k_reasons), 0, 0, 1, 1},
  {&__pyx_n_s_request, __pyx_k_request, sizeof(__pyx_k_request), 0, 0, 1, 1},
  {&__pyx_n_s_request_middleware, __pyx_k_request_middleware, sizeof(__pyx_k_request_middleware), 0, 0, 1, 1},
  {&__pyx_n_s_request_middleware_locals_decora, __pyx_k_request_middleware_locals_decora, sizeof(__pyx_k_request_middleware_locals_decora), 0, 0, 1, 1},
  {&__pyx_n_s_require, __pyx_k_require, sizeof(__pyx_k_require), 0, 0, 1, 1},
  {&__pyx_n_s_required, __pyx_k_required, sizeof(__pyx_k_required), 0, 0, 1, 1},
  {&__pyx_n_s_requirement, __pyx_k_requirement, sizeof(__pyx_k_requirement), 0, 0, 1, 1},
  {&__pyx_n_s_requires, __pyx_k_requires, sizeof(__pyx_k_requires), 0, 0, 1, 1},
  {&__pyx_n_s_response, __pyx_k_response, sizeof(__pyx_k_response), 0, 0, 1, 1},
  {&__pyx_n_s_response_middleware, __pyx_k_response_middleware, sizeof(__pyx_k_response_middleware), 0, 0, 1, 1},
  {&__pyx_n_s_response_middleware_locals_decor, __pyx_k_response_middleware_locals_decor, sizeof(__pyx_k_response_middleware_locals_decor), 0, 0, 1, 1},
  {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
  {&__pyx_n_s_return, __pyx_k_return, sizeof(__pyx_k_return), 0, 0, 1, 1},
  {&__pyx_n_s_reversed, __pyx_k_reversed, sizeof(__pyx_k_reversed), 0, 0, 1, 1},
  {&__pyx_n_s_route, __pyx_k_route, sizeof(__pyx_k_route), 0, 0, 1, 1},
  {&__pyx_n_s_routes, __pyx_k_routes, sizeof(__pyx_k_routes), 0, 0, 1, 1},
  {&__pyx_n_s_seek, __pyx_k_seek, sizeof(__pyx_k_seek), 0, 0, 1, 1},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_n_s_self_2, __pyx_k_self_2, sizeof(__pyx_k_self_2), 0, 0, 1, 1},
  {&__pyx_n_s_serve, __pyx_k_serve, sizeof(__pyx_k_serve), 0, 0, 1, 1},
  {&__pyx_n_s_serve_forever, __pyx_k_serve_forever, sizeof(__pyx_k_serve_forever), 0, 0, 1, 1},
  {&__pyx_n_s_server, __pyx_k_server, sizeof(__pyx_k_server), 0, 0, 1, 1},
  {&__pyx_n_s_set_input_format, __pyx_k_set_input_format, sizeof(__pyx_k_set_input_format), 0, 0, 1, 1},
  {&__pyx_n_s_set_not_found_handler, __pyx_k_set_not_found_handler, sizeof(__pyx_k_set_not_found_handler), 0, 0, 1, 1},
  {&__pyx_n_s_set_status, __pyx_k_set_status, sizeof(__pyx_k_set_status), 0, 0, 1, 1},
  {&__pyx_n_s_setdefault, __pyx_k_setdefault, sizeof(__pyx_k_setdefault), 0, 0, 1, 1},
  {&__pyx_n_s_setter, __pyx_k_setter, sizeof(__pyx_k_setter), 0, 0, 1, 1},
  {&__pyx_n_s_short_option, __pyx_k_short_option, sizeof(__pyx_k_short_option), 0, 0, 1, 1},
  {&__pyx_n_s_sink, __pyx_k_sink, sizeof(__pyx_k_sink), 0, 0, 1, 1},
  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
  {&__pyx_n_s_slots, __pyx_k_slots, sizeof(__pyx_k_slots), 0, 0, 1, 1},
  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
  {&__pyx_n_s_status, __pyx_k_status, sizeof(__pyx_k_status), 0, 0, 1, 1},
  {&__pyx_n_s_store_true, __pyx_k_store_true, sizeof(__pyx_k_store_true), 0, 0, 1, 1},
  {&__pyx_n_s_stream, __pyx_k_stream, sizeof(__pyx_k_stream), 0, 0, 1, 1},
  {&__pyx_n_s_stream_len, __pyx_k_stream_len, sizeof(__pyx_k_stream_len), 0, 0, 1, 1},
  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
  {&__pyx_n_s_takes_kargs, __pyx_k_takes_kargs, sizeof(__pyx_k_takes_kargs), 0, 0, 1, 1},
  {&__pyx_n_s_takes_kwargs, __pyx_k_takes_kwargs, sizeof(__pyx_k_takes_kwargs), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_to_return, __pyx_k_to_return, sizeof(__pyx_k_to_return), 0, 0, 1, 1},
  {&__pyx_n_s_transform, __pyx_k_transform, sizeof(__pyx_k_transform), 0, 0, 1, 1},
  {&__pyx_n_s_transform_args, __pyx_k_transform_args, sizeof(__pyx_k_transform_args), 0, 0, 1, 1},
  {&__pyx_n_s_transformer, __pyx_k_transformer, sizeof(__pyx_k_transformer), 0, 0, 1, 1},
  {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
  {&__pyx_n_s_type_handler, __pyx_k_type_handler, sizeof(__pyx_k_type_handler), 0, 0, 1, 1},
  {&__pyx_n_s_underscore, __pyx_k_underscore, sizeof(__pyx_k_underscore), 0, 0, 1, 1},
  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
  {&__pyx_n_s_upper, __pyx_k_upper, sizeof(__pyx_k_upper), 0, 0, 1, 1},
  {&__pyx_n_s_url, __pyx_k_url, sizeof(__pyx_k_url), 0, 0, 1, 1},
  {&__pyx_n_s_urls, __pyx_k_urls, sizeof(__pyx_k_urls), 0, 0, 1, 1},
  {&__pyx_n_s_use_directives, __pyx_k_use_directives, sizeof(__pyx_k_use_directives), 0, 0, 1, 1},
  {&__pyx_n_s_use_examples, __pyx_k_use_examples, sizeof(__pyx_k_use_examples), 0, 0, 1, 1},
  {&__pyx_n_s_used_options, __pyx_k_used_options, sizeof(__pyx_k_used_options), 0, 0, 1, 1},
  {&__pyx_n_s_utf8, __pyx_k_utf8, sizeof(__pyx_k_utf8), 0, 0, 1, 1},
  {&__pyx_kp_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 0},
  {&__pyx_n_s_v_2, __pyx_k_v_2, sizeof(__pyx_k_v_2), 0, 0, 1, 1},
  {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
  {&__pyx_n_s_vars, __pyx_k_vars, sizeof(__pyx_k_vars), 0, 0, 1, 1},
  {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1},
  {&__pyx_kp_s_version_2, __pyx_k_version_2, sizeof(__pyx_k_version_2), 0, 0, 1, 0},
  {&__pyx_n_s_version_mapping, __pyx_k_version_mapping, sizeof(__pyx_k_version_mapping), 0, 0, 1, 1},
  {&__pyx_n_s_versioned, __pyx_k_versioned, sizeof(__pyx_k_versioned), 0, 0, 1, 1},
  {&__pyx_n_s_versions, __pyx_k_versions, sizeof(__pyx_k_versions), 0, 0, 1, 1},
  {&__pyx_n_s_without_directives, __pyx_k_without_directives, sizeof(__pyx_k_without_directives), 0, 0, 1, 1},
  {&__pyx_n_s_wraps, __pyx_k_wraps, sizeof(__pyx_k_wraps), 0, 0, 1, 1},
  {&__pyx_n_s_wsgiref_simple_server, __pyx_k_wsgiref_simple_server, sizeof(__pyx_k_wsgiref_simple_server), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_reversed = __Pyx_GetBuiltinName(__pyx_n_s_reversed); if (!__pyx_builtin_reversed) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_vars = __Pyx_GetBuiltinName(__pyx_n_s_vars); if (!__pyx_builtin_vars) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __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);

  /* "hug/decorators.py":139
 * def default_output_format(content_type='application/json', apply_globally=False):
 *     '''A decorator that allows you to override the default output format for an API'''
 *     def decorator(formatter):             # <<<<<<<<<<<<<<
 *         module = _api_module(formatter.__module__)
 *         formatter = hug.output_format.content_type(content_type)(formatter)
 */
  __pyx_tuple__2 = PyTuple_Pack(2, __pyx_n_s_formatter, __pyx_n_s_module); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);
  __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_decorator, 139, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":152
 * def default_input_format(content_type='application/json', apply_globally=False):
 *     '''A decorator that allows you to override the default output format for an API'''
 *     def decorator(formatter):             # <<<<<<<<<<<<<<
 *         module = _api_module(formatter.__module__)
 *         formatter = hug.output_format.content_type(content_type)(formatter)
 */
  __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_formatter, __pyx_n_s_module); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);
  __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_decorator, 152, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":165
 * def directive(apply_globally=True):
 *     '''A decorator that registers a single hug directive'''
 *     def decorator(directive_method):             # <<<<<<<<<<<<<<
 *         if apply_globally:
 *             hug.defaults.directives[underscore(directive_method.__name__)] = directive_method
 */
  __pyx_tuple__6 = PyTuple_Pack(2, __pyx_n_s_directive_method, __pyx_n_s_module); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);
  __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_decorator, 165, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":181
 *         module = _api_module(middleware_method.__module__)
 *         middleware_method.__self__ = middleware_method
 *         module.__hug__.add_middleware(namedtuple('MiddlewareRouter', ('process_request', ))(middleware_method))             # <<<<<<<<<<<<<<
 *         return middleware_method
 *     return decorator
 */
  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_process_request); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);
  __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_MiddlewareRouter, __pyx_tuple__8); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);

  /* "hug/decorators.py":178
 * def request_middleware():
 *     '''Registers a middleware function that will be called on every request'''
 *     def decorator(middleware_method):             # <<<<<<<<<<<<<<
 *         module = _api_module(middleware_method.__module__)
 *         middleware_method.__self__ = middleware_method
 */
  __pyx_tuple__10 = PyTuple_Pack(2, __pyx_n_s_middleware_method, __pyx_n_s_module); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);
  __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_decorator, 178, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":191
 *         module = _api_module(middleware_method.__module__)
 *         middleware_method.__self__ = middleware_method
 *         module.__hug__.add_middleware(namedtuple('MiddlewareRouter', ('process_response', ))(middleware_method))             # <<<<<<<<<<<<<<
 *         return middleware_method
 *     return decorator
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_process_response); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);
  __pyx_tuple__13 = PyTuple_Pack(2, __pyx_n_s_MiddlewareRouter, __pyx_tuple__12); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "hug/decorators.py":188
 * def response_middleware():
 *     '''Registers a middleware function that will be called on every response'''
 *     def decorator(middleware_method):             # <<<<<<<<<<<<<<
 *         module = _api_module(middleware_method.__module__)
 *         middleware_method.__self__ = middleware_method
 */
  __pyx_tuple__14 = PyTuple_Pack(2, __pyx_n_s_middleware_method, __pyx_n_s_module); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);
  __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_decorator, 188, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":198
 * def extend_api(route=""):
 *     '''Extends the current api, with handlers from an imported api. Optionally provide a route that prefixes access'''
 *     def decorator(extend_with):             # <<<<<<<<<<<<<<
 *         module = _api_module(extend_with.__module__)
 *         for api in extend_with():
 */
  __pyx_tuple__16 = PyTuple_Pack(3, __pyx_n_s_extend_with, __pyx_n_s_module, __pyx_n_s_api); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);
  __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_decorator, 198, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":209
 *     module = sys.modules[module_name]
 *     if not '__hug__' in module.__dict__:
 *         def api_auto_instantiate(*kargs, **kwargs):             # <<<<<<<<<<<<<<
 *             if not hasattr(module, '__hug_serving__'):
 *                 module.__hug_wsgi__ = server(module)
 */
  __pyx_tuple__18 = PyTuple_Pack(2, __pyx_n_s_kargs, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);
  __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_api_auto_instantiate, 209, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":221
 * def _marshmallow_schema(marshmallow):
 *     '''Dynamically generates a hug style type handler from a Marshmallow style schema'''
 *     def marshmallow_type(input_data):             # <<<<<<<<<<<<<<
 *         result, errors = marshmallow.loads(input_data) if isinstance(input_data, str) else marshmallow.load(input_data)
 *         if errors:
 */
  __pyx_tuple__20 = PyTuple_Pack(3, __pyx_n_s_input_data, __pyx_n_s_result, __pyx_n_s_errors); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);
  __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_marshmallow_type, 221, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":253
 *     directives = module.__hug__.directives()
 *     use_directives = set(accepted_parameters).intersection(directives.keys())
 *     if transform is None and not isinstance(api_function.__annotations__.get('return', None), (str, type(None))):             # <<<<<<<<<<<<<<
 *         transform = api_function.__annotations__['return']
 * 
 */
  __pyx_tuple__22 = PyTuple_Pack(2, __pyx_n_s_return, Py_None); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "hug/decorators.py":260
 *         output_type = transform
 *     else:
 *         output_type = transform or api_function.__annotations__.get('return', None)             # <<<<<<<<<<<<<<
 * 
 *     if transform and hasattr(transform, '__code__'):
 */
  __pyx_tuple__23 = PyTuple_Pack(2, __pyx_n_s_return, Py_None); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "hug/decorators.py":268
 *     if 'method' in api_function.__class__.__name__:
 *         is_method = True
 *         required = required[1:]             # <<<<<<<<<<<<<<
 * 
 *     input_transformations = {}
 */
  __pyx_slice__24 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__24);
  __Pyx_GIVEREF(__pyx_slice__24);

  /* "hug/decorators.py":286
 *         input_transformations[name] = transformer
 * 
 *     def interface(request, response, api_version=None, **kwargs):             # <<<<<<<<<<<<<<
 *         if set_status:
 *             response.status = set_status
 */
  __pyx_tuple__25 = PyTuple_Pack(24, __pyx_n_s_request, __pyx_n_s_response, __pyx_n_s_api_version, __pyx_n_s_kwargs, __pyx_n_s_function_output_kwargs, __pyx_n_s_requirement, __pyx_n_s_conclusion, __pyx_n_s_input_parameters, __pyx_n_s_body, __pyx_n_s_body_formatting_handler, __pyx_n_s_errors, __pyx_n_s_key, __pyx_n_s_type_handler, __pyx_n_s_error, __pyx_n_s_parameter, __pyx_n_s_directive, __pyx_n_s_arguments, __pyx_n_s_require, __pyx_n_s_to_return, __pyx_n_s_extra_kwargs, __pyx_n_s_size, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_length); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);
  __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(3, 0, 24, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_interface, 286, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_tuple__27 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "hug/decorators.py":400
 *     if named_directives and not getattr(api_function, 'without_directives', None):
 *         @wraps(api_function)
 *         def callable_method(*args, **kwargs):             # <<<<<<<<<<<<<<
 *             for parameter, directive in named_directives.items():
 *                 if parameter in kwargs:
 */
  __pyx_tuple__28 = PyTuple_Pack(5, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_parameter, __pyx_n_s_directive, __pyx_n_s_arguments); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);
  __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(0, 0, 5, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_callable_method, 400, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":430
 *     requires = (requires, ) if not isinstance(requires, (tuple, list)) else requires
 * 
 *     def decorator(api_function):             # <<<<<<<<<<<<<<
 *         module = _api_module(api_function.__module__)
 *         (interface, callable_method) = _create_interface(module, api_function, output=output,
 */
  __pyx_tuple__30 = PyTuple_Pack(5, __pyx_n_s_api_function, __pyx_n_s_module, __pyx_n_s_interface, __pyx_n_s_callable_method, __pyx_n_s_version); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);
  __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_decorator, 430, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":461
 *         use_examples = examples
 *         if not interface.required and not use_examples:
 *             use_examples = (True, )             # <<<<<<<<<<<<<<
 *         for url in urls or ("/{0}".format(api_function.__name__), ):
 *             handlers = module.__hug__.routes.setdefault(url, {})
 */
  __pyx_tuple__32 = PyTuple_Pack(1, Py_True); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);

  /* "hug/decorators.py":452
 *     requires = (requires, ) if not isinstance(requires, (tuple, list)) else requires
 * 
 *     def decorator(api_function):             # <<<<<<<<<<<<<<
 *         module = _api_module(api_function.__module__)
 *         (interface, callable_method) = _create_interface(module, api_function, output=output,
 */
  __pyx_tuple__33 = PyTuple_Pack(10, __pyx_n_s_api_function, __pyx_n_s_module, __pyx_n_s_interface, __pyx_n_s_callable_method, __pyx_n_s_use_examples, __pyx_n_s_url, __pyx_n_s_handlers, __pyx_n_s_method, __pyx_n_s_version_mapping, __pyx_n_s_version); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);
  __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_decorator, 452, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":578
 *                 result = output_transform(result)
 *             if hasattr(result, 'read'):
 *                 result = result.read().decode('utf8')             # <<<<<<<<<<<<<<
 *             if cli_interface.output is not None and result is not None:
 *                 cli_interface.output(result)
 */
  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);

  /* "hug/decorators.py":499
 *         directives = module.__hug__.directives()
 *         use_directives = set(accepted_parameters).intersection(directives.keys())
 *         output_transform = transform or api_function.__annotations__.get('return', None)             # <<<<<<<<<<<<<<
 * 
 *         is_method = False
 */
  __pyx_tuple__36 = PyTuple_Pack(2, __pyx_n_s_return, Py_None); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);

  /* "hug/decorators.py":504
 *         if 'method' in api_function.__class__.__name__:
 *             is_method = True
 *             required = required[1:]             # <<<<<<<<<<<<<<
 *             accepted_parameters = accepted_parameters[1:]
 * 
 */
  __pyx_slice__37 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__37);
  __Pyx_GIVEREF(__pyx_slice__37);

  /* "hug/decorators.py":505
 *             is_method = True
 *             required = required[1:]
 *             accepted_parameters = accepted_parameters[1:]             # <<<<<<<<<<<<<<
 * 
 *         used_options = {'h', 'help'}
 */
  __pyx_slice__38 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__38);
  __Pyx_GIVEREF(__pyx_slice__38);

  /* "hug/decorators.py":510
 *         parser = argparse.ArgumentParser(description=doc or api_function.__doc__)
 *         if version:
 *             parser.add_argument('-v', '--version', action='version',             # <<<<<<<<<<<<<<
 *                                 version="{0} {1}".format(name or api_function.__name__, version))
 *             used_options.update(('v', 'version'))
 */
  __pyx_tuple__39 = PyTuple_Pack(2, __pyx_kp_s_v, __pyx_kp_s_version_2); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);

  /* "hug/decorators.py":512
 *             parser.add_argument('-v', '--version', action='version',
 *                                 version="{0} {1}".format(name or api_function.__name__, version))
 *             used_options.update(('v', 'version'))             # <<<<<<<<<<<<<<
 * 
 *         annotations = api_function.__annotations__
 */
  __pyx_tuple__40 = PyTuple_Pack(2, __pyx_n_s_v_2, __pyx_n_s_version); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);

  /* "hug/decorators.py":551
 *                     kwargs['default'] == False):
 *                 kwargs['action'] = 'store_true'
 *                 kwargs.pop('type', None)             # <<<<<<<<<<<<<<
 *             elif kwargs.get('action', None) == 'store_true':
 *                 kwargs.pop('action', None) == 'store_true'
 */
  __pyx_tuple__41 = PyTuple_Pack(2, __pyx_n_s_type, Py_None); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);

  /* "hug/decorators.py":553
 *                 kwargs.pop('type', None)
 *             elif kwargs.get('action', None) == 'store_true':
 *                 kwargs.pop('action', None) == 'store_true'             # <<<<<<<<<<<<<<
 * 
 *             if option == karg_method or ():
 */
  __pyx_tuple__42 = PyTuple_Pack(2, __pyx_n_s_action, Py_None); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

  /* "hug/decorators.py":559
 *             elif not nargs_set and kwargs.get('action', None) == 'append' and not option in defaults:
 *                 kwargs['nargs'] = '*'
 *                 kwargs.pop('action', '')             # <<<<<<<<<<<<<<
 *                 nargs_set = True
 * 
 */
  __pyx_tuple__44 = PyTuple_Pack(2, __pyx_n_s_action, __pyx_kp_s_); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);

  /* "hug/decorators.py":564
 *             parser.add_argument(*args, **kwargs)
 * 
 *         def cli_interface():             # <<<<<<<<<<<<<<
 *             pass_to_function = vars(parser.parse_args())
 *             for option, directive in named_directives.items():
 */
  __pyx_tuple__45 = PyTuple_Pack(6, __pyx_n_s_pass_to_function, __pyx_n_s_option, __pyx_n_s_directive, __pyx_n_s_arguments, __pyx_n_s_karg_values, __pyx_n_s_result); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);
  __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(0, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_cli_interface, 564, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":587
 *         if named_directives and not getattr(api_function, 'without_directives', None):
 *             @wraps(api_function)
 *             def callable_method(*args, **kwargs):             # <<<<<<<<<<<<<<
 *                 for parameter, directive in named_directives.items():
 *                     if parameter in kwargs:
 */
  __pyx_tuple__47 = PyTuple_Pack(5, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_parameter, __pyx_n_s_directive, __pyx_n_s_arguments); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);
  __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(0, 0, 5, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_callable_method, 587, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":477
 * def cli(name=None, version=None, doc=None, transform=None, output=None):
 *     '''Enables exposing a Hug compatible function as a Command Line Interface'''
 *     def decorator(api_function):             # <<<<<<<<<<<<<<
 *         module = module = _api_module(api_function.__module__)
 * 
 */
  __pyx_tuple__49 = PyTuple_Pack(27, __pyx_n_s_api_function, __pyx_n_s_module, __pyx_n_s_takes_kargs, __pyx_n_s_accepted_parameters, __pyx_n_s_karg_method, __pyx_n_s_nargs_set, __pyx_n_s_defaults, __pyx_n_s_index, __pyx_n_s_default, __pyx_n_s_required, __pyx_n_s_directives, __pyx_n_s_use_directives, __pyx_n_s_output_transform, __pyx_n_s_is_method, __pyx_n_s_used_options, __pyx_n_s_parser, __pyx_n_s_annotations_2, __pyx_n_s_named_directives, __pyx_n_s_option, __pyx_n_s_args, __pyx_n_s_short_option, __pyx_n_s_kwargs, __pyx_n_s_annotation, __pyx_n_s_cli_interface, __pyx_n_s_cli_interface, __pyx_n_s_callable_method, __pyx_n_s_callable_method); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);
  __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(1, 0, 27, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_decorator, 477, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":48
 * class HugAPI(object):
 *     '''Stores the information necessary to expose API calls within this module externally'''
 *     __slots__ = ('module', 'versions', 'routes', '_output_format', '_input_format', '_directives', 'versioned',             # <<<<<<<<<<<<<<
 *                  '_middleware', '_not_found_handlers')
 * 
 */
  __pyx_tuple__51 = PyTuple_Pack(9, __pyx_n_s_module, __pyx_n_s_versions, __pyx_n_s_routes, __pyx_n_s_output_format, __pyx_n_s_input_format, __pyx_n_s_directives_2, __pyx_n_s_versioned, __pyx_n_s_middleware, __pyx_n_s_not_found_handlers); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);

  /* "hug/decorators.py":51
 *                  '_middleware', '_not_found_handlers')
 * 
 *     def __init__(self, module):             # <<<<<<<<<<<<<<
 *         self.module = module
 *         self.versions = set()
 */
  __pyx_tuple__52 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_module); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __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_home_tcrosley_Projects_hug_hug, __pyx_n_s_init, 51, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":58
 * 
 *     @property
 *     def output_format(self):             # <<<<<<<<<<<<<<
 *         return getattr(self, '_output_format', hug.defaults.output_format)
 * 
 */
  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __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_home_tcrosley_Projects_hug_hug, __pyx_n_s_output_format_2, 58, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":62
 * 
 *     @output_format.setter
 *     def output_format(self, formatter):             # <<<<<<<<<<<<<<
 *         self._output_format = formatter
 * 
 */
  __pyx_tuple__56 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_formatter); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __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_home_tcrosley_Projects_hug_hug, __pyx_n_s_output_format_2, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":65
 *         self._output_format = formatter
 * 
 *     def input_format(self, content_type):             # <<<<<<<<<<<<<<
 *         '''Returns the set input_format handler for the given content_type'''
 *         return getattr(self, '_input_format', {}).get(content_type, hug.defaults.input_format.get(content_type, None))
 */
  __pyx_tuple__58 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_content_type); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);
  __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_input_format_2, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":69
 *         return getattr(self, '_input_format', {}).get(content_type, hug.defaults.input_format.get(content_type, None))
 * 
 *     def set_input_format(self, content_type, handler):             # <<<<<<<<<<<<<<
 *         '''Sets an input format handler for this Hug API, given the specified content_type'''
 *         if getattr(self, '_input_format', None) is None:
 */
  __pyx_tuple__60 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_content_type, __pyx_n_s_handler); if (unlikely(!__pyx_tuple__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__60);
  __Pyx_GIVEREF(__pyx_tuple__60);
  __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_set_input_format, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":75
 *         self._input_format[content_type] = handler
 * 
 *     def directives(self):             # <<<<<<<<<<<<<<
 *         '''Returns all directives applicable to this Hug API'''
 *         directive_sources = chain(hug.defaults.directives.items(), getattr(self, '_directives', {}).items())
 */
  __pyx_tuple__62 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_directive_sources); if (unlikely(!__pyx_tuple__62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);
  __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(1, 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_home_tcrosley_Projects_hug_hug, __pyx_n_s_directives, 75, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":80
 *         return {'hug_' + directive_name: directive for directive_name, directive in directive_sources}
 * 
 *     def directive(self, name, default=None):             # <<<<<<<<<<<<<<
 *         '''Returns the loaded directive with the specified name, or default if passed name is not present'''
 *         return getattr(self, '_directives', {}).get(name,  hug.defaults.directives.get(name, default))
 */
  __pyx_tuple__64 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_default); if (unlikely(!__pyx_tuple__64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);
  __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_directive, 80, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_tuple__66 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__66);
  __Pyx_GIVEREF(__pyx_tuple__66);

  /* "hug/decorators.py":84
 *         return getattr(self, '_directives', {}).get(name,  hug.defaults.directives.get(name, default))
 * 
 *     def add_directive(self, directive):             # <<<<<<<<<<<<<<
 *         self._directives = getattr(self, '_directives', {})
 *         self._directives[directive.__name__] = directive
 */
  __pyx_tuple__67 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_directive); if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);
  __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_add_directive, 84, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":89
 * 
 *     @property
 *     def middleware(self):             # <<<<<<<<<<<<<<
 *         return getattr(self, '_middleware', None)
 * 
 */
  __pyx_tuple__69 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__69);
  __Pyx_GIVEREF(__pyx_tuple__69);
  __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_middleware_2, 89, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":92
 *         return getattr(self, '_middleware', None)
 * 
 *     def add_middleware(self, middleware):             # <<<<<<<<<<<<<<
 *         '''Adds a middleware object used to process all incoming requests against the API'''
 *         if self.middleware is None:
 */
  __pyx_tuple__71 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_middleware_2); if (unlikely(!__pyx_tuple__71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__71);
  __Pyx_GIVEREF(__pyx_tuple__71);
  __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_add_middleware, 92, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":98
 *         self.middleware.append(middleware)
 * 
 *     def extend(self, module, route=""):             # <<<<<<<<<<<<<<
 *         '''Adds handlers from a different Hug API module to this one - to create a single API'''
 *         for item_route, handler in module.__hug__.routes.items():
 */
  __pyx_tuple__73 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_module, __pyx_n_s_route, __pyx_n_s_item_route, __pyx_n_s_handler, __pyx_n_s_directive, __pyx_n_s_middleware_2, __pyx_n_s_input_format_2, __pyx_n_s_input_format_handler); if (unlikely(!__pyx_tuple__73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__73);
  __Pyx_GIVEREF(__pyx_tuple__73);
  __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_extend, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_tuple__75 = PyTuple_Pack(1, ((PyObject*)__pyx_kp_s_)); if (unlikely(!__pyx_tuple__75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__75);
  __Pyx_GIVEREF(__pyx_tuple__75);

  /* "hug/decorators.py":114
 * 
 *     @property
 *     def not_found_handlers(self):             # <<<<<<<<<<<<<<
 *         return getattr(self, '_not_found_handlers', {})
 * 
 */
  __pyx_tuple__76 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);
  __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_not_found_handlers_2, 114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":117
 *         return getattr(self, '_not_found_handlers', {})
 * 
 *     def set_not_found_handler(self, handler, version=None):             # <<<<<<<<<<<<<<
 *         '''Sets the not_found handler for the specified version of the api'''
 *         if not self.not_found_handlers:
 */
  __pyx_tuple__78 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_handler, __pyx_n_s_version); if (unlikely(!__pyx_tuple__78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__78);
  __Pyx_GIVEREF(__pyx_tuple__78);
  __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_set_not_found_handler, 117, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_tuple__80 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__80);
  __Pyx_GIVEREF(__pyx_tuple__80);

  /* "hug/decorators.py":124
 *         self.not_found_handlers[version] = handler
 * 
 *     def serve(self, port=8000, no_documentation=False):             # <<<<<<<<<<<<<<
 *         '''Runs the basic hug development server against this API'''
 *         if no_documentation:
 */
  __pyx_tuple__81 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_port, __pyx_n_s_no_documentation, __pyx_n_s_api, __pyx_n_s_httpd); if (unlikely(!__pyx_tuple__81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__81);
  __Pyx_GIVEREF(__pyx_tuple__81);
  __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_serve, 124, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_tuple__83 = PyTuple_Pack(2, ((PyObject *)__pyx_int_8000), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__83);
  __Pyx_GIVEREF(__pyx_tuple__83);

  /* "hug/decorators.py":137
 * 
 * 
 * def default_output_format(content_type='application/json', apply_globally=False):             # <<<<<<<<<<<<<<
 *     '''A decorator that allows you to override the default output format for an API'''
 *     def decorator(formatter):
 */
  __pyx_tuple__84 = PyTuple_Pack(4, __pyx_n_s_content_type, __pyx_n_s_apply_globally, __pyx_n_s_decorator, __pyx_n_s_decorator); if (unlikely(!__pyx_tuple__84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__84);
  __Pyx_GIVEREF(__pyx_tuple__84);
  __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_default_output_format, 137, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_tuple__86 = PyTuple_Pack(2, ((PyObject*)__pyx_kp_s_application_json), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__86);
  __Pyx_GIVEREF(__pyx_tuple__86);

  /* "hug/decorators.py":150
 * 
 * 
 * def default_input_format(content_type='application/json', apply_globally=False):             # <<<<<<<<<<<<<<
 *     '''A decorator that allows you to override the default output format for an API'''
 *     def decorator(formatter):
 */
  __pyx_tuple__87 = PyTuple_Pack(4, __pyx_n_s_content_type, __pyx_n_s_apply_globally, __pyx_n_s_decorator, __pyx_n_s_decorator); if (unlikely(!__pyx_tuple__87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__87);
  __Pyx_GIVEREF(__pyx_tuple__87);
  __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_default_input_format, 150, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_tuple__89 = PyTuple_Pack(2, ((PyObject*)__pyx_kp_s_application_json), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__89);
  __Pyx_GIVEREF(__pyx_tuple__89);

  /* "hug/decorators.py":163
 * 
 * 
 * def directive(apply_globally=True):             # <<<<<<<<<<<<<<
 *     '''A decorator that registers a single hug directive'''
 *     def decorator(directive_method):
 */
  __pyx_tuple__90 = PyTuple_Pack(3, __pyx_n_s_apply_globally, __pyx_n_s_decorator, __pyx_n_s_decorator); if (unlikely(!__pyx_tuple__90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __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, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_directive, 163, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_tuple__92 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);

  /* "hug/decorators.py":176
 * 
 * 
 * def request_middleware():             # <<<<<<<<<<<<<<
 *     '''Registers a middleware function that will be called on every request'''
 *     def decorator(middleware_method):
 */
  __pyx_tuple__93 = PyTuple_Pack(2, __pyx_n_s_decorator, __pyx_n_s_decorator); if (unlikely(!__pyx_tuple__93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__93);
  __Pyx_GIVEREF(__pyx_tuple__93);
  __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_request_middleware, 176, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":186
 * 
 * 
 * def response_middleware():             # <<<<<<<<<<<<<<
 *     '''Registers a middleware function that will be called on every response'''
 *     def decorator(middleware_method):
 */
  __pyx_tuple__95 = PyTuple_Pack(2, __pyx_n_s_decorator, __pyx_n_s_decorator); if (unlikely(!__pyx_tuple__95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__95);
  __Pyx_GIVEREF(__pyx_tuple__95);
  __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_response_middleware, 186, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":196
 * 
 * 
 * def extend_api(route=""):             # <<<<<<<<<<<<<<
 *     '''Extends the current api, with handlers from an imported api. Optionally provide a route that prefixes access'''
 *     def decorator(extend_with):
 */
  __pyx_tuple__97 = PyTuple_Pack(3, __pyx_n_s_route, __pyx_n_s_decorator, __pyx_n_s_decorator); if (unlikely(!__pyx_tuple__97)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__97);
  __Pyx_GIVEREF(__pyx_tuple__97);
  __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_extend_api, 196, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_tuple__99 = PyTuple_Pack(1, ((PyObject*)__pyx_kp_s_)); if (unlikely(!__pyx_tuple__99)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__99);
  __Pyx_GIVEREF(__pyx_tuple__99);

  /* "hug/decorators.py":206
 * 
 * 
 * def _api_module(module_name):             # <<<<<<<<<<<<<<
 *     module = sys.modules[module_name]
 *     if not '__hug__' in module.__dict__:
 */
  __pyx_tuple__100 = PyTuple_Pack(4, __pyx_n_s_module_name, __pyx_n_s_module, __pyx_n_s_api_auto_instantiate, __pyx_n_s_api_auto_instantiate); if (unlikely(!__pyx_tuple__100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__100);
  __Pyx_GIVEREF(__pyx_tuple__100);
  __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_api_module, 206, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":219
 * 
 * 
 * def _marshmallow_schema(marshmallow):             # <<<<<<<<<<<<<<
 *     '''Dynamically generates a hug style type handler from a Marshmallow style schema'''
 *     def marshmallow_type(input_data):
 */
  __pyx_tuple__102 = PyTuple_Pack(3, __pyx_n_s_marshmallow, __pyx_n_s_marshmallow_type, __pyx_n_s_marshmallow_type); if (unlikely(!__pyx_tuple__102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __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, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__102, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_marshmallow_schema, 219, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":232
 * 
 * 
 * def _create_interface(module, api_function, parameters=None, defaults={}, output=None, versions=None,             # <<<<<<<<<<<<<<
 *                       parse_body=True, set_status=False, transform=None, requires=()):
 *     '''Creates the request handling interface method for the given API function'''
 */
  __pyx_tuple__104 = PyTuple_Pack(32, __pyx_n_s_module, __pyx_n_s_api_function, __pyx_n_s_parameters, __pyx_n_s_defaults, __pyx_n_s_output, __pyx_n_s_versions, __pyx_n_s_parse_body, __pyx_n_s_set_status, __pyx_n_s_transform, __pyx_n_s_requires, __pyx_n_s_accepted_parameters, __pyx_n_s_index, __pyx_n_s_default, __pyx_n_s_required, __pyx_n_s_takes_kwargs, __pyx_n_s_function_output, __pyx_n_s_function_output_args, __pyx_n_s_default_kwargs, __pyx_n_s_directives, __pyx_n_s_use_directives, __pyx_n_s_output_type, __pyx_n_s_transform_args, __pyx_n_s_is_method, __pyx_n_s_input_transformations, __pyx_n_s_named_directives, __pyx_n_s_name, __pyx_n_s_transformer, __pyx_n_s_interface, __pyx_n_s_interface, __pyx_n_s_callable_method, __pyx_n_s_callable_method, __pyx_n_s_p); if (unlikely(!__pyx_tuple__104)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__104);
  __Pyx_GIVEREF(__pyx_tuple__104);
  __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(10, 0, 32, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__104, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_create_interface, 232, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":425
 * 
 * 
 * def not_found(output=None, versions=None, parse_body=False, transform=None, requires=()):             # <<<<<<<<<<<<<<
 *     '''A decorator to register a 404 handler'''
 *     versions = (versions, ) if isinstance(versions, (int, float, None.__class__)) else versions
 */
  __pyx_tuple__106 = PyTuple_Pack(7, __pyx_n_s_output, __pyx_n_s_versions, __pyx_n_s_parse_body, __pyx_n_s_transform, __pyx_n_s_requires, __pyx_n_s_decorator, __pyx_n_s_decorator); if (unlikely(!__pyx_tuple__106)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__106);
  __Pyx_GIVEREF(__pyx_tuple__106);
  __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(5, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__106, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_not_found, 425, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_tuple__108 = PyTuple_Pack(5, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_False), ((PyObject *)Py_None), ((PyObject*)__pyx_empty_tuple)); if (unlikely(!__pyx_tuple__108)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__108);
  __Pyx_GIVEREF(__pyx_tuple__108);

  /* "hug/decorators.py":444
 * 
 * 
 * def call(urls=None, accept=HTTP_METHODS, parameters=None, defaults={}, output=None, examples=(), versions=None,             # <<<<<<<<<<<<<<
 *          parse_body=True, transform=None, requires=()):
 *     '''Defines the base Hug API creating decorator, which exposes normal python methods as HTTP APIs'''
 */
  __pyx_tuple__109 = PyTuple_Pack(12, __pyx_n_s_urls, __pyx_n_s_accept, __pyx_n_s_parameters, __pyx_n_s_defaults, __pyx_n_s_output, __pyx_n_s_examples, __pyx_n_s_versions, __pyx_n_s_parse_body, __pyx_n_s_transform, __pyx_n_s_requires, __pyx_n_s_decorator, __pyx_n_s_decorator); if (unlikely(!__pyx_tuple__109)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__109);
  __Pyx_GIVEREF(__pyx_tuple__109);
  __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(10, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__109, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_call, 444, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":475
 * 
 * 
 * def cli(name=None, version=None, doc=None, transform=None, output=None):             # <<<<<<<<<<<<<<
 *     '''Enables exposing a Hug compatible function as a Command Line Interface'''
 *     def decorator(api_function):
 */
  __pyx_tuple__111 = PyTuple_Pack(7, __pyx_n_s_name, __pyx_n_s_version, __pyx_n_s_doc_2, __pyx_n_s_transform, __pyx_n_s_output, __pyx_n_s_decorator, __pyx_n_s_decorator); if (unlikely(!__pyx_tuple__111)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__111);
  __Pyx_GIVEREF(__pyx_tuple__111);
  __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(5, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tcrosley_Projects_hug_hug, __pyx_n_s_cli, 475, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_tuple__113 = PyTuple_Pack(5, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__113)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__113);
  __Pyx_GIVEREF(__pyx_tuple__113);
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  __pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
  __pyx_umethod_PySet_Type_update.type = (PyObject*)&PySet_Type;
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__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_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_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_8000 = PyInt_FromLong(8000); if (unlikely(!__pyx_int_8000)) {__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 initdecorators(void); /*proto*/
PyMODINIT_FUNC initdecorators(void)
#else
PyMODINIT_FUNC PyInit_decorators(void); /*proto*/
PyMODINIT_FUNC PyInit_decorators(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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  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_decorators(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_Coroutine_USED
  if (__pyx_Coroutine_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
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_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("decorators", __pyx_methods, __pyx_k_hug_decorators_py_Defines_the_me, 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_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 (PyObject_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 (__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_hug__decorators) {
    if (PyObject_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, "hug.decorators")) {
      if (unlikely(PyDict_SetItemString(modules, "hug.decorators", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (__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_3hug_10decorators___pyx_scope_struct__default_output_format) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_3hug_10decorators___pyx_scope_struct__default_output_format.tp_print = 0;
  __pyx_ptype_3hug_10decorators___pyx_scope_struct__default_output_format = &__pyx_type_3hug_10decorators___pyx_scope_struct__default_output_format;
  if (PyType_Ready(&__pyx_type_3hug_10decorators___pyx_scope_struct_1_default_input_format) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_3hug_10decorators___pyx_scope_struct_1_default_input_format.tp_print = 0;
  __pyx_ptype_3hug_10decorators___pyx_scope_struct_1_default_input_format = &__pyx_type_3hug_10decorators___pyx_scope_struct_1_default_input_format;
  if (PyType_Ready(&__pyx_type_3hug_10decorators___pyx_scope_struct_2_directive) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_3hug_10decorators___pyx_scope_struct_2_directive.tp_print = 0;
  __pyx_ptype_3hug_10decorators___pyx_scope_struct_2_directive = &__pyx_type_3hug_10decorators___pyx_scope_struct_2_directive;
  if (PyType_Ready(&__pyx_type_3hug_10decorators___pyx_scope_struct_3_extend_api) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_3hug_10decorators___pyx_scope_struct_3_extend_api.tp_print = 0;
  __pyx_ptype_3hug_10decorators___pyx_scope_struct_3_extend_api = &__pyx_type_3hug_10decorators___pyx_scope_struct_3_extend_api;
  if (PyType_Ready(&__pyx_type_3hug_10decorators___pyx_scope_struct_4__api_module) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_3hug_10decorators___pyx_scope_struct_4__api_module.tp_print = 0;
  __pyx_ptype_3hug_10decorators___pyx_scope_struct_4__api_module = &__pyx_type_3hug_10decorators___pyx_scope_struct_4__api_module;
  if (PyType_Ready(&__pyx_type_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema.tp_print = 0;
  __pyx_ptype_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema = &__pyx_type_3hug_10decorators___pyx_scope_struct_5__marshmallow_schema;
  if (PyType_Ready(&__pyx_type_3hug_10decorators___pyx_scope_struct_6__create_interface) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_3hug_10decorators___pyx_scope_struct_6__create_interface.tp_print = 0;
  __pyx_ptype_3hug_10decorators___pyx_scope_struct_6__create_interface = &__pyx_type_3hug_10decorators___pyx_scope_struct_6__create_interface;
  if (PyType_Ready(&__pyx_type_3hug_10decorators___pyx_scope_struct_7_not_found) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_3hug_10decorators___pyx_scope_struct_7_not_found.tp_print = 0;
  __pyx_ptype_3hug_10decorators___pyx_scope_struct_7_not_found = &__pyx_type_3hug_10decorators___pyx_scope_struct_7_not_found;
  if (PyType_Ready(&__pyx_type_3hug_10decorators___pyx_scope_struct_8_call) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_3hug_10decorators___pyx_scope_struct_8_call.tp_print = 0;
  __pyx_ptype_3hug_10decorators___pyx_scope_struct_8_call = &__pyx_type_3hug_10decorators___pyx_scope_struct_8_call;
  if (PyType_Ready(&__pyx_type_3hug_10decorators___pyx_scope_struct_9_cli) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_3hug_10decorators___pyx_scope_struct_9_cli.tp_print = 0;
  __pyx_ptype_3hug_10decorators___pyx_scope_struct_9_cli = &__pyx_type_3hug_10decorators___pyx_scope_struct_9_cli;
  if (PyType_Ready(&__pyx_type_3hug_10decorators___pyx_scope_struct_10_decorator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_3hug_10decorators___pyx_scope_struct_10_decorator.tp_print = 0;
  __pyx_ptype_3hug_10decorators___pyx_scope_struct_10_decorator = &__pyx_type_3hug_10decorators___pyx_scope_struct_10_decorator;
  /*--- Type import code ---*/
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif

  /* "hug/decorators.py":27
 * 
 * """
 * import argparse             # <<<<<<<<<<<<<<
 * import os
 * import sys
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_argparse, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_argparse, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "hug/decorators.py":28
 * """
 * import argparse
 * import os             # <<<<<<<<<<<<<<
 * import sys
 * from collections import OrderedDict, namedtuple
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __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 = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "hug/decorators.py":29
 * import argparse
 * import os
 * import sys             # <<<<<<<<<<<<<<
 * from collections import OrderedDict, namedtuple
 * from functools import partial, wraps
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __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 = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "hug/decorators.py":30
 * import os
 * import sys
 * from collections import OrderedDict, namedtuple             # <<<<<<<<<<<<<<
 * from functools import partial, wraps
 * from itertools import chain
 */
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_OrderedDict);
  __Pyx_GIVEREF(__pyx_n_s_OrderedDict);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_OrderedDict);
  __Pyx_INCREF(__pyx_n_s_namedtuple);
  __Pyx_GIVEREF(__pyx_n_s_namedtuple);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_namedtuple);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __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_OrderedDict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_OrderedDict, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_namedtuple); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_namedtuple, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __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;

  /* "hug/decorators.py":31
 * import sys
 * from collections import OrderedDict, namedtuple
 * from functools import partial, wraps             # <<<<<<<<<<<<<<
 * from itertools import chain
 * from wsgiref.simple_server import make_server
 */
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_partial);
  __Pyx_GIVEREF(__pyx_n_s_partial);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_partial);
  __Pyx_INCREF(__pyx_n_s_wraps);
  __Pyx_GIVEREF(__pyx_n_s_wraps);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_wraps);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_functools, __pyx_t_2, -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);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_partial); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_partial, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_wraps); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_wraps, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __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;

  /* "hug/decorators.py":32
 * from collections import OrderedDict, namedtuple
 * from functools import partial, wraps
 * from itertools import chain             # <<<<<<<<<<<<<<
 * from wsgiref.simple_server import make_server
 * 
 */
  __pyx_t_1 = PyList_New(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);
  __Pyx_INCREF(__pyx_n_s_chain);
  __Pyx_GIVEREF(__pyx_n_s_chain);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_chain);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_itertools, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __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_chain); 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_chain, __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;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "hug/decorators.py":33
 * from functools import partial, wraps
 * from itertools import chain
 * from wsgiref.simple_server import make_server             # <<<<<<<<<<<<<<
 * 
 * import falcon
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_make_server);
  __Pyx_GIVEREF(__pyx_n_s_make_server);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_make_server);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_wsgiref_simple_server, __pyx_t_2, -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);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_make_server); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_server, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __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;

  /* "hug/decorators.py":35
 * from wsgiref.simple_server import make_server
 * 
 * import falcon             # <<<<<<<<<<<<<<
 * import hug.defaults
 * import hug.output_format
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_falcon, 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_falcon, __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;

  /* "hug/decorators.py":36
 * 
 * import falcon
 * import hug.defaults             # <<<<<<<<<<<<<<
 * import hug.output_format
 * from falcon import HTTP_BAD_REQUEST, HTTP_METHODS
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_hug_defaults, 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_hug, __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;

  /* "hug/decorators.py":37
 * import falcon
 * import hug.defaults
 * import hug.output_format             # <<<<<<<<<<<<<<
 * from falcon import HTTP_BAD_REQUEST, HTTP_METHODS
 * from hug.exceptions import InvalidTypeData
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_hug_output_format, 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_hug, __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;

  /* "hug/decorators.py":38
 * import hug.defaults
 * import hug.output_format
 * from falcon import HTTP_BAD_REQUEST, HTTP_METHODS             # <<<<<<<<<<<<<<
 * from hug.exceptions import InvalidTypeData
 * from hug.format import underscore
 */
  __pyx_t_1 = PyList_New(2); 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);
  __Pyx_INCREF(__pyx_n_s_HTTP_BAD_REQUEST);
  __Pyx_GIVEREF(__pyx_n_s_HTTP_BAD_REQUEST);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_HTTP_BAD_REQUEST);
  __Pyx_INCREF(__pyx_n_s_HTTP_METHODS);
  __Pyx_GIVEREF(__pyx_n_s_HTTP_METHODS);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_HTTP_METHODS);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_falcon, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __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_HTTP_BAD_REQUEST); 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_HTTP_BAD_REQUEST, __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;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_HTTP_METHODS); 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_HTTP_METHODS, __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;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "hug/decorators.py":39
 * import hug.output_format
 * from falcon import HTTP_BAD_REQUEST, HTTP_METHODS
 * from hug.exceptions import InvalidTypeData             # <<<<<<<<<<<<<<
 * from hug.format import underscore
 * from hug.run import INTRO, server
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_InvalidTypeData);
  __Pyx_GIVEREF(__pyx_n_s_InvalidTypeData);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_InvalidTypeData);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_hug_exceptions, __pyx_t_2, -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);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_InvalidTypeData); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_InvalidTypeData, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __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;

  /* "hug/decorators.py":40
 * from falcon import HTTP_BAD_REQUEST, HTTP_METHODS
 * from hug.exceptions import InvalidTypeData
 * from hug.format import underscore             # <<<<<<<<<<<<<<
 * from hug.run import INTRO, server
 * 
 */
  __pyx_t_1 = PyList_New(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);
  __Pyx_INCREF(__pyx_n_s_underscore);
  __Pyx_GIVEREF(__pyx_n_s_underscore);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_underscore);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_hug_format, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __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_underscore); 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_underscore, __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;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "hug/decorators.py":41
 * from hug.exceptions import InvalidTypeData
 * from hug.format import underscore
 * from hug.run import INTRO, server             # <<<<<<<<<<<<<<
 * 
 * AUTO_INCLUDE = {'request', 'response'}
 */
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_INTRO);
  __Pyx_GIVEREF(__pyx_n_s_INTRO);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_INTRO);
  __Pyx_INCREF(__pyx_n_s_server);
  __Pyx_GIVEREF(__pyx_n_s_server);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_server);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_hug_run, __pyx_t_2, -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);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_INTRO); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_INTRO, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_server); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_server, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __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;

  /* "hug/decorators.py":43
 * from hug.run import INTRO, server
 * 
 * AUTO_INCLUDE = {'request', 'response'}             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PySet_Add(__pyx_t_1, __pyx_n_s_request) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PySet_Add(__pyx_t_1, __pyx_n_s_response) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_AUTO_INCLUDE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "hug/decorators.py":46
 * 
 * 
 * class HugAPI(object):             # <<<<<<<<<<<<<<
 *     '''Stores the information necessary to expose API calls within this module externally'''
 *     __slots__ = ('module', 'versions', 'routes', '_output_format', '_input_format', '_directives', 'versioned',
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_object);
  __Pyx_GIVEREF(__pyx_builtin_object);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_object);
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __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_HugAPI, __pyx_n_s_HugAPI, (PyObject *) NULL, __pyx_n_s_hug_decorators, __pyx_kp_s_Stores_the_information_necessary); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);

  /* "hug/decorators.py":48
 * class HugAPI(object):
 *     '''Stores the information necessary to expose API calls within this module externally'''
 *     __slots__ = ('module', 'versions', 'routes', '_output_format', '_input_format', '_directives', 'versioned',             # <<<<<<<<<<<<<<
 *                  '_middleware', '_not_found_handlers')
 * 
 */
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_slots, __pyx_tuple__51) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "hug/decorators.py":51
 *                  '_middleware', '_not_found_handlers')
 * 
 *     def __init__(self, module):             # <<<<<<<<<<<<<<
 *         self.module = module
 *         self.versions = set()
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_6HugAPI_1__init__, 0, __pyx_n_s_HugAPI___init, NULL, __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __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 = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "hug/decorators.py":58
 * 
 *     @property
 *     def output_format(self):             # <<<<<<<<<<<<<<
 *         return getattr(self, '_output_format', hug.defaults.output_format)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_6HugAPI_3output_format, 0, __pyx_n_s_HugAPI_output_format, NULL, __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);

  /* "hug/decorators.py":57
 *         self.versioned = OrderedDict()
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def output_format(self):
 *         return getattr(self, '_output_format', hug.defaults.output_format)
 */
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_output_format_2, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "hug/decorators.py":61
 *         return getattr(self, '_output_format', hug.defaults.output_format)
 * 
 *     @output_format.setter             # <<<<<<<<<<<<<<
 *     def output_format(self, formatter):
 *         self._output_format = formatter
 */
  __pyx_t_5 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_output_format_2);
  if (unlikely(!__pyx_t_5)) {
    PyErr_Clear();
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_output_format_2);
  }
  if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_setter); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "hug/decorators.py":62
 * 
 *     @output_format.setter
 *     def output_format(self, formatter):             # <<<<<<<<<<<<<<
 *         self._output_format = formatter
 * 
 */
  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_6HugAPI_5output_format, 0, __pyx_n_s_HugAPI_output_format, NULL, __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_7) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_output_format_2, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "hug/decorators.py":65
 *         self._output_format = formatter
 * 
 *     def input_format(self, content_type):             # <<<<<<<<<<<<<<
 *         '''Returns the set input_format handler for the given content_type'''
 *         return getattr(self, '_input_format', {}).get(content_type, hug.defaults.input_format.get(content_type, None))
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_6HugAPI_7input_format, 0, __pyx_n_s_HugAPI_input_format, NULL, __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_input_format_2, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "hug/decorators.py":69
 *         return getattr(self, '_input_format', {}).get(content_type, hug.defaults.input_format.get(content_type, None))
 * 
 *     def set_input_format(self, content_type, handler):             # <<<<<<<<<<<<<<
 *         '''Sets an input format handler for this Hug API, given the specified content_type'''
 *         if getattr(self, '_input_format', None) is None:
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_6HugAPI_9set_input_format, 0, __pyx_n_s_HugAPI_set_input_format, NULL, __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_set_input_format, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "hug/decorators.py":75
 *         self._input_format[content_type] = handler
 * 
 *     def directives(self):             # <<<<<<<<<<<<<<
 *         '''Returns all directives applicable to this Hug API'''
 *         directive_sources = chain(hug.defaults.directives.items(), getattr(self, '_directives', {}).items())
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_6HugAPI_11directives, 0, __pyx_n_s_HugAPI_directives, NULL, __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_directives, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "hug/decorators.py":80
 *         return {'hug_' + directive_name: directive for directive_name, directive in directive_sources}
 * 
 *     def directive(self, name, default=None):             # <<<<<<<<<<<<<<
 *         '''Returns the loaded directive with the specified name, or default if passed name is not present'''
 *         return getattr(self, '_directives', {}).get(name,  hug.defaults.directives.get(name, default))
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_6HugAPI_13directive, 0, __pyx_n_s_HugAPI_directive, NULL, __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__66);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_directive, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "hug/decorators.py":84
 *         return getattr(self, '_directives', {}).get(name,  hug.defaults.directives.get(name, default))
 * 
 *     def add_directive(self, directive):             # <<<<<<<<<<<<<<
 *         self._directives = getattr(self, '_directives', {})
 *         self._directives[directive.__name__] = directive
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_6HugAPI_15add_directive, 0, __pyx_n_s_HugAPI_add_directive, NULL, __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_add_directive, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "hug/decorators.py":89
 * 
 *     @property
 *     def middleware(self):             # <<<<<<<<<<<<<<
 *         return getattr(self, '_middleware', None)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_6HugAPI_17middleware, 0, __pyx_n_s_HugAPI_middleware, NULL, __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);

  /* "hug/decorators.py":88
 *         self._directives[directive.__name__] = directive
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def middleware(self):
 *         return getattr(self, '_middleware', None)
 */
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_middleware_2, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "hug/decorators.py":92
 *         return getattr(self, '_middleware', None)
 * 
 *     def add_middleware(self, middleware):             # <<<<<<<<<<<<<<
 *         '''Adds a middleware object used to process all incoming requests against the API'''
 *         if self.middleware is None:
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_6HugAPI_19add_middleware, 0, __pyx_n_s_HugAPI_add_middleware, NULL, __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_add_middleware, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "hug/decorators.py":98
 *         self.middleware.append(middleware)
 * 
 *     def extend(self, module, route=""):             # <<<<<<<<<<<<<<
 *         '''Adds handlers from a different Hug API module to this one - to create a single API'''
 *         for item_route, handler in module.__hug__.routes.items():
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_6HugAPI_21extend, 0, __pyx_n_s_HugAPI_extend, NULL, __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__75);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_extend, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "hug/decorators.py":114
 * 
 *     @property
 *     def not_found_handlers(self):             # <<<<<<<<<<<<<<
 *         return getattr(self, '_not_found_handlers', {})
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_6HugAPI_23not_found_handlers, 0, __pyx_n_s_HugAPI_not_found_handlers, NULL, __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);

  /* "hug/decorators.py":113
 *                 self.set_input_format(input_format, input_format_handler)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def not_found_handlers(self):
 *         return getattr(self, '_not_found_handlers', {})
 */
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_not_found_handlers_2, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "hug/decorators.py":117
 *         return getattr(self, '_not_found_handlers', {})
 * 
 *     def set_not_found_handler(self, handler, version=None):             # <<<<<<<<<<<<<<
 *         '''Sets the not_found handler for the specified version of the api'''
 *         if not self.not_found_handlers:
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_6HugAPI_25set_not_found_handler, 0, __pyx_n_s_HugAPI_set_not_found_handler, NULL, __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__80);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_set_not_found_handler, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "hug/decorators.py":124
 *         self.not_found_handlers[version] = handler
 * 
 *     def serve(self, port=8000, no_documentation=False):             # <<<<<<<<<<<<<<
 *         '''Runs the basic hug development server against this API'''
 *         if no_documentation:
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_6HugAPI_27serve, 0, __pyx_n_s_HugAPI_serve, NULL, __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__83);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_serve, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "hug/decorators.py":46
 * 
 * 
 * class HugAPI(object):             # <<<<<<<<<<<<<<
 *     '''Stores the information necessary to expose API calls within this module externally'''
 *     __slots__ = ('module', 'versions', 'routes', '_output_format', '_input_format', '_directives', 'versioned',
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_HugAPI, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_HugAPI, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __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;

  /* "hug/decorators.py":137
 * 
 * 
 * def default_output_format(content_type='application/json', apply_globally=False):             # <<<<<<<<<<<<<<
 *     '''A decorator that allows you to override the default output format for an API'''
 *     def decorator(formatter):
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_1default_output_format, 0, __pyx_n_s_default_output_format, NULL, __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__86);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_output_format, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "hug/decorators.py":150
 * 
 * 
 * def default_input_format(content_type='application/json', apply_globally=False):             # <<<<<<<<<<<<<<
 *     '''A decorator that allows you to override the default output format for an API'''
 *     def decorator(formatter):
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_3default_input_format, 0, __pyx_n_s_default_input_format, NULL, __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__89);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_input_format, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "hug/decorators.py":163
 * 
 * 
 * def directive(apply_globally=True):             # <<<<<<<<<<<<<<
 *     '''A decorator that registers a single hug directive'''
 *     def decorator(directive_method):
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_5directive, 0, __pyx_n_s_directive, NULL, __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__92);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_directive, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "hug/decorators.py":176
 * 
 * 
 * def request_middleware():             # <<<<<<<<<<<<<<
 *     '''Registers a middleware function that will be called on every request'''
 *     def decorator(middleware_method):
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_7request_middleware, 0, __pyx_n_s_request_middleware, NULL, __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__94)); 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);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_request_middleware, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "hug/decorators.py":186
 * 
 * 
 * def response_middleware():             # <<<<<<<<<<<<<<
 *     '''Registers a middleware function that will be called on every response'''
 *     def decorator(middleware_method):
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_9response_middleware, 0, __pyx_n_s_response_middleware, NULL, __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__96)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_response_middleware, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "hug/decorators.py":196
 * 
 * 
 * def extend_api(route=""):             # <<<<<<<<<<<<<<
 *     '''Extends the current api, with handlers from an imported api. Optionally provide a route that prefixes access'''
 *     def decorator(extend_with):
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_11extend_api, 0, __pyx_n_s_extend_api, NULL, __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__98)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__99);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_extend_api, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "hug/decorators.py":206
 * 
 * 
 * def _api_module(module_name):             # <<<<<<<<<<<<<<
 *     module = sys.modules[module_name]
 *     if not '__hug__' in module.__dict__:
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_13_api_module, 0, __pyx_n_s_api_module, NULL, __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_api_module, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "hug/decorators.py":219
 * 
 * 
 * def _marshmallow_schema(marshmallow):             # <<<<<<<<<<<<<<
 *     '''Dynamically generates a hug style type handler from a Marshmallow style schema'''
 *     def marshmallow_type(input_data):
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_15_marshmallow_schema, 0, __pyx_n_s_marshmallow_schema, NULL, __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__103)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_marshmallow_schema, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "hug/decorators.py":232
 * 
 * 
 * def _create_interface(module, api_function, parameters=None, defaults={}, output=None, versions=None,             # <<<<<<<<<<<<<<
 *                       parse_body=True, set_status=False, transform=None, requires=()):
 *     '''Creates the request handling interface method for the given API function'''
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_17_create_interface, 0, __pyx_n_s_create_interface, NULL, __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__105)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults), 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_1)->__pyx_arg_defaults = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_3hug_10decorators_24__defaults__);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_create_interface, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "hug/decorators.py":425
 * 
 * 
 * def not_found(output=None, versions=None, parse_body=False, transform=None, requires=()):             # <<<<<<<<<<<<<<
 *     '''A decorator to register a 404 handler'''
 *     versions = (versions, ) if isinstance(versions, (int, float, None.__class__)) else versions
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_19not_found, 0, __pyx_n_s_not_found, NULL, __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__107)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__108);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_not_found, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "hug/decorators.py":444
 * 
 * 
 * def call(urls=None, accept=HTTP_METHODS, parameters=None, defaults={}, output=None, examples=(), versions=None,             # <<<<<<<<<<<<<<
 *          parse_body=True, transform=None, requires=()):
 *     '''Defines the base Hug API creating decorator, which exposes normal python methods as HTTP APIs'''
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_21call, 0, __pyx_n_s_call, NULL, __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__110)); 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);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults1), 2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_HTTP_METHODS); 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_CyFunction_Defaults(__pyx_defaults1, __pyx_t_1)->__pyx_arg_accept = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); 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_CyFunction_Defaults(__pyx_defaults1, __pyx_t_1)->__pyx_arg_defaults = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_3hug_10decorators_26__defaults__);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_call, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "hug/decorators.py":475
 * 
 * 
 * def cli(name=None, version=None, doc=None, transform=None, output=None):             # <<<<<<<<<<<<<<
 *     '''Enables exposing a Hug compatible function as a Command Line Interface'''
 *     def decorator(api_function):
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3hug_10decorators_23cli, 0, __pyx_n_s_cli, NULL, __pyx_n_s_hug_decorators, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__113);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cli, __pyx_t_1) < 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;

  /* "hug/decorators.py":606
 * 
 * 
 * for method in HTTP_METHODS:             # <<<<<<<<<<<<<<
 *     method_handler = partial(call, accept=(method, ))
 *     method_handler.__doc__ = "Exposes a Python method externally as an HTTP {0} method".format(method.upper())
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_HTTP_METHODS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_9 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_10 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_10)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_10(__pyx_t_2);
      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 = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_method, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "hug/decorators.py":607
 * 
 * for method in HTTP_METHODS:
 *     method_handler = partial(call, accept=(method, ))             # <<<<<<<<<<<<<<
 *     method_handler.__doc__ = "Exposes a Python method externally as an HTTP {0} method".format(method.upper())
 *     globals()[method.lower()] = method_handler
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_partial); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_call); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __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 = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_method); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_accept, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __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_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_method_handler, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "hug/decorators.py":608
 * for method in HTTP_METHODS:
 *     method_handler = partial(call, accept=(method, ))
 *     method_handler.__doc__ = "Exposes a Python method externally as an HTTP {0} method".format(method.upper())             # <<<<<<<<<<<<<<
 *     globals()[method.lower()] = method_handler
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Exposes_a_Python_method_external, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_method); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_upper); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (__pyx_t_1) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_8);
    } else {
      __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __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_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_method_handler); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_3, __pyx_n_s_doc, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "hug/decorators.py":609
 *     method_handler = partial(call, accept=(method, ))
 *     method_handler.__doc__ = "Exposes a Python method externally as an HTTP {0} method".format(method.upper())
 *     globals()[method.lower()] = method_handler             # <<<<<<<<<<<<<<
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_method_handler); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_Globals(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_method); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_lower); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(PyObject_SetItem(__pyx_t_8, __pyx_t_1, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "hug/decorators.py":606
 * 
 * 
 * for method in HTTP_METHODS:             # <<<<<<<<<<<<<<
 *     method_handler = partial(call, accept=(method, ))
 *     method_handler.__doc__ = "Exposes a Python method externally as an HTTP {0} method".format(method.upper())
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "hug/decorators.py":1
 * """hug/decorators.py             # <<<<<<<<<<<<<<
 * 
 * Defines the method decorators at the core of Hug's approach to creating HTTP APIs
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init hug.decorators", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init hug.decorators");
  }
  __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

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 PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
    PyObject *result;
#if CYTHON_COMPILING_IN_CPYTHON
    result = PyDict_GetItem(__pyx_d, name);
    if (likely(result)) {
        Py_INCREF(result);
    } else {
#else
    result = PyObject_GetItem(__pyx_d, name);
    if (!result) {
        PyErr_Clear();
#endif
        result = __Pyx_GetBuiltinName(name);
    }
    return result;
}

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

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

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_COMPILING_IN_CPYTHON
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r = __Pyx_GetAttr(o, n);
    if (unlikely(!r)) {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError))
            goto bad;
        PyErr_Clear();
        r = d;
        Py_INCREF(d);
    }
    return r;
bad:
    return NULL;
}

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 PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto bad;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *args;
            PyObject *function = PyMethod_GET_FUNCTION(method);
            args = PyTuple_New(2);
            if (unlikely(!args)) goto bad;
            Py_INCREF(self);
            PyTuple_SET_ITEM(args, 0, self);
            Py_INCREF(arg);
            PyTuple_SET_ITEM(args, 1, arg);
            Py_INCREF(function);
            Py_DECREF(method); method = NULL;
            result = __Pyx_PyObject_Call(function, args, NULL);
            Py_DECREF(args);
            Py_DECREF(function);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallOneArg(method, arg);
bad:
    Py_XDECREF(method);
    return result;
}

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 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;
    }
    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) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_COMPILING_IN_CPYTHON
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
    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}
};
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[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_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;
    __Pyx_CyFunction_weakreflist(op) = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults = 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 (__Pyx_CyFunction_weakreflist(m) != 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 __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
    return __Pyx_PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
#if CYTHON_COMPILING_IN_PYPY
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    PyObject *self = f->m_self;
    Py_ssize_t size;
    switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 0))
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 1)) {
                PyObject *result, *arg0 = PySequence_ITEM(arg, 0);
                if (unlikely(!arg0)) return NULL;
                result = (*meth)(self, arg0);
                Py_DECREF(arg0);
                return result;
            }
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
#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)
    "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
    0,
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_Call,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_CyFunction_descr_get,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
};
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 CYTHON_INLINE int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

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 (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
#if 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) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    target->method = method;
#if CYTHON_COMPILING_IN_CPYTHON
    #if PY_MAJOR_VERSION >= 3
    if (likely(PyObject_TypeCheck(method, &PyMethodDescr_Type)))
    #endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_O | METH_NOARGS);
    }
#endif
    return 0;
}

static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    args = PyTuple_New(1);
    if (unlikely(!args)) goto bad;
    Py_INCREF(self);
    PyTuple_SET_ITEM(args, 0, self);
#else
    args = PyTuple_Pack(1, self);
    if (unlikely(!args)) goto bad;
#endif
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    Py_DECREF(args);
bad:
    return result;
}

static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
    if (PY_MAJOR_VERSION >= 3)
        return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_items, d);
    else
        return PyDict_Items(d);
}

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 PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_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,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED 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,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED 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));
}

#if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (PyErr_ExceptionMatches(PyExc_OverflowError))
                    PyErr_Clear();
                else
                    goto bad;
            }
        }
        return ms->sq_slice(obj, cstart, cstop);
    }
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#endif
    {
        PyObject* result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyInt_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_COMPILING_IN_CPYTHON
        result = mp->mp_subscript(obj, py_slice);
#else
        result = PyObject_GetItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    PyErr_Format(PyExc_TypeError,
        "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
bad:
    return NULL;
}

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_AndObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
            return PyInt_FromLong(a & b);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                default: return PyLong_Type.tp_as_number->nb_and(op1, op2);
            }
        }
                x = a & b;
            return PyLong_FromLong(x);
        long_long:
                llx = lla & llb;
            return PyLong_FromLongLong(llx);
    }
    #endif
    return (inplace ? PyNumber_InPlaceAnd : PyNumber_And)(op1, op2);
}
#endif

static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 0, arg);
        if (cfunc->flag & METH_KEYWORDS)
            result = (*(PyCFunctionWithKeywords)cfunc->func)(self, args, NULL);
        else
            result = (*cfunc->func)(self, args);
    } else {
        args = PyTuple_New(2);
        if (unlikely(!args)) goto bad;
        Py_INCREF(self);
        PyTuple_SET_ITEM(args, 0, self);
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 1, arg);
        result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    }
#else
    args = PyTuple_Pack(2, self, arg);
    if (unlikely(!args)) goto bad;
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
#endif
bad:
    Py_XDECREF(args);
    return result;
}

static CYTHON_INLINE int __Pyx_PySet_Update(PyObject* set, PyObject* it) {
    PyObject *retval;
    #if CYTHON_COMPILING_IN_CPYTHON
    if (PyAnySet_Check(it)) {
        if (PySet_GET_SIZE(it) == 0)
            return 0;
        retval = PySet_Type.tp_as_number->nb_inplace_or(set, it);
        if (likely(retval == set)) {
            Py_DECREF(retval);
            return 0;
        }
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    #endif
    retval = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, set, it);
    if (unlikely(!retval)) return -1;
    Py_DECREF(retval);
    return 0;
}

static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
    PyObject* value;
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (unlikely(PyErr_Occurred()))
            return NULL;
        value = default_value;
    }
    Py_INCREF(value);
#else
    if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) {
        value = PyDict_GetItem(d, key);
        if (unlikely(!value)) {
            value = default_value;
        }
        Py_INCREF(value);
    } else {
        if (default_value == Py_None)
            default_value = NULL;
        value = PyObject_CallMethodObjArgs(
            d, __pyx_n_s_get, key, default_value, NULL);
    }
#endif
    return value;
}

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 (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_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
}

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_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;
        }
        #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
        }
    }
bad:
    #if PY_VERSION_HEX < 0x03030000
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

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 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_2, 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 PyObject* __Pyx_Globals(void) {
    Py_ssize_t i;
    PyObject *names;
    PyObject *globals = __pyx_d;
    Py_INCREF(globals);
    names = PyObject_Dir(__pyx_m);
    if (!names)
        goto bad;
    for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject* name = PySequence_ITEM(names, i);
        if (!name)
            goto bad;
#else
        PyObject* name = PyList_GET_ITEM(names, i);
#endif
        if (!PyDict_Contains(globals, name)) {
            PyObject* value = __Pyx_GetAttr(__pyx_m, name);
            if (!value) {
#if CYTHON_COMPILING_IN_PYPY
                Py_DECREF(name);
#endif
                goto bad;
            }
            if (PyDict_SetItem(globals, name, value) < 0) {
#if CYTHON_COMPILING_IN_PYPY
                Py_DECREF(name);
#endif
                Py_DECREF(value);
                goto bad;
            }
        }
#if CYTHON_COMPILING_IN_PYPY
        Py_DECREF(name);
#endif
    }
    Py_DECREF(names);
    return globals;
bad:
    Py_XDECREF(names);
    Py_XDECREF(globals);
    return NULL;
}

static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        __pyx_d,      /*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);
}

#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) {
                switch (s[len-1]) {
                    case ' ': break;
                    case '\f': case '\r': case '\n': case '\t': case '\v':
                        PyFile_SoftSpace(f, 0);
                        break;
                    default:  break;
                }
            }
        }
    }
    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
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
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

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_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_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0])
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#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;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0])
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#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;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE 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 CYTHON_COMPILING_IN_CPYTHON && (__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
        *length = PyBytes_GET_SIZE(defenc);
        return defenc_c;
#else
        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        if (PyUnicode_IS_ASCII(o)) {
            *length = PyUnicode_GET_LENGTH(o);
            return PyUnicode_AsUTF8(o);
        } else {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
#else
        return PyUnicode_AsUTF8AndSize(o, length);
#endif
#endif
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE 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 __Pyx_NewRef(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;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(x);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
