jpayne@69: /* Generated by Cython 3.0.11 */ jpayne@69: jpayne@69: /* BEGIN: Cython Metadata jpayne@69: { jpayne@69: "distutils": { jpayne@69: "define_macros": [ jpayne@69: [ jpayne@69: "BUILDING_WHEEL", jpayne@69: null jpayne@69: ] jpayne@69: ], jpayne@69: "depends": [ jpayne@69: "/project/bcftools/bcftools.pysam.h", jpayne@69: "/project/samtools/samtools.pysam.h" jpayne@69: ], jpayne@69: "extra_compile_args": [ jpayne@69: "-Wno-unused", jpayne@69: "-Wno-strict-prototypes", jpayne@69: "-Wno-sign-compare", jpayne@69: "-Wno-error=declaration-after-statement" jpayne@69: ], jpayne@69: "extra_link_args": [ jpayne@69: "-Wl,-rpath,$ORIGIN" jpayne@69: ], jpayne@69: "include_dirs": [ jpayne@69: "/project/pysam", jpayne@69: "/project/htslib", jpayne@69: "/project/samtools", jpayne@69: "/project/samtools/lz4", jpayne@69: "/project/bcftools", jpayne@69: "/project" jpayne@69: ], jpayne@69: "language": "c", jpayne@69: "libraries": [ jpayne@69: "z", jpayne@69: "lzma", jpayne@69: "bz2", jpayne@69: "z", jpayne@69: "m", jpayne@69: "curl", jpayne@69: "crypto", jpayne@69: "chtslib.cpython-37m-x86_64-linux-gnu", jpayne@69: "csamtools.cpython-37m-x86_64-linux-gnu", jpayne@69: "cbcftools.cpython-37m-x86_64-linux-gnu" jpayne@69: ], jpayne@69: "library_dirs": [ jpayne@69: "/project/pysam", jpayne@69: "/project", jpayne@69: "build/lib.linux-x86_64-cpython-37/pysam", jpayne@69: "build/lib.linux-x86_64-cpython-37/pysam", jpayne@69: "build/lib.linux-x86_64-cpython-37/pysam", jpayne@69: "build/lib.linux-x86_64-cpython-37/pysam" jpayne@69: ], jpayne@69: "name": "pysam.libcutils", jpayne@69: "sources": [ jpayne@69: "pysam/libcutils.pyx", jpayne@69: "pysam/pysam_util.c" jpayne@69: ] jpayne@69: }, jpayne@69: "module_name": "pysam.libcutils" jpayne@69: } jpayne@69: END: Cython Metadata */ jpayne@69: jpayne@69: #ifndef PY_SSIZE_T_CLEAN jpayne@69: #define PY_SSIZE_T_CLEAN jpayne@69: #endif /* PY_SSIZE_T_CLEAN */ jpayne@69: #if defined(CYTHON_LIMITED_API) && 0 jpayne@69: #ifndef Py_LIMITED_API jpayne@69: #if CYTHON_LIMITED_API+0 > 0x03030000 jpayne@69: #define Py_LIMITED_API CYTHON_LIMITED_API jpayne@69: #else jpayne@69: #define Py_LIMITED_API 0x03030000 jpayne@69: #endif jpayne@69: #endif jpayne@69: #endif jpayne@69: jpayne@69: #include "Python.h" jpayne@69: jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj) jpayne@69: #else jpayne@69: #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj, NULL) jpayne@69: #endif jpayne@69: jpayne@69: jpayne@69: #if PY_MAJOR_VERSION <= 2 jpayne@69: #define PyDict_GetItemWithError _PyDict_GetItemWithError jpayne@69: #endif jpayne@69: jpayne@69: jpayne@69: #if (PY_VERSION_HEX < 0x030700b1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030600)) && !defined(PyContextVar_Get) jpayne@69: #define PyContextVar_Get(var, d, v) ((d) ? ((void)(var), Py_INCREF(d), (v)[0] = (d), 0) : ((v)[0] = NULL, 0) ) jpayne@69: #endif jpayne@69: jpayne@69: #ifndef Py_PYTHON_H jpayne@69: #error Python headers needed to compile C extensions, please install development version of Python. jpayne@69: #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) jpayne@69: #error Cython requires Python 2.7+ or Python 3.3+. jpayne@69: #else jpayne@69: #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API jpayne@69: #define __PYX_EXTRA_ABI_MODULE_NAME "limited" jpayne@69: #else jpayne@69: #define __PYX_EXTRA_ABI_MODULE_NAME "" jpayne@69: #endif jpayne@69: #define CYTHON_ABI "3_0_11" __PYX_EXTRA_ABI_MODULE_NAME jpayne@69: #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI jpayne@69: #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." jpayne@69: #define CYTHON_HEX_VERSION 0x03000BF0 jpayne@69: #define CYTHON_FUTURE_DIVISION 1 jpayne@69: #include jpayne@69: #ifndef offsetof jpayne@69: #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) jpayne@69: #endif jpayne@69: #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) jpayne@69: #ifndef __stdcall jpayne@69: #define __stdcall jpayne@69: #endif jpayne@69: #ifndef __cdecl jpayne@69: #define __cdecl jpayne@69: #endif jpayne@69: #ifndef __fastcall jpayne@69: #define __fastcall jpayne@69: #endif jpayne@69: #endif jpayne@69: #ifndef DL_IMPORT jpayne@69: #define DL_IMPORT(t) t jpayne@69: #endif jpayne@69: #ifndef DL_EXPORT jpayne@69: #define DL_EXPORT(t) t jpayne@69: #endif jpayne@69: #define __PYX_COMMA , jpayne@69: #ifndef HAVE_LONG_LONG jpayne@69: #define HAVE_LONG_LONG jpayne@69: #endif jpayne@69: #ifndef PY_LONG_LONG jpayne@69: #define PY_LONG_LONG LONG_LONG jpayne@69: #endif jpayne@69: #ifndef Py_HUGE_VAL jpayne@69: #define Py_HUGE_VAL HUGE_VAL jpayne@69: #endif jpayne@69: #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX jpayne@69: #if defined(GRAALVM_PYTHON) jpayne@69: /* For very preliminary testing purposes. Most variables are set the same as PyPy. jpayne@69: The existence of this section does not imply that anything works or is even tested */ jpayne@69: #define CYTHON_COMPILING_IN_PYPY 0 jpayne@69: #define CYTHON_COMPILING_IN_CPYTHON 0 jpayne@69: #define CYTHON_COMPILING_IN_LIMITED_API 0 jpayne@69: #define CYTHON_COMPILING_IN_GRAAL 1 jpayne@69: #define CYTHON_COMPILING_IN_NOGIL 0 jpayne@69: #undef CYTHON_USE_TYPE_SLOTS jpayne@69: #define CYTHON_USE_TYPE_SLOTS 0 jpayne@69: #undef CYTHON_USE_TYPE_SPECS jpayne@69: #define CYTHON_USE_TYPE_SPECS 0 jpayne@69: #undef CYTHON_USE_PYTYPE_LOOKUP jpayne@69: #define CYTHON_USE_PYTYPE_LOOKUP 0 jpayne@69: #if PY_VERSION_HEX < 0x03050000 jpayne@69: #undef CYTHON_USE_ASYNC_SLOTS jpayne@69: #define CYTHON_USE_ASYNC_SLOTS 0 jpayne@69: #elif !defined(CYTHON_USE_ASYNC_SLOTS) jpayne@69: #define CYTHON_USE_ASYNC_SLOTS 1 jpayne@69: #endif jpayne@69: #undef CYTHON_USE_PYLIST_INTERNALS jpayne@69: #define CYTHON_USE_PYLIST_INTERNALS 0 jpayne@69: #undef CYTHON_USE_UNICODE_INTERNALS jpayne@69: #define CYTHON_USE_UNICODE_INTERNALS 0 jpayne@69: #undef CYTHON_USE_UNICODE_WRITER jpayne@69: #define CYTHON_USE_UNICODE_WRITER 0 jpayne@69: #undef CYTHON_USE_PYLONG_INTERNALS jpayne@69: #define CYTHON_USE_PYLONG_INTERNALS 0 jpayne@69: #undef CYTHON_AVOID_BORROWED_REFS jpayne@69: #define CYTHON_AVOID_BORROWED_REFS 1 jpayne@69: #undef CYTHON_ASSUME_SAFE_MACROS jpayne@69: #define CYTHON_ASSUME_SAFE_MACROS 0 jpayne@69: #undef CYTHON_UNPACK_METHODS jpayne@69: #define CYTHON_UNPACK_METHODS 0 jpayne@69: #undef CYTHON_FAST_THREAD_STATE jpayne@69: #define CYTHON_FAST_THREAD_STATE 0 jpayne@69: #undef CYTHON_FAST_GIL jpayne@69: #define CYTHON_FAST_GIL 0 jpayne@69: #undef CYTHON_METH_FASTCALL jpayne@69: #define CYTHON_METH_FASTCALL 0 jpayne@69: #undef CYTHON_FAST_PYCALL jpayne@69: #define CYTHON_FAST_PYCALL 0 jpayne@69: #ifndef CYTHON_PEP487_INIT_SUBCLASS jpayne@69: #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) jpayne@69: #endif jpayne@69: #undef CYTHON_PEP489_MULTI_PHASE_INIT jpayne@69: #define CYTHON_PEP489_MULTI_PHASE_INIT 1 jpayne@69: #undef CYTHON_USE_MODULE_STATE jpayne@69: #define CYTHON_USE_MODULE_STATE 0 jpayne@69: #undef CYTHON_USE_TP_FINALIZE jpayne@69: #define CYTHON_USE_TP_FINALIZE 0 jpayne@69: #undef CYTHON_USE_DICT_VERSIONS jpayne@69: #define CYTHON_USE_DICT_VERSIONS 0 jpayne@69: #undef CYTHON_USE_EXC_INFO_STACK jpayne@69: #define CYTHON_USE_EXC_INFO_STACK 0 jpayne@69: #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC jpayne@69: #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 jpayne@69: #endif jpayne@69: #undef CYTHON_USE_FREELISTS jpayne@69: #define CYTHON_USE_FREELISTS 0 jpayne@69: #elif defined(PYPY_VERSION) jpayne@69: #define CYTHON_COMPILING_IN_PYPY 1 jpayne@69: #define CYTHON_COMPILING_IN_CPYTHON 0 jpayne@69: #define CYTHON_COMPILING_IN_LIMITED_API 0 jpayne@69: #define CYTHON_COMPILING_IN_GRAAL 0 jpayne@69: #define CYTHON_COMPILING_IN_NOGIL 0 jpayne@69: #undef CYTHON_USE_TYPE_SLOTS jpayne@69: #define CYTHON_USE_TYPE_SLOTS 0 jpayne@69: #ifndef CYTHON_USE_TYPE_SPECS jpayne@69: #define CYTHON_USE_TYPE_SPECS 0 jpayne@69: #endif jpayne@69: #undef CYTHON_USE_PYTYPE_LOOKUP jpayne@69: #define CYTHON_USE_PYTYPE_LOOKUP 0 jpayne@69: #if PY_VERSION_HEX < 0x03050000 jpayne@69: #undef CYTHON_USE_ASYNC_SLOTS jpayne@69: #define CYTHON_USE_ASYNC_SLOTS 0 jpayne@69: #elif !defined(CYTHON_USE_ASYNC_SLOTS) jpayne@69: #define CYTHON_USE_ASYNC_SLOTS 1 jpayne@69: #endif jpayne@69: #undef CYTHON_USE_PYLIST_INTERNALS jpayne@69: #define CYTHON_USE_PYLIST_INTERNALS 0 jpayne@69: #undef CYTHON_USE_UNICODE_INTERNALS jpayne@69: #define CYTHON_USE_UNICODE_INTERNALS 0 jpayne@69: #undef CYTHON_USE_UNICODE_WRITER jpayne@69: #define CYTHON_USE_UNICODE_WRITER 0 jpayne@69: #undef CYTHON_USE_PYLONG_INTERNALS jpayne@69: #define CYTHON_USE_PYLONG_INTERNALS 0 jpayne@69: #undef CYTHON_AVOID_BORROWED_REFS jpayne@69: #define CYTHON_AVOID_BORROWED_REFS 1 jpayne@69: #undef CYTHON_ASSUME_SAFE_MACROS jpayne@69: #define CYTHON_ASSUME_SAFE_MACROS 0 jpayne@69: #undef CYTHON_UNPACK_METHODS jpayne@69: #define CYTHON_UNPACK_METHODS 0 jpayne@69: #undef CYTHON_FAST_THREAD_STATE jpayne@69: #define CYTHON_FAST_THREAD_STATE 0 jpayne@69: #undef CYTHON_FAST_GIL jpayne@69: #define CYTHON_FAST_GIL 0 jpayne@69: #undef CYTHON_METH_FASTCALL jpayne@69: #define CYTHON_METH_FASTCALL 0 jpayne@69: #undef CYTHON_FAST_PYCALL jpayne@69: #define CYTHON_FAST_PYCALL 0 jpayne@69: #ifndef CYTHON_PEP487_INIT_SUBCLASS jpayne@69: #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) jpayne@69: #endif jpayne@69: #if PY_VERSION_HEX < 0x03090000 jpayne@69: #undef CYTHON_PEP489_MULTI_PHASE_INIT jpayne@69: #define CYTHON_PEP489_MULTI_PHASE_INIT 0 jpayne@69: #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) jpayne@69: #define CYTHON_PEP489_MULTI_PHASE_INIT 1 jpayne@69: #endif jpayne@69: #undef CYTHON_USE_MODULE_STATE jpayne@69: #define CYTHON_USE_MODULE_STATE 0 jpayne@69: #undef CYTHON_USE_TP_FINALIZE jpayne@69: #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) jpayne@69: #undef CYTHON_USE_DICT_VERSIONS jpayne@69: #define CYTHON_USE_DICT_VERSIONS 0 jpayne@69: #undef CYTHON_USE_EXC_INFO_STACK jpayne@69: #define CYTHON_USE_EXC_INFO_STACK 0 jpayne@69: #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC jpayne@69: #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 jpayne@69: #endif jpayne@69: #undef CYTHON_USE_FREELISTS jpayne@69: #define CYTHON_USE_FREELISTS 0 jpayne@69: #elif defined(CYTHON_LIMITED_API) jpayne@69: #ifdef Py_LIMITED_API jpayne@69: #undef __PYX_LIMITED_VERSION_HEX jpayne@69: #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API jpayne@69: #endif jpayne@69: #define CYTHON_COMPILING_IN_PYPY 0 jpayne@69: #define CYTHON_COMPILING_IN_CPYTHON 0 jpayne@69: #define CYTHON_COMPILING_IN_LIMITED_API 1 jpayne@69: #define CYTHON_COMPILING_IN_GRAAL 0 jpayne@69: #define CYTHON_COMPILING_IN_NOGIL 0 jpayne@69: #undef CYTHON_CLINE_IN_TRACEBACK jpayne@69: #define CYTHON_CLINE_IN_TRACEBACK 0 jpayne@69: #undef CYTHON_USE_TYPE_SLOTS jpayne@69: #define CYTHON_USE_TYPE_SLOTS 0 jpayne@69: #undef CYTHON_USE_TYPE_SPECS jpayne@69: #define CYTHON_USE_TYPE_SPECS 1 jpayne@69: #undef CYTHON_USE_PYTYPE_LOOKUP jpayne@69: #define CYTHON_USE_PYTYPE_LOOKUP 0 jpayne@69: #undef CYTHON_USE_ASYNC_SLOTS jpayne@69: #define CYTHON_USE_ASYNC_SLOTS 0 jpayne@69: #undef CYTHON_USE_PYLIST_INTERNALS jpayne@69: #define CYTHON_USE_PYLIST_INTERNALS 0 jpayne@69: #undef CYTHON_USE_UNICODE_INTERNALS jpayne@69: #define CYTHON_USE_UNICODE_INTERNALS 0 jpayne@69: #ifndef CYTHON_USE_UNICODE_WRITER jpayne@69: #define CYTHON_USE_UNICODE_WRITER 0 jpayne@69: #endif jpayne@69: #undef CYTHON_USE_PYLONG_INTERNALS jpayne@69: #define CYTHON_USE_PYLONG_INTERNALS 0 jpayne@69: #ifndef CYTHON_AVOID_BORROWED_REFS jpayne@69: #define CYTHON_AVOID_BORROWED_REFS 0 jpayne@69: #endif jpayne@69: #undef CYTHON_ASSUME_SAFE_MACROS jpayne@69: #define CYTHON_ASSUME_SAFE_MACROS 0 jpayne@69: #undef CYTHON_UNPACK_METHODS jpayne@69: #define CYTHON_UNPACK_METHODS 0 jpayne@69: #undef CYTHON_FAST_THREAD_STATE jpayne@69: #define CYTHON_FAST_THREAD_STATE 0 jpayne@69: #undef CYTHON_FAST_GIL jpayne@69: #define CYTHON_FAST_GIL 0 jpayne@69: #undef CYTHON_METH_FASTCALL jpayne@69: #define CYTHON_METH_FASTCALL 0 jpayne@69: #undef CYTHON_FAST_PYCALL jpayne@69: #define CYTHON_FAST_PYCALL 0 jpayne@69: #ifndef CYTHON_PEP487_INIT_SUBCLASS jpayne@69: #define CYTHON_PEP487_INIT_SUBCLASS 1 jpayne@69: #endif jpayne@69: #undef CYTHON_PEP489_MULTI_PHASE_INIT jpayne@69: #define CYTHON_PEP489_MULTI_PHASE_INIT 0 jpayne@69: #undef CYTHON_USE_MODULE_STATE jpayne@69: #define CYTHON_USE_MODULE_STATE 1 jpayne@69: #ifndef CYTHON_USE_TP_FINALIZE jpayne@69: #define CYTHON_USE_TP_FINALIZE 0 jpayne@69: #endif jpayne@69: #undef CYTHON_USE_DICT_VERSIONS jpayne@69: #define CYTHON_USE_DICT_VERSIONS 0 jpayne@69: #undef CYTHON_USE_EXC_INFO_STACK jpayne@69: #define CYTHON_USE_EXC_INFO_STACK 0 jpayne@69: #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC jpayne@69: #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 jpayne@69: #endif jpayne@69: #undef CYTHON_USE_FREELISTS jpayne@69: #define CYTHON_USE_FREELISTS 0 jpayne@69: #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) jpayne@69: #define CYTHON_COMPILING_IN_PYPY 0 jpayne@69: #define CYTHON_COMPILING_IN_CPYTHON 0 jpayne@69: #define CYTHON_COMPILING_IN_LIMITED_API 0 jpayne@69: #define CYTHON_COMPILING_IN_GRAAL 0 jpayne@69: #define CYTHON_COMPILING_IN_NOGIL 1 jpayne@69: #ifndef CYTHON_USE_TYPE_SLOTS jpayne@69: #define CYTHON_USE_TYPE_SLOTS 1 jpayne@69: #endif jpayne@69: #ifndef CYTHON_USE_TYPE_SPECS jpayne@69: #define CYTHON_USE_TYPE_SPECS 0 jpayne@69: #endif jpayne@69: #undef CYTHON_USE_PYTYPE_LOOKUP jpayne@69: #define CYTHON_USE_PYTYPE_LOOKUP 0 jpayne@69: #ifndef CYTHON_USE_ASYNC_SLOTS jpayne@69: #define CYTHON_USE_ASYNC_SLOTS 1 jpayne@69: #endif jpayne@69: #ifndef CYTHON_USE_PYLONG_INTERNALS jpayne@69: #define CYTHON_USE_PYLONG_INTERNALS 0 jpayne@69: #endif jpayne@69: #undef CYTHON_USE_PYLIST_INTERNALS jpayne@69: #define CYTHON_USE_PYLIST_INTERNALS 0 jpayne@69: #ifndef CYTHON_USE_UNICODE_INTERNALS jpayne@69: #define CYTHON_USE_UNICODE_INTERNALS 1 jpayne@69: #endif jpayne@69: #undef CYTHON_USE_UNICODE_WRITER jpayne@69: #define CYTHON_USE_UNICODE_WRITER 0 jpayne@69: #ifndef CYTHON_AVOID_BORROWED_REFS jpayne@69: #define CYTHON_AVOID_BORROWED_REFS 0 jpayne@69: #endif jpayne@69: #ifndef CYTHON_ASSUME_SAFE_MACROS jpayne@69: #define CYTHON_ASSUME_SAFE_MACROS 1 jpayne@69: #endif jpayne@69: #ifndef CYTHON_UNPACK_METHODS jpayne@69: #define CYTHON_UNPACK_METHODS 1 jpayne@69: #endif jpayne@69: #undef CYTHON_FAST_THREAD_STATE jpayne@69: #define CYTHON_FAST_THREAD_STATE 0 jpayne@69: #undef CYTHON_FAST_GIL jpayne@69: #define CYTHON_FAST_GIL 0 jpayne@69: #ifndef CYTHON_METH_FASTCALL jpayne@69: #define CYTHON_METH_FASTCALL 1 jpayne@69: #endif jpayne@69: #undef CYTHON_FAST_PYCALL jpayne@69: #define CYTHON_FAST_PYCALL 0 jpayne@69: #ifndef CYTHON_PEP487_INIT_SUBCLASS jpayne@69: #define CYTHON_PEP487_INIT_SUBCLASS 1 jpayne@69: #endif jpayne@69: #ifndef CYTHON_PEP489_MULTI_PHASE_INIT jpayne@69: #define CYTHON_PEP489_MULTI_PHASE_INIT 1 jpayne@69: #endif jpayne@69: #ifndef CYTHON_USE_MODULE_STATE jpayne@69: #define CYTHON_USE_MODULE_STATE 0 jpayne@69: #endif jpayne@69: #ifndef CYTHON_USE_TP_FINALIZE jpayne@69: #define CYTHON_USE_TP_FINALIZE 1 jpayne@69: #endif jpayne@69: #undef CYTHON_USE_DICT_VERSIONS jpayne@69: #define CYTHON_USE_DICT_VERSIONS 0 jpayne@69: #undef CYTHON_USE_EXC_INFO_STACK jpayne@69: #define CYTHON_USE_EXC_INFO_STACK 0 jpayne@69: #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC jpayne@69: #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 jpayne@69: #endif jpayne@69: #ifndef CYTHON_USE_FREELISTS jpayne@69: #define CYTHON_USE_FREELISTS 0 jpayne@69: #endif jpayne@69: #else jpayne@69: #define CYTHON_COMPILING_IN_PYPY 0 jpayne@69: #define CYTHON_COMPILING_IN_CPYTHON 1 jpayne@69: #define CYTHON_COMPILING_IN_LIMITED_API 0 jpayne@69: #define CYTHON_COMPILING_IN_GRAAL 0 jpayne@69: #define CYTHON_COMPILING_IN_NOGIL 0 jpayne@69: #ifndef CYTHON_USE_TYPE_SLOTS jpayne@69: #define CYTHON_USE_TYPE_SLOTS 1 jpayne@69: #endif jpayne@69: #ifndef CYTHON_USE_TYPE_SPECS jpayne@69: #define CYTHON_USE_TYPE_SPECS 0 jpayne@69: #endif jpayne@69: #ifndef CYTHON_USE_PYTYPE_LOOKUP jpayne@69: #define CYTHON_USE_PYTYPE_LOOKUP 1 jpayne@69: #endif jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: #undef CYTHON_USE_ASYNC_SLOTS jpayne@69: #define CYTHON_USE_ASYNC_SLOTS 0 jpayne@69: #elif !defined(CYTHON_USE_ASYNC_SLOTS) jpayne@69: #define CYTHON_USE_ASYNC_SLOTS 1 jpayne@69: #endif jpayne@69: #ifndef CYTHON_USE_PYLONG_INTERNALS jpayne@69: #define CYTHON_USE_PYLONG_INTERNALS 1 jpayne@69: #endif jpayne@69: #ifndef CYTHON_USE_PYLIST_INTERNALS jpayne@69: #define CYTHON_USE_PYLIST_INTERNALS 1 jpayne@69: #endif jpayne@69: #ifndef CYTHON_USE_UNICODE_INTERNALS jpayne@69: #define CYTHON_USE_UNICODE_INTERNALS 1 jpayne@69: #endif jpayne@69: #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 jpayne@69: #undef CYTHON_USE_UNICODE_WRITER jpayne@69: #define CYTHON_USE_UNICODE_WRITER 0 jpayne@69: #elif !defined(CYTHON_USE_UNICODE_WRITER) jpayne@69: #define CYTHON_USE_UNICODE_WRITER 1 jpayne@69: #endif jpayne@69: #ifndef CYTHON_AVOID_BORROWED_REFS jpayne@69: #define CYTHON_AVOID_BORROWED_REFS 0 jpayne@69: #endif jpayne@69: #ifndef CYTHON_ASSUME_SAFE_MACROS jpayne@69: #define CYTHON_ASSUME_SAFE_MACROS 1 jpayne@69: #endif jpayne@69: #ifndef CYTHON_UNPACK_METHODS jpayne@69: #define CYTHON_UNPACK_METHODS 1 jpayne@69: #endif jpayne@69: #ifndef CYTHON_FAST_THREAD_STATE jpayne@69: #define CYTHON_FAST_THREAD_STATE 1 jpayne@69: #endif jpayne@69: #ifndef CYTHON_FAST_GIL jpayne@69: #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) jpayne@69: #endif jpayne@69: #ifndef CYTHON_METH_FASTCALL jpayne@69: #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) jpayne@69: #endif jpayne@69: #ifndef CYTHON_FAST_PYCALL jpayne@69: #define CYTHON_FAST_PYCALL 1 jpayne@69: #endif jpayne@69: #ifndef CYTHON_PEP487_INIT_SUBCLASS jpayne@69: #define CYTHON_PEP487_INIT_SUBCLASS 1 jpayne@69: #endif jpayne@69: #if PY_VERSION_HEX < 0x03050000 jpayne@69: #undef CYTHON_PEP489_MULTI_PHASE_INIT jpayne@69: #define CYTHON_PEP489_MULTI_PHASE_INIT 0 jpayne@69: #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) jpayne@69: #define CYTHON_PEP489_MULTI_PHASE_INIT 1 jpayne@69: #endif jpayne@69: #ifndef CYTHON_USE_MODULE_STATE jpayne@69: #define CYTHON_USE_MODULE_STATE 0 jpayne@69: #endif jpayne@69: #if PY_VERSION_HEX < 0x030400a1 jpayne@69: #undef CYTHON_USE_TP_FINALIZE jpayne@69: #define CYTHON_USE_TP_FINALIZE 0 jpayne@69: #elif !defined(CYTHON_USE_TP_FINALIZE) jpayne@69: #define CYTHON_USE_TP_FINALIZE 1 jpayne@69: #endif jpayne@69: #if PY_VERSION_HEX < 0x030600B1 jpayne@69: #undef CYTHON_USE_DICT_VERSIONS jpayne@69: #define CYTHON_USE_DICT_VERSIONS 0 jpayne@69: #elif !defined(CYTHON_USE_DICT_VERSIONS) jpayne@69: #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) jpayne@69: #endif jpayne@69: #if PY_VERSION_HEX < 0x030700A3 jpayne@69: #undef CYTHON_USE_EXC_INFO_STACK jpayne@69: #define CYTHON_USE_EXC_INFO_STACK 0 jpayne@69: #elif !defined(CYTHON_USE_EXC_INFO_STACK) jpayne@69: #define CYTHON_USE_EXC_INFO_STACK 1 jpayne@69: #endif jpayne@69: #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC jpayne@69: #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 jpayne@69: #endif jpayne@69: #ifndef CYTHON_USE_FREELISTS jpayne@69: #define CYTHON_USE_FREELISTS 1 jpayne@69: #endif jpayne@69: #endif jpayne@69: #if !defined(CYTHON_FAST_PYCCALL) jpayne@69: #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) jpayne@69: #endif jpayne@69: #if !defined(CYTHON_VECTORCALL) jpayne@69: #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) jpayne@69: #endif jpayne@69: #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) jpayne@69: #if CYTHON_USE_PYLONG_INTERNALS jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: #include "longintrepr.h" jpayne@69: #endif jpayne@69: #undef SHIFT jpayne@69: #undef BASE jpayne@69: #undef MASK jpayne@69: #ifdef SIZEOF_VOID_P jpayne@69: enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; jpayne@69: #endif jpayne@69: #endif jpayne@69: #ifndef __has_attribute jpayne@69: #define __has_attribute(x) 0 jpayne@69: #endif jpayne@69: #ifndef __has_cpp_attribute jpayne@69: #define __has_cpp_attribute(x) 0 jpayne@69: #endif jpayne@69: #ifndef CYTHON_RESTRICT jpayne@69: #if defined(__GNUC__) jpayne@69: #define CYTHON_RESTRICT __restrict__ jpayne@69: #elif defined(_MSC_VER) && _MSC_VER >= 1400 jpayne@69: #define CYTHON_RESTRICT __restrict jpayne@69: #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L jpayne@69: #define CYTHON_RESTRICT restrict jpayne@69: #else jpayne@69: #define CYTHON_RESTRICT jpayne@69: #endif jpayne@69: #endif jpayne@69: #ifndef CYTHON_UNUSED jpayne@69: #if defined(__cplusplus) jpayne@69: /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 jpayne@69: * but leads to warnings with -pedantic, since it is a C++17 feature */ jpayne@69: #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) jpayne@69: #if __has_cpp_attribute(maybe_unused) jpayne@69: #define CYTHON_UNUSED [[maybe_unused]] jpayne@69: #endif jpayne@69: #endif jpayne@69: #endif jpayne@69: #endif jpayne@69: #ifndef CYTHON_UNUSED jpayne@69: # if defined(__GNUC__) jpayne@69: # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) jpayne@69: # define CYTHON_UNUSED __attribute__ ((__unused__)) jpayne@69: # else jpayne@69: # define CYTHON_UNUSED jpayne@69: # endif jpayne@69: # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) jpayne@69: # define CYTHON_UNUSED __attribute__ ((__unused__)) jpayne@69: # else jpayne@69: # define CYTHON_UNUSED jpayne@69: # endif jpayne@69: #endif jpayne@69: #ifndef CYTHON_UNUSED_VAR jpayne@69: # if defined(__cplusplus) jpayne@69: template void CYTHON_UNUSED_VAR( const T& ) { } jpayne@69: # else jpayne@69: # define CYTHON_UNUSED_VAR(x) (void)(x) jpayne@69: # endif jpayne@69: #endif jpayne@69: #ifndef CYTHON_MAYBE_UNUSED_VAR jpayne@69: #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) jpayne@69: #endif jpayne@69: #ifndef CYTHON_NCP_UNUSED jpayne@69: # if CYTHON_COMPILING_IN_CPYTHON jpayne@69: # define CYTHON_NCP_UNUSED jpayne@69: # else jpayne@69: # define CYTHON_NCP_UNUSED CYTHON_UNUSED jpayne@69: # endif jpayne@69: #endif jpayne@69: #ifndef CYTHON_USE_CPP_STD_MOVE jpayne@69: #if defined(__cplusplus) && (\ jpayne@69: __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) jpayne@69: #define CYTHON_USE_CPP_STD_MOVE 1 jpayne@69: #else jpayne@69: #define CYTHON_USE_CPP_STD_MOVE 0 jpayne@69: #endif jpayne@69: #endif jpayne@69: #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) jpayne@69: #ifdef _MSC_VER jpayne@69: #ifndef _MSC_STDINT_H_ jpayne@69: #if _MSC_VER < 1300 jpayne@69: typedef unsigned char uint8_t; jpayne@69: typedef unsigned short uint16_t; jpayne@69: typedef unsigned int uint32_t; jpayne@69: #else jpayne@69: typedef unsigned __int8 uint8_t; jpayne@69: typedef unsigned __int16 uint16_t; jpayne@69: typedef unsigned __int32 uint32_t; jpayne@69: #endif jpayne@69: #endif jpayne@69: #if _MSC_VER < 1300 jpayne@69: #ifdef _WIN64 jpayne@69: typedef unsigned long long __pyx_uintptr_t; jpayne@69: #else jpayne@69: typedef unsigned int __pyx_uintptr_t; jpayne@69: #endif jpayne@69: #else jpayne@69: #ifdef _WIN64 jpayne@69: typedef unsigned __int64 __pyx_uintptr_t; jpayne@69: #else jpayne@69: typedef unsigned __int32 __pyx_uintptr_t; jpayne@69: #endif jpayne@69: #endif jpayne@69: #else jpayne@69: #include jpayne@69: typedef uintptr_t __pyx_uintptr_t; jpayne@69: #endif jpayne@69: #ifndef CYTHON_FALLTHROUGH jpayne@69: #if defined(__cplusplus) jpayne@69: /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 jpayne@69: * but leads to warnings with -pedantic, since it is a C++17 feature */ jpayne@69: #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) jpayne@69: #if __has_cpp_attribute(fallthrough) jpayne@69: #define CYTHON_FALLTHROUGH [[fallthrough]] jpayne@69: #endif jpayne@69: #endif jpayne@69: #ifndef CYTHON_FALLTHROUGH jpayne@69: #if __has_cpp_attribute(clang::fallthrough) jpayne@69: #define CYTHON_FALLTHROUGH [[clang::fallthrough]] jpayne@69: #elif __has_cpp_attribute(gnu::fallthrough) jpayne@69: #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] jpayne@69: #endif jpayne@69: #endif jpayne@69: #endif jpayne@69: #ifndef CYTHON_FALLTHROUGH jpayne@69: #if __has_attribute(fallthrough) jpayne@69: #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) jpayne@69: #else jpayne@69: #define CYTHON_FALLTHROUGH jpayne@69: #endif jpayne@69: #endif jpayne@69: #if defined(__clang__) && defined(__apple_build_version__) jpayne@69: #if __apple_build_version__ < 7000000 jpayne@69: #undef CYTHON_FALLTHROUGH jpayne@69: #define CYTHON_FALLTHROUGH jpayne@69: #endif jpayne@69: #endif jpayne@69: #endif jpayne@69: #ifdef __cplusplus jpayne@69: template jpayne@69: struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; jpayne@69: #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) jpayne@69: #else jpayne@69: #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) jpayne@69: #endif jpayne@69: #if CYTHON_COMPILING_IN_PYPY == 1 jpayne@69: #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) jpayne@69: #else jpayne@69: #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) jpayne@69: #endif jpayne@69: #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) jpayne@69: jpayne@69: #ifndef CYTHON_INLINE jpayne@69: #if defined(__clang__) jpayne@69: #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) jpayne@69: #elif defined(__GNUC__) jpayne@69: #define CYTHON_INLINE __inline__ jpayne@69: #elif defined(_MSC_VER) jpayne@69: #define CYTHON_INLINE __inline jpayne@69: #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L jpayne@69: #define CYTHON_INLINE inline jpayne@69: #else jpayne@69: #define CYTHON_INLINE jpayne@69: #endif jpayne@69: #endif jpayne@69: jpayne@69: #define __PYX_BUILD_PY_SSIZE_T "n" jpayne@69: #define CYTHON_FORMAT_SSIZE_T "z" jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" jpayne@69: #define __Pyx_DefaultClassType PyClass_Type jpayne@69: #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ jpayne@69: PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) jpayne@69: #else jpayne@69: #define __Pyx_BUILTIN_MODULE_NAME "builtins" jpayne@69: #define __Pyx_DefaultClassType PyType_Type jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, jpayne@69: PyObject *code, PyObject *c, PyObject* n, PyObject *v, jpayne@69: PyObject *fv, PyObject *cell, PyObject* fn, jpayne@69: PyObject *name, int fline, PyObject *lnos) { jpayne@69: PyObject *exception_table = NULL; jpayne@69: PyObject *types_module=NULL, *code_type=NULL, *result=NULL; jpayne@69: #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 jpayne@69: PyObject *version_info; jpayne@69: PyObject *py_minor_version = NULL; jpayne@69: #endif jpayne@69: long minor_version = 0; jpayne@69: PyObject *type, *value, *traceback; jpayne@69: PyErr_Fetch(&type, &value, &traceback); jpayne@69: #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 jpayne@69: minor_version = 11; jpayne@69: #else jpayne@69: if (!(version_info = PySys_GetObject("version_info"))) goto end; jpayne@69: if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; jpayne@69: minor_version = PyLong_AsLong(py_minor_version); jpayne@69: Py_DECREF(py_minor_version); jpayne@69: if (minor_version == -1 && PyErr_Occurred()) goto end; jpayne@69: #endif jpayne@69: if (!(types_module = PyImport_ImportModule("types"))) goto end; jpayne@69: if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; jpayne@69: if (minor_version <= 7) { jpayne@69: (void)p; jpayne@69: result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, jpayne@69: c, n, v, fn, name, fline, lnos, fv, cell); jpayne@69: } else if (minor_version <= 10) { jpayne@69: result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, jpayne@69: c, n, v, fn, name, fline, lnos, fv, cell); jpayne@69: } else { jpayne@69: if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; jpayne@69: result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, jpayne@69: c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); jpayne@69: } jpayne@69: end: jpayne@69: Py_XDECREF(code_type); jpayne@69: Py_XDECREF(exception_table); jpayne@69: Py_XDECREF(types_module); jpayne@69: if (type) { jpayne@69: PyErr_Restore(type, value, traceback); jpayne@69: } jpayne@69: return result; jpayne@69: } jpayne@69: #ifndef CO_OPTIMIZED jpayne@69: #define CO_OPTIMIZED 0x0001 jpayne@69: #endif jpayne@69: #ifndef CO_NEWLOCALS jpayne@69: #define CO_NEWLOCALS 0x0002 jpayne@69: #endif jpayne@69: #ifndef CO_VARARGS jpayne@69: #define CO_VARARGS 0x0004 jpayne@69: #endif jpayne@69: #ifndef CO_VARKEYWORDS jpayne@69: #define CO_VARKEYWORDS 0x0008 jpayne@69: #endif jpayne@69: #ifndef CO_ASYNC_GENERATOR jpayne@69: #define CO_ASYNC_GENERATOR 0x0200 jpayne@69: #endif jpayne@69: #ifndef CO_GENERATOR jpayne@69: #define CO_GENERATOR 0x0020 jpayne@69: #endif jpayne@69: #ifndef CO_COROUTINE jpayne@69: #define CO_COROUTINE 0x0080 jpayne@69: #endif jpayne@69: #elif PY_VERSION_HEX >= 0x030B0000 jpayne@69: static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, jpayne@69: PyObject *code, PyObject *c, PyObject* n, PyObject *v, jpayne@69: PyObject *fv, PyObject *cell, PyObject* fn, jpayne@69: PyObject *name, int fline, PyObject *lnos) { jpayne@69: PyCodeObject *result; jpayne@69: PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); jpayne@69: if (!empty_bytes) return NULL; jpayne@69: result = jpayne@69: #if PY_VERSION_HEX >= 0x030C0000 jpayne@69: PyUnstable_Code_NewWithPosOnlyArgs jpayne@69: #else jpayne@69: PyCode_NewWithPosOnlyArgs jpayne@69: #endif jpayne@69: (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); jpayne@69: Py_DECREF(empty_bytes); jpayne@69: return result; jpayne@69: } jpayne@69: #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY jpayne@69: #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ jpayne@69: PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) jpayne@69: #else jpayne@69: #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ jpayne@69: PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) jpayne@69: #endif jpayne@69: #endif jpayne@69: #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) jpayne@69: #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) jpayne@69: #else jpayne@69: #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) jpayne@69: #endif jpayne@69: #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) jpayne@69: #define __Pyx_Py_Is(x, y) Py_Is(x, y) jpayne@69: #else jpayne@69: #define __Pyx_Py_Is(x, y) ((x) == (y)) jpayne@69: #endif jpayne@69: #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) jpayne@69: #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) jpayne@69: #else jpayne@69: #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) jpayne@69: #endif jpayne@69: #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) jpayne@69: #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) jpayne@69: #else jpayne@69: #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) jpayne@69: #endif jpayne@69: #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) jpayne@69: #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) jpayne@69: #else jpayne@69: #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) jpayne@69: #endif jpayne@69: #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) jpayne@69: #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY jpayne@69: #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) jpayne@69: #else jpayne@69: #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) jpayne@69: #endif jpayne@69: #ifndef CO_COROUTINE jpayne@69: #define CO_COROUTINE 0x80 jpayne@69: #endif jpayne@69: #ifndef CO_ASYNC_GENERATOR jpayne@69: #define CO_ASYNC_GENERATOR 0x200 jpayne@69: #endif jpayne@69: #ifndef Py_TPFLAGS_CHECKTYPES jpayne@69: #define Py_TPFLAGS_CHECKTYPES 0 jpayne@69: #endif jpayne@69: #ifndef Py_TPFLAGS_HAVE_INDEX jpayne@69: #define Py_TPFLAGS_HAVE_INDEX 0 jpayne@69: #endif jpayne@69: #ifndef Py_TPFLAGS_HAVE_NEWBUFFER jpayne@69: #define Py_TPFLAGS_HAVE_NEWBUFFER 0 jpayne@69: #endif jpayne@69: #ifndef Py_TPFLAGS_HAVE_FINALIZE jpayne@69: #define Py_TPFLAGS_HAVE_FINALIZE 0 jpayne@69: #endif jpayne@69: #ifndef Py_TPFLAGS_SEQUENCE jpayne@69: #define Py_TPFLAGS_SEQUENCE 0 jpayne@69: #endif jpayne@69: #ifndef Py_TPFLAGS_MAPPING jpayne@69: #define Py_TPFLAGS_MAPPING 0 jpayne@69: #endif jpayne@69: #ifndef METH_STACKLESS jpayne@69: #define METH_STACKLESS 0 jpayne@69: #endif jpayne@69: #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) jpayne@69: #ifndef METH_FASTCALL jpayne@69: #define METH_FASTCALL 0x80 jpayne@69: #endif jpayne@69: typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); jpayne@69: typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, jpayne@69: Py_ssize_t nargs, PyObject *kwnames); jpayne@69: #else jpayne@69: #if PY_VERSION_HEX >= 0x030d00A4 jpayne@69: # define __Pyx_PyCFunctionFast PyCFunctionFast jpayne@69: # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords jpayne@69: #else jpayne@69: # define __Pyx_PyCFunctionFast _PyCFunctionFast jpayne@69: # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords jpayne@69: #endif jpayne@69: #endif jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: #define __Pyx_METH_FASTCALL METH_FASTCALL jpayne@69: #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast jpayne@69: #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords jpayne@69: #else jpayne@69: #define __Pyx_METH_FASTCALL METH_VARARGS jpayne@69: #define __Pyx_PyCFunction_FastCall PyCFunction jpayne@69: #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords jpayne@69: #endif jpayne@69: #if CYTHON_VECTORCALL jpayne@69: #define __pyx_vectorcallfunc vectorcallfunc jpayne@69: #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET jpayne@69: #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) jpayne@69: #elif CYTHON_BACKPORT_VECTORCALL jpayne@69: typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, jpayne@69: size_t nargsf, PyObject *kwnames); jpayne@69: #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) jpayne@69: #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) jpayne@69: #else jpayne@69: #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 jpayne@69: #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) jpayne@69: #endif jpayne@69: #if PY_MAJOR_VERSION >= 0x030900B1 jpayne@69: #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) jpayne@69: #else jpayne@69: #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) jpayne@69: #endif jpayne@69: #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON jpayne@69: #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) jpayne@69: #elif !CYTHON_COMPILING_IN_LIMITED_API jpayne@69: #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) jpayne@69: #endif jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON jpayne@69: #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) jpayne@69: static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { jpayne@69: return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; jpayne@69: } jpayne@69: #endif jpayne@69: static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; jpayne@69: #else jpayne@69: return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; jpayne@69: #endif jpayne@69: } jpayne@69: #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) jpayne@69: #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 jpayne@69: #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) jpayne@69: typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); jpayne@69: #else jpayne@69: #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) jpayne@69: #define __Pyx_PyCMethod PyCMethod jpayne@69: #endif jpayne@69: #ifndef METH_METHOD jpayne@69: #define METH_METHOD 0x200 jpayne@69: #endif jpayne@69: #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) jpayne@69: #define PyObject_Malloc(s) PyMem_Malloc(s) jpayne@69: #define PyObject_Free(p) PyMem_Free(p) jpayne@69: #define PyObject_Realloc(p) PyMem_Realloc(p) jpayne@69: #endif jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) jpayne@69: #define __Pyx_PyFrame_SetLineNumber(frame, lineno) jpayne@69: #else jpayne@69: #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) jpayne@69: #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) jpayne@69: #endif jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: #define __Pyx_PyThreadState_Current PyThreadState_Get() jpayne@69: #elif !CYTHON_FAST_THREAD_STATE jpayne@69: #define __Pyx_PyThreadState_Current PyThreadState_GET() jpayne@69: #elif PY_VERSION_HEX >= 0x030d00A1 jpayne@69: #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() jpayne@69: #elif PY_VERSION_HEX >= 0x03060000 jpayne@69: #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() jpayne@69: #elif PY_VERSION_HEX >= 0x03000000 jpayne@69: #define __Pyx_PyThreadState_Current PyThreadState_GET() jpayne@69: #else jpayne@69: #define __Pyx_PyThreadState_Current _PyThreadState_Current jpayne@69: #endif jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) jpayne@69: { jpayne@69: void *result; jpayne@69: result = PyModule_GetState(op); jpayne@69: if (!result) jpayne@69: Py_FatalError("Couldn't find the module state"); jpayne@69: return result; jpayne@69: } jpayne@69: #endif jpayne@69: #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) jpayne@69: #else jpayne@69: #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) jpayne@69: #endif jpayne@69: #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) jpayne@69: #include "pythread.h" jpayne@69: #define Py_tss_NEEDS_INIT 0 jpayne@69: typedef int Py_tss_t; jpayne@69: static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { jpayne@69: *key = PyThread_create_key(); jpayne@69: return 0; jpayne@69: } jpayne@69: static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { jpayne@69: Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); jpayne@69: *key = Py_tss_NEEDS_INIT; jpayne@69: return key; jpayne@69: } jpayne@69: static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { jpayne@69: PyObject_Free(key); jpayne@69: } jpayne@69: static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { jpayne@69: return *key != Py_tss_NEEDS_INIT; jpayne@69: } jpayne@69: static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { jpayne@69: PyThread_delete_key(*key); jpayne@69: *key = Py_tss_NEEDS_INIT; jpayne@69: } jpayne@69: static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { jpayne@69: return PyThread_set_key_value(*key, value); jpayne@69: } jpayne@69: static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { jpayne@69: return PyThread_get_key_value(*key); jpayne@69: } jpayne@69: #endif jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: #if CYTHON_COMPILING_IN_PYPY jpayne@69: #if PYPY_VERSION_NUM < 0x07030600 jpayne@69: #if defined(__cplusplus) && __cplusplus >= 201402L jpayne@69: [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] jpayne@69: #elif defined(__GNUC__) || defined(__clang__) jpayne@69: __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) jpayne@69: #elif defined(_MSC_VER) jpayne@69: __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) jpayne@69: #endif jpayne@69: static CYTHON_INLINE int PyGILState_Check(void) { jpayne@69: return 0; jpayne@69: } jpayne@69: #else // PYPY_VERSION_NUM < 0x07030600 jpayne@69: #endif // PYPY_VERSION_NUM < 0x07030600 jpayne@69: #else jpayne@69: static CYTHON_INLINE int PyGILState_Check(void) { jpayne@69: PyThreadState * tstate = _PyThreadState_Current; jpayne@69: return tstate && (tstate == PyGILState_GetThisThreadState()); jpayne@69: } jpayne@69: #endif jpayne@69: #endif jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) jpayne@69: #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) jpayne@69: #else jpayne@69: #define __Pyx_PyDict_NewPresized(n) PyDict_New() jpayne@69: #endif jpayne@69: #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION jpayne@69: #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) jpayne@69: #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) jpayne@69: #else jpayne@69: #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) jpayne@69: #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) jpayne@69: #endif jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS jpayne@69: #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) jpayne@69: static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { jpayne@69: PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); jpayne@69: if (res == NULL) PyErr_Clear(); jpayne@69: return res; jpayne@69: } jpayne@69: #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) jpayne@69: #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError jpayne@69: #define __Pyx_PyDict_GetItemStr PyDict_GetItem jpayne@69: #else jpayne@69: static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { jpayne@69: #if CYTHON_COMPILING_IN_PYPY jpayne@69: return PyDict_GetItem(dict, name); jpayne@69: #else jpayne@69: PyDictEntry *ep; jpayne@69: PyDictObject *mp = (PyDictObject*) dict; jpayne@69: long hash = ((PyStringObject *) name)->ob_shash; jpayne@69: assert(hash != -1); jpayne@69: ep = (mp->ma_lookup)(mp, name, hash); jpayne@69: if (ep == NULL) { jpayne@69: return NULL; jpayne@69: } jpayne@69: return ep->me_value; jpayne@69: #endif jpayne@69: } jpayne@69: #define __Pyx_PyDict_GetItemStr PyDict_GetItem jpayne@69: #endif jpayne@69: #if CYTHON_USE_TYPE_SLOTS jpayne@69: #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) jpayne@69: #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) jpayne@69: #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) jpayne@69: #else jpayne@69: #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) jpayne@69: #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) jpayne@69: #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next jpayne@69: #endif jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) jpayne@69: #else jpayne@69: #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) jpayne@69: #endif jpayne@69: #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 jpayne@69: #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ jpayne@69: PyTypeObject *type = Py_TYPE((PyObject*)obj);\ jpayne@69: assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ jpayne@69: PyObject_GC_Del(obj);\ jpayne@69: Py_DECREF(type);\ jpayne@69: } jpayne@69: #else jpayne@69: #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) jpayne@69: #endif jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: #define CYTHON_PEP393_ENABLED 1 jpayne@69: #define __Pyx_PyUnicode_READY(op) (0) jpayne@69: #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) jpayne@69: #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) jpayne@69: #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) jpayne@69: #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) jpayne@69: #define __Pyx_PyUnicode_DATA(u) ((void*)u) jpayne@69: #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) jpayne@69: #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) jpayne@69: #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) jpayne@69: #define CYTHON_PEP393_ENABLED 1 jpayne@69: #if PY_VERSION_HEX >= 0x030C0000 jpayne@69: #define __Pyx_PyUnicode_READY(op) (0) jpayne@69: #else jpayne@69: #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ jpayne@69: 0 : _PyUnicode_Ready((PyObject *)(op))) jpayne@69: #endif jpayne@69: #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) jpayne@69: #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) jpayne@69: #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) jpayne@69: #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) jpayne@69: #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) jpayne@69: #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) jpayne@69: #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) jpayne@69: #if PY_VERSION_HEX >= 0x030C0000 jpayne@69: #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) jpayne@69: #else jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 jpayne@69: #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) jpayne@69: #else jpayne@69: #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) jpayne@69: #endif jpayne@69: #endif jpayne@69: #else jpayne@69: #define CYTHON_PEP393_ENABLED 0 jpayne@69: #define PyUnicode_1BYTE_KIND 1 jpayne@69: #define PyUnicode_2BYTE_KIND 2 jpayne@69: #define PyUnicode_4BYTE_KIND 4 jpayne@69: #define __Pyx_PyUnicode_READY(op) (0) jpayne@69: #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) jpayne@69: #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) jpayne@69: #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) jpayne@69: #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) jpayne@69: #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) jpayne@69: #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) jpayne@69: #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) jpayne@69: #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) jpayne@69: #endif jpayne@69: #if CYTHON_COMPILING_IN_PYPY jpayne@69: #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) jpayne@69: #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) jpayne@69: #else jpayne@69: #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) jpayne@69: #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ jpayne@69: PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) jpayne@69: #endif jpayne@69: #if CYTHON_COMPILING_IN_PYPY jpayne@69: #if !defined(PyUnicode_DecodeUnicodeEscape) jpayne@69: #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) jpayne@69: #endif jpayne@69: #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) jpayne@69: #undef PyUnicode_Contains jpayne@69: #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) jpayne@69: #endif jpayne@69: #if !defined(PyByteArray_Check) jpayne@69: #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) jpayne@69: #endif jpayne@69: #if !defined(PyObject_Format) jpayne@69: #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) jpayne@69: #endif jpayne@69: #endif jpayne@69: #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) jpayne@69: #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) jpayne@69: #else jpayne@69: #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) jpayne@69: #endif jpayne@69: #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) jpayne@69: #define PyObject_ASCII(o) PyObject_Repr(o) jpayne@69: #endif jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: #define PyBaseString_Type PyUnicode_Type jpayne@69: #define PyStringObject PyUnicodeObject jpayne@69: #define PyString_Type PyUnicode_Type jpayne@69: #define PyString_Check PyUnicode_Check jpayne@69: #define PyString_CheckExact PyUnicode_CheckExact jpayne@69: #ifndef PyObject_Unicode jpayne@69: #define PyObject_Unicode PyObject_Str jpayne@69: #endif jpayne@69: #endif jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) jpayne@69: #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) jpayne@69: #else jpayne@69: #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) jpayne@69: #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) jpayne@69: #endif jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON jpayne@69: #define __Pyx_PySequence_ListKeepNew(obj)\ jpayne@69: (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) jpayne@69: #else jpayne@69: #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) jpayne@69: #endif jpayne@69: #ifndef PySet_CheckExact jpayne@69: #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) jpayne@69: #endif jpayne@69: #if PY_VERSION_HEX >= 0x030900A4 jpayne@69: #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) jpayne@69: #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) jpayne@69: #else jpayne@69: #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) jpayne@69: #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) jpayne@69: #endif jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS jpayne@69: #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) jpayne@69: #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) jpayne@69: #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) jpayne@69: #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) jpayne@69: #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) jpayne@69: #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) jpayne@69: #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) jpayne@69: #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) jpayne@69: #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) jpayne@69: #else jpayne@69: #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) jpayne@69: #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) jpayne@69: #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) jpayne@69: #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) jpayne@69: #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) jpayne@69: #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) jpayne@69: #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) jpayne@69: #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) jpayne@69: #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) jpayne@69: #endif jpayne@69: #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 jpayne@69: #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) jpayne@69: #else jpayne@69: static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { jpayne@69: PyObject *module = PyImport_AddModule(name); jpayne@69: Py_XINCREF(module); jpayne@69: return module; jpayne@69: } jpayne@69: #endif jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: #define PyIntObject PyLongObject jpayne@69: #define PyInt_Type PyLong_Type jpayne@69: #define PyInt_Check(op) PyLong_Check(op) jpayne@69: #define PyInt_CheckExact(op) PyLong_CheckExact(op) jpayne@69: #define __Pyx_Py3Int_Check(op) PyLong_Check(op) jpayne@69: #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) jpayne@69: #define PyInt_FromString PyLong_FromString jpayne@69: #define PyInt_FromUnicode PyLong_FromUnicode jpayne@69: #define PyInt_FromLong PyLong_FromLong jpayne@69: #define PyInt_FromSize_t PyLong_FromSize_t jpayne@69: #define PyInt_FromSsize_t PyLong_FromSsize_t jpayne@69: #define PyInt_AsLong PyLong_AsLong jpayne@69: #define PyInt_AS_LONG PyLong_AS_LONG jpayne@69: #define PyInt_AsSsize_t PyLong_AsSsize_t jpayne@69: #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask jpayne@69: #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask jpayne@69: #define PyNumber_Int PyNumber_Long jpayne@69: #else jpayne@69: #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) jpayne@69: #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) jpayne@69: #endif jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: #define PyBoolObject PyLongObject jpayne@69: #endif jpayne@69: #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY jpayne@69: #ifndef PyUnicode_InternFromString jpayne@69: #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) jpayne@69: #endif jpayne@69: #endif jpayne@69: #if PY_VERSION_HEX < 0x030200A4 jpayne@69: typedef long Py_hash_t; jpayne@69: #define __Pyx_PyInt_FromHash_t PyInt_FromLong jpayne@69: #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t jpayne@69: #else jpayne@69: #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t jpayne@69: #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t jpayne@69: #endif jpayne@69: #if CYTHON_USE_ASYNC_SLOTS jpayne@69: #if PY_VERSION_HEX >= 0x030500B1 jpayne@69: #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods jpayne@69: #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) jpayne@69: #else jpayne@69: #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) jpayne@69: #endif jpayne@69: #else jpayne@69: #define __Pyx_PyType_AsAsync(obj) NULL jpayne@69: #endif jpayne@69: #ifndef __Pyx_PyAsyncMethodsStruct jpayne@69: typedef struct { jpayne@69: unaryfunc am_await; jpayne@69: unaryfunc am_aiter; jpayne@69: unaryfunc am_anext; jpayne@69: } __Pyx_PyAsyncMethodsStruct; jpayne@69: #endif jpayne@69: jpayne@69: #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) jpayne@69: #if !defined(_USE_MATH_DEFINES) jpayne@69: #define _USE_MATH_DEFINES jpayne@69: #endif jpayne@69: #endif jpayne@69: #include jpayne@69: #ifdef NAN jpayne@69: #define __PYX_NAN() ((float) NAN) jpayne@69: #else jpayne@69: static CYTHON_INLINE float __PYX_NAN() { jpayne@69: float value; jpayne@69: memset(&value, 0xFF, sizeof(value)); jpayne@69: return value; jpayne@69: } jpayne@69: #endif jpayne@69: #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) jpayne@69: #define __Pyx_truncl trunc jpayne@69: #else jpayne@69: #define __Pyx_truncl truncl jpayne@69: #endif jpayne@69: jpayne@69: #define __PYX_MARK_ERR_POS(f_index, lineno) \ jpayne@69: { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } jpayne@69: #define __PYX_ERR(f_index, lineno, Ln_error) \ jpayne@69: { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } jpayne@69: jpayne@69: #ifdef CYTHON_EXTERN_C jpayne@69: #undef __PYX_EXTERN_C jpayne@69: #define __PYX_EXTERN_C CYTHON_EXTERN_C jpayne@69: #elif defined(__PYX_EXTERN_C) jpayne@69: #ifdef _MSC_VER jpayne@69: #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") jpayne@69: #else jpayne@69: #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. jpayne@69: #endif jpayne@69: #else jpayne@69: #ifdef __cplusplus jpayne@69: #define __PYX_EXTERN_C extern "C" jpayne@69: #else jpayne@69: #define __PYX_EXTERN_C extern jpayne@69: #endif jpayne@69: #endif jpayne@69: jpayne@69: #define __PYX_HAVE__pysam__libcutils jpayne@69: #define __PYX_HAVE_API__pysam__libcutils jpayne@69: /* Early includes */ jpayne@69: #include jpayne@69: #include jpayne@69: #include jpayne@69: #include "pythread.h" jpayne@69: jpayne@69: #if CYTHON_COMPILING_IN_PYPY jpayne@69: #ifdef _MSC_VER jpayne@69: #pragma message ("This module uses CPython specific internals of 'array.array', which are not available in PyPy.") jpayne@69: #else jpayne@69: #warning This module uses CPython specific internals of 'array.array', which are not available in PyPy. jpayne@69: #endif jpayne@69: #endif jpayne@69: jpayne@69: #include jpayne@69: #include jpayne@69: #include jpayne@69: #include jpayne@69: #include jpayne@69: #include jpayne@69: #include "samtools.pysam.h" jpayne@69: #include "bcftools.pysam.h" jpayne@69: #ifdef _OPENMP jpayne@69: #include jpayne@69: #endif /* _OPENMP */ jpayne@69: jpayne@69: #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) jpayne@69: #define CYTHON_WITHOUT_ASSERTIONS jpayne@69: #endif jpayne@69: jpayne@69: typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; jpayne@69: const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; jpayne@69: jpayne@69: #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 jpayne@69: #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 jpayne@69: #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) jpayne@69: #define __PYX_DEFAULT_STRING_ENCODING "" jpayne@69: #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString jpayne@69: #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize jpayne@69: #define __Pyx_uchar_cast(c) ((unsigned char)c) jpayne@69: #define __Pyx_long_cast(x) ((long)x) jpayne@69: #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ jpayne@69: (sizeof(type) < sizeof(Py_ssize_t)) ||\ jpayne@69: (sizeof(type) > sizeof(Py_ssize_t) &&\ jpayne@69: likely(v < (type)PY_SSIZE_T_MAX ||\ jpayne@69: v == (type)PY_SSIZE_T_MAX) &&\ jpayne@69: (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ jpayne@69: v == (type)PY_SSIZE_T_MIN))) ||\ jpayne@69: (sizeof(type) == sizeof(Py_ssize_t) &&\ jpayne@69: (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ jpayne@69: v == (type)PY_SSIZE_T_MAX))) ) jpayne@69: static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { jpayne@69: return (size_t) i < (size_t) limit; jpayne@69: } jpayne@69: #if defined (__cplusplus) && __cplusplus >= 201103L jpayne@69: #include jpayne@69: #define __Pyx_sst_abs(value) std::abs(value) jpayne@69: #elif SIZEOF_INT >= SIZEOF_SIZE_T jpayne@69: #define __Pyx_sst_abs(value) abs(value) jpayne@69: #elif SIZEOF_LONG >= SIZEOF_SIZE_T jpayne@69: #define __Pyx_sst_abs(value) labs(value) jpayne@69: #elif defined (_MSC_VER) jpayne@69: #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) jpayne@69: #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L jpayne@69: #define __Pyx_sst_abs(value) llabs(value) jpayne@69: #elif defined (__GNUC__) jpayne@69: #define __Pyx_sst_abs(value) __builtin_llabs(value) jpayne@69: #else jpayne@69: #define __Pyx_sst_abs(value) ((value<0) ? -value : value) jpayne@69: #endif jpayne@69: static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); jpayne@69: static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); jpayne@69: static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); jpayne@69: static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); jpayne@69: #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) jpayne@69: #define __Pyx_PyBytes_FromString PyBytes_FromString jpayne@69: #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize jpayne@69: static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString jpayne@69: #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize jpayne@69: #else jpayne@69: #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString jpayne@69: #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize jpayne@69: #endif jpayne@69: #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) jpayne@69: #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) jpayne@69: #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) jpayne@69: #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) jpayne@69: #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) jpayne@69: #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) jpayne@69: #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) jpayne@69: #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) jpayne@69: #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) jpayne@69: #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) jpayne@69: #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) jpayne@69: #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) jpayne@69: #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) jpayne@69: #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) jpayne@69: #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) jpayne@69: #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) jpayne@69: #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) jpayne@69: #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode jpayne@69: #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) jpayne@69: #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) jpayne@69: static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); jpayne@69: static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); jpayne@69: static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); jpayne@69: static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); jpayne@69: #define __Pyx_PySequence_Tuple(obj)\ jpayne@69: (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) jpayne@69: static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); jpayne@69: static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); jpayne@69: static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS jpayne@69: #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) jpayne@69: #else jpayne@69: #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) jpayne@69: #endif jpayne@69: #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) jpayne@69: #else jpayne@69: #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) jpayne@69: #endif jpayne@69: #if CYTHON_USE_PYLONG_INTERNALS jpayne@69: #if PY_VERSION_HEX >= 0x030C00A7 jpayne@69: #ifndef _PyLong_SIGN_MASK jpayne@69: #define _PyLong_SIGN_MASK 3 jpayne@69: #endif jpayne@69: #ifndef _PyLong_NON_SIZE_BITS jpayne@69: #define _PyLong_NON_SIZE_BITS 3 jpayne@69: #endif jpayne@69: #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) jpayne@69: #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) jpayne@69: #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) jpayne@69: #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) jpayne@69: #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) jpayne@69: #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) jpayne@69: #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) jpayne@69: #define __Pyx_PyLong_SignedDigitCount(x)\ jpayne@69: ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) jpayne@69: #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) jpayne@69: #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) jpayne@69: #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) jpayne@69: #else jpayne@69: #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) jpayne@69: #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) jpayne@69: #endif jpayne@69: typedef Py_ssize_t __Pyx_compact_pylong; jpayne@69: typedef size_t __Pyx_compact_upylong; jpayne@69: #else jpayne@69: #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) jpayne@69: #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) jpayne@69: #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) jpayne@69: #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) jpayne@69: #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) jpayne@69: #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) jpayne@69: #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) jpayne@69: #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) jpayne@69: #define __Pyx_PyLong_CompactValue(x)\ jpayne@69: ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) jpayne@69: typedef sdigit __Pyx_compact_pylong; jpayne@69: typedef digit __Pyx_compact_upylong; jpayne@69: #endif jpayne@69: #if PY_VERSION_HEX >= 0x030C00A5 jpayne@69: #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) jpayne@69: #else jpayne@69: #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) jpayne@69: #endif jpayne@69: #endif jpayne@69: #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII jpayne@69: #include jpayne@69: static int __Pyx_sys_getdefaultencoding_not_ascii; jpayne@69: static int __Pyx_init_sys_getdefaultencoding_params(void) { jpayne@69: PyObject* sys; jpayne@69: PyObject* default_encoding = NULL; jpayne@69: PyObject* ascii_chars_u = NULL; jpayne@69: PyObject* ascii_chars_b = NULL; jpayne@69: const char* default_encoding_c; jpayne@69: sys = PyImport_ImportModule("sys"); jpayne@69: if (!sys) goto bad; jpayne@69: default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); jpayne@69: Py_DECREF(sys); jpayne@69: if (!default_encoding) goto bad; jpayne@69: default_encoding_c = PyBytes_AsString(default_encoding); jpayne@69: if (!default_encoding_c) goto bad; jpayne@69: if (strcmp(default_encoding_c, "ascii") == 0) { jpayne@69: __Pyx_sys_getdefaultencoding_not_ascii = 0; jpayne@69: } else { jpayne@69: char ascii_chars[128]; jpayne@69: int c; jpayne@69: for (c = 0; c < 128; c++) { jpayne@69: ascii_chars[c] = (char) c; jpayne@69: } jpayne@69: __Pyx_sys_getdefaultencoding_not_ascii = 1; jpayne@69: ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); jpayne@69: if (!ascii_chars_u) goto bad; jpayne@69: ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); jpayne@69: if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { jpayne@69: PyErr_Format( jpayne@69: PyExc_ValueError, jpayne@69: "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", jpayne@69: default_encoding_c); jpayne@69: goto bad; jpayne@69: } jpayne@69: Py_DECREF(ascii_chars_u); jpayne@69: Py_DECREF(ascii_chars_b); jpayne@69: } jpayne@69: Py_DECREF(default_encoding); jpayne@69: return 0; jpayne@69: bad: jpayne@69: Py_XDECREF(default_encoding); jpayne@69: Py_XDECREF(ascii_chars_u); jpayne@69: Py_XDECREF(ascii_chars_b); jpayne@69: return -1; jpayne@69: } jpayne@69: #endif jpayne@69: #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 jpayne@69: #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) jpayne@69: #else jpayne@69: #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) jpayne@69: #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT jpayne@69: #include jpayne@69: static char* __PYX_DEFAULT_STRING_ENCODING; jpayne@69: static int __Pyx_init_sys_getdefaultencoding_params(void) { jpayne@69: PyObject* sys; jpayne@69: PyObject* default_encoding = NULL; jpayne@69: char* default_encoding_c; jpayne@69: sys = PyImport_ImportModule("sys"); jpayne@69: if (!sys) goto bad; jpayne@69: default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); jpayne@69: Py_DECREF(sys); jpayne@69: if (!default_encoding) goto bad; jpayne@69: default_encoding_c = PyBytes_AsString(default_encoding); jpayne@69: if (!default_encoding_c) goto bad; jpayne@69: __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); jpayne@69: if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; jpayne@69: strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); jpayne@69: Py_DECREF(default_encoding); jpayne@69: return 0; jpayne@69: bad: jpayne@69: Py_XDECREF(default_encoding); jpayne@69: return -1; jpayne@69: } jpayne@69: #endif jpayne@69: #endif jpayne@69: jpayne@69: jpayne@69: /* Test for GCC > 2.95 */ jpayne@69: #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) jpayne@69: #define likely(x) __builtin_expect(!!(x), 1) jpayne@69: #define unlikely(x) __builtin_expect(!!(x), 0) jpayne@69: #else /* !__GNUC__ or GCC < 2.95 */ jpayne@69: #define likely(x) (x) jpayne@69: #define unlikely(x) (x) jpayne@69: #endif /* __GNUC__ */ jpayne@69: static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } jpayne@69: jpayne@69: #if !CYTHON_USE_MODULE_STATE jpayne@69: static PyObject *__pyx_m = NULL; jpayne@69: #endif jpayne@69: static int __pyx_lineno; jpayne@69: static int __pyx_clineno = 0; jpayne@69: static const char * __pyx_cfilenm = __FILE__; jpayne@69: static const char *__pyx_filename; jpayne@69: jpayne@69: /* #### Code section: filename_table ### */ jpayne@69: jpayne@69: static const char *__pyx_f[] = { jpayne@69: "pysam/libcutils.pyx", jpayne@69: "contextvars.pxd", jpayne@69: "array.pxd", jpayne@69: "type.pxd", jpayne@69: "bool.pxd", jpayne@69: "complex.pxd", jpayne@69: }; jpayne@69: /* #### Code section: utility_code_proto_before_types ### */ jpayne@69: /* ForceInitThreads.proto */ jpayne@69: #ifndef __PYX_FORCE_INIT_THREADS jpayne@69: #define __PYX_FORCE_INIT_THREADS 0 jpayne@69: #endif jpayne@69: jpayne@69: /* #### Code section: numeric_typedefs ### */ jpayne@69: /* #### Code section: complex_type_declarations ### */ jpayne@69: /* #### Code section: type_declarations ### */ jpayne@69: jpayne@69: /*--- Type declarations ---*/ jpayne@69: #ifndef _ARRAYARRAY_H jpayne@69: struct arrayobject; jpayne@69: typedef struct arrayobject arrayobject; jpayne@69: #endif jpayne@69: struct __pyx_opt_args_7cpython_11contextvars_get_value; jpayne@69: struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default; jpayne@69: jpayne@69: /* "cpython/contextvars.pxd":112 jpayne@69: * jpayne@69: * jpayne@69: * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< jpayne@69: * """Return a new reference to the value of the context variable, jpayne@69: * or the default value of the context variable, jpayne@69: */ jpayne@69: struct __pyx_opt_args_7cpython_11contextvars_get_value { jpayne@69: int __pyx_n; jpayne@69: PyObject *default_value; jpayne@69: }; jpayne@69: jpayne@69: /* "cpython/contextvars.pxd":129 jpayne@69: * jpayne@69: * jpayne@69: * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< jpayne@69: * """Return a new reference to the value of the context variable, jpayne@69: * or the provided default value if no such value was found. jpayne@69: */ jpayne@69: struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default { jpayne@69: int __pyx_n; jpayne@69: PyObject *default_value; jpayne@69: }; jpayne@69: struct __pyx_opt_args_5pysam_9libcutils_parse_region; jpayne@69: struct __pyx_opt_args_5pysam_9libcutils_qualitystring_to_array; jpayne@69: struct __pyx_opt_args_5pysam_9libcutils_array_to_qualitystring; jpayne@69: struct __pyx_opt_args_5pysam_9libcutils_qualities_to_qualitystring; jpayne@69: struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str; jpayne@69: struct __pyx_opt_args_5pysam_9libcutils_charptr_to_bytes; jpayne@69: struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str_w_len; jpayne@69: struct __pyx_opt_args_5pysam_9libcutils_force_str; jpayne@69: struct __pyx_opt_args_5pysam_9libcutils_force_bytes; jpayne@69: struct __pyx_opt_args_5pysam_9libcutils_decode_bytes; jpayne@69: jpayne@69: /* "pysam/libcutils.pxd":8 jpayne@69: * from cpython cimport array as c_array jpayne@69: * jpayne@69: * cpdef parse_region(contig=*, start=*, stop=*, region=*, reference=*, end=*) # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * cdef int libc_whence_from_io(int whence) jpayne@69: */ jpayne@69: struct __pyx_opt_args_5pysam_9libcutils_parse_region { jpayne@69: int __pyx_n; jpayne@69: PyObject *contig; jpayne@69: PyObject *start; jpayne@69: PyObject *stop; jpayne@69: PyObject *region; jpayne@69: PyObject *reference; jpayne@69: PyObject *end; jpayne@69: }; jpayne@69: jpayne@69: /* "pysam/libcutils.pxd":15 jpayne@69: * # Utility functions for quality string conversions jpayne@69: * jpayne@69: * cpdef c_array.array qualitystring_to_array(input_str, int offset=*) # <<<<<<<<<<<<<< jpayne@69: * cpdef array_to_qualitystring(c_array.array arr, int offset=*) jpayne@69: * cpdef qualities_to_qualitystring(qualities, int offset=*) jpayne@69: */ jpayne@69: struct __pyx_opt_args_5pysam_9libcutils_qualitystring_to_array { jpayne@69: int __pyx_n; jpayne@69: int offset; jpayne@69: }; jpayne@69: jpayne@69: /* "pysam/libcutils.pxd":16 jpayne@69: * jpayne@69: * cpdef c_array.array qualitystring_to_array(input_str, int offset=*) jpayne@69: * cpdef array_to_qualitystring(c_array.array arr, int offset=*) # <<<<<<<<<<<<<< jpayne@69: * cpdef qualities_to_qualitystring(qualities, int offset=*) jpayne@69: * jpayne@69: */ jpayne@69: struct __pyx_opt_args_5pysam_9libcutils_array_to_qualitystring { jpayne@69: int __pyx_n; jpayne@69: int offset; jpayne@69: }; jpayne@69: jpayne@69: /* "pysam/libcutils.pxd":17 jpayne@69: * cpdef c_array.array qualitystring_to_array(input_str, int offset=*) jpayne@69: * cpdef array_to_qualitystring(c_array.array arr, int offset=*) jpayne@69: * cpdef qualities_to_qualitystring(qualities, int offset=*) # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * ######################################################################## jpayne@69: */ jpayne@69: struct __pyx_opt_args_5pysam_9libcutils_qualities_to_qualitystring { jpayne@69: int __pyx_n; jpayne@69: int offset; jpayne@69: }; jpayne@69: jpayne@69: /* "pysam/libcutils.pxd":29 jpayne@69: * ## Python 3 compatibility functions jpayne@69: * ######################################################################## jpayne@69: * cdef charptr_to_str(const char *s, encoding=*, errors=*) # <<<<<<<<<<<<<< jpayne@69: * cdef bytes charptr_to_bytes(const char *s, encoding=*, errors=*) jpayne@69: * cdef charptr_to_str_w_len(const char* s, size_t n, encoding=*, errors=*) jpayne@69: */ jpayne@69: struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str { jpayne@69: int __pyx_n; jpayne@69: PyObject *encoding; jpayne@69: PyObject *errors; jpayne@69: }; jpayne@69: jpayne@69: /* "pysam/libcutils.pxd":30 jpayne@69: * ######################################################################## jpayne@69: * cdef charptr_to_str(const char *s, encoding=*, errors=*) jpayne@69: * cdef bytes charptr_to_bytes(const char *s, encoding=*, errors=*) # <<<<<<<<<<<<<< jpayne@69: * cdef charptr_to_str_w_len(const char* s, size_t n, encoding=*, errors=*) jpayne@69: * cdef force_str(object s, encoding=*, errors=*) jpayne@69: */ jpayne@69: struct __pyx_opt_args_5pysam_9libcutils_charptr_to_bytes { jpayne@69: int __pyx_n; jpayne@69: PyObject *encoding; jpayne@69: PyObject *errors; jpayne@69: }; jpayne@69: jpayne@69: /* "pysam/libcutils.pxd":31 jpayne@69: * cdef charptr_to_str(const char *s, encoding=*, errors=*) jpayne@69: * cdef bytes charptr_to_bytes(const char *s, encoding=*, errors=*) jpayne@69: * cdef charptr_to_str_w_len(const char* s, size_t n, encoding=*, errors=*) # <<<<<<<<<<<<<< jpayne@69: * cdef force_str(object s, encoding=*, errors=*) jpayne@69: * cdef bytes force_bytes(object s, encoding=*, errors=*) jpayne@69: */ jpayne@69: struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str_w_len { jpayne@69: int __pyx_n; jpayne@69: PyObject *encoding; jpayne@69: PyObject *errors; jpayne@69: }; jpayne@69: jpayne@69: /* "pysam/libcutils.pxd":32 jpayne@69: * cdef bytes charptr_to_bytes(const char *s, encoding=*, errors=*) jpayne@69: * cdef charptr_to_str_w_len(const char* s, size_t n, encoding=*, errors=*) jpayne@69: * cdef force_str(object s, encoding=*, errors=*) # <<<<<<<<<<<<<< jpayne@69: * cdef bytes force_bytes(object s, encoding=*, errors=*) jpayne@69: * cdef decode_bytes(bytes s, encoding=*, errors=*) jpayne@69: */ jpayne@69: struct __pyx_opt_args_5pysam_9libcutils_force_str { jpayne@69: int __pyx_n; jpayne@69: PyObject *encoding; jpayne@69: PyObject *errors; jpayne@69: }; jpayne@69: jpayne@69: /* "pysam/libcutils.pxd":33 jpayne@69: * cdef charptr_to_str_w_len(const char* s, size_t n, encoding=*, errors=*) jpayne@69: * cdef force_str(object s, encoding=*, errors=*) jpayne@69: * cdef bytes force_bytes(object s, encoding=*, errors=*) # <<<<<<<<<<<<<< jpayne@69: * cdef decode_bytes(bytes s, encoding=*, errors=*) jpayne@69: * cdef bytes encode_filename(object filename) jpayne@69: */ jpayne@69: struct __pyx_opt_args_5pysam_9libcutils_force_bytes { jpayne@69: int __pyx_n; jpayne@69: PyObject *encoding; jpayne@69: PyObject *errors; jpayne@69: }; jpayne@69: jpayne@69: /* "pysam/libcutils.pxd":34 jpayne@69: * cdef force_str(object s, encoding=*, errors=*) jpayne@69: * cdef bytes force_bytes(object s, encoding=*, errors=*) jpayne@69: * cdef decode_bytes(bytes s, encoding=*, errors=*) # <<<<<<<<<<<<<< jpayne@69: * cdef bytes encode_filename(object filename) jpayne@69: * cdef from_string_and_size(const char *s, size_t length) jpayne@69: */ jpayne@69: struct __pyx_opt_args_5pysam_9libcutils_decode_bytes { jpayne@69: int __pyx_n; jpayne@69: PyObject *encoding; jpayne@69: PyObject *errors; jpayne@69: }; jpayne@69: /* #### Code section: utility_code_proto ### */ jpayne@69: jpayne@69: /* --- Runtime support code (head) --- */ jpayne@69: /* Refnanny.proto */ jpayne@69: #ifndef CYTHON_REFNANNY jpayne@69: #define CYTHON_REFNANNY 0 jpayne@69: #endif jpayne@69: #if CYTHON_REFNANNY jpayne@69: typedef struct { jpayne@69: void (*INCREF)(void*, PyObject*, Py_ssize_t); jpayne@69: void (*DECREF)(void*, PyObject*, Py_ssize_t); jpayne@69: void (*GOTREF)(void*, PyObject*, Py_ssize_t); jpayne@69: void (*GIVEREF)(void*, PyObject*, Py_ssize_t); jpayne@69: void* (*SetupContext)(const char*, Py_ssize_t, const char*); jpayne@69: void (*FinishContext)(void**); jpayne@69: } __Pyx_RefNannyAPIStruct; jpayne@69: static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; jpayne@69: static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); jpayne@69: #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; jpayne@69: #ifdef WITH_THREAD jpayne@69: #define __Pyx_RefNannySetupContext(name, acquire_gil)\ jpayne@69: if (acquire_gil) {\ jpayne@69: PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ jpayne@69: __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ jpayne@69: PyGILState_Release(__pyx_gilstate_save);\ jpayne@69: } else {\ jpayne@69: __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ jpayne@69: } jpayne@69: #define __Pyx_RefNannyFinishContextNogil() {\ jpayne@69: PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ jpayne@69: __Pyx_RefNannyFinishContext();\ jpayne@69: PyGILState_Release(__pyx_gilstate_save);\ jpayne@69: } jpayne@69: #else jpayne@69: #define __Pyx_RefNannySetupContext(name, acquire_gil)\ jpayne@69: __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) jpayne@69: #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() jpayne@69: #endif jpayne@69: #define __Pyx_RefNannyFinishContextNogil() {\ jpayne@69: PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ jpayne@69: __Pyx_RefNannyFinishContext();\ jpayne@69: PyGILState_Release(__pyx_gilstate_save);\ jpayne@69: } jpayne@69: #define __Pyx_RefNannyFinishContext()\ jpayne@69: __Pyx_RefNanny->FinishContext(&__pyx_refnanny) jpayne@69: #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) jpayne@69: #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) jpayne@69: #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) jpayne@69: #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) jpayne@69: #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) jpayne@69: #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) jpayne@69: #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) jpayne@69: #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) jpayne@69: #else jpayne@69: #define __Pyx_RefNannyDeclarations jpayne@69: #define __Pyx_RefNannySetupContext(name, acquire_gil) jpayne@69: #define __Pyx_RefNannyFinishContextNogil() jpayne@69: #define __Pyx_RefNannyFinishContext() jpayne@69: #define __Pyx_INCREF(r) Py_INCREF(r) jpayne@69: #define __Pyx_DECREF(r) Py_DECREF(r) jpayne@69: #define __Pyx_GOTREF(r) jpayne@69: #define __Pyx_GIVEREF(r) jpayne@69: #define __Pyx_XINCREF(r) Py_XINCREF(r) jpayne@69: #define __Pyx_XDECREF(r) Py_XDECREF(r) jpayne@69: #define __Pyx_XGOTREF(r) jpayne@69: #define __Pyx_XGIVEREF(r) jpayne@69: #endif jpayne@69: #define __Pyx_Py_XDECREF_SET(r, v) do {\ jpayne@69: PyObject *tmp = (PyObject *) r;\ jpayne@69: r = v; Py_XDECREF(tmp);\ jpayne@69: } while (0) jpayne@69: #define __Pyx_XDECREF_SET(r, v) do {\ jpayne@69: PyObject *tmp = (PyObject *) r;\ jpayne@69: r = v; __Pyx_XDECREF(tmp);\ jpayne@69: } while (0) jpayne@69: #define __Pyx_DECREF_SET(r, v) do {\ jpayne@69: PyObject *tmp = (PyObject *) r;\ jpayne@69: r = v; __Pyx_DECREF(tmp);\ jpayne@69: } while (0) jpayne@69: #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) jpayne@69: #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) jpayne@69: jpayne@69: /* PyErrExceptionMatches.proto */ jpayne@69: #if CYTHON_FAST_THREAD_STATE jpayne@69: #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) jpayne@69: static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); jpayne@69: #else jpayne@69: #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) jpayne@69: #endif jpayne@69: jpayne@69: /* PyThreadStateGet.proto */ jpayne@69: #if CYTHON_FAST_THREAD_STATE jpayne@69: #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; jpayne@69: #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; jpayne@69: #if PY_VERSION_HEX >= 0x030C00A6 jpayne@69: #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) jpayne@69: #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) jpayne@69: #else jpayne@69: #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) jpayne@69: #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) jpayne@69: #endif jpayne@69: #else jpayne@69: #define __Pyx_PyThreadState_declare jpayne@69: #define __Pyx_PyThreadState_assign jpayne@69: #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) jpayne@69: #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() jpayne@69: #endif jpayne@69: jpayne@69: /* PyErrFetchRestore.proto */ jpayne@69: #if CYTHON_FAST_THREAD_STATE jpayne@69: #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) jpayne@69: #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) jpayne@69: #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) jpayne@69: #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) jpayne@69: #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) jpayne@69: static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); jpayne@69: static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 jpayne@69: #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) jpayne@69: #else jpayne@69: #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) jpayne@69: #endif jpayne@69: #else jpayne@69: #define __Pyx_PyErr_Clear() PyErr_Clear() jpayne@69: #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) jpayne@69: #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) jpayne@69: #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) jpayne@69: #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) jpayne@69: #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) jpayne@69: #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) jpayne@69: #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) jpayne@69: #endif jpayne@69: jpayne@69: /* PyObjectGetAttrStr.proto */ jpayne@69: #if CYTHON_USE_TYPE_SLOTS jpayne@69: static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); jpayne@69: #else jpayne@69: #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) jpayne@69: #endif jpayne@69: jpayne@69: /* PyObjectGetAttrStrNoError.proto */ jpayne@69: static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); jpayne@69: jpayne@69: /* GetBuiltinName.proto */ jpayne@69: static PyObject *__Pyx_GetBuiltinName(PyObject *name); jpayne@69: jpayne@69: /* TupleAndListFromArray.proto */ jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON jpayne@69: static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); jpayne@69: static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); jpayne@69: #endif jpayne@69: jpayne@69: /* IncludeStringH.proto */ jpayne@69: #include jpayne@69: jpayne@69: /* BytesEquals.proto */ jpayne@69: static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); jpayne@69: jpayne@69: /* UnicodeEquals.proto */ jpayne@69: static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); jpayne@69: jpayne@69: /* fastcall.proto */ jpayne@69: #if CYTHON_AVOID_BORROWED_REFS jpayne@69: #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) jpayne@69: #elif CYTHON_ASSUME_SAFE_MACROS jpayne@69: #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) jpayne@69: #else jpayne@69: #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) jpayne@69: #endif jpayne@69: #if CYTHON_AVOID_BORROWED_REFS jpayne@69: #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) jpayne@69: #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) jpayne@69: #else jpayne@69: #define __Pyx_Arg_NewRef_VARARGS(arg) arg jpayne@69: #define __Pyx_Arg_XDECREF_VARARGS(arg) jpayne@69: #endif jpayne@69: #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) jpayne@69: #define __Pyx_KwValues_VARARGS(args, nargs) NULL jpayne@69: #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) jpayne@69: #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: #define __Pyx_Arg_FASTCALL(args, i) args[i] jpayne@69: #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) jpayne@69: #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) jpayne@69: static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 jpayne@69: CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); jpayne@69: #else jpayne@69: #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) jpayne@69: #endif jpayne@69: #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs jpayne@69: to have the same reference counting */ jpayne@69: #define __Pyx_Arg_XDECREF_FASTCALL(arg) jpayne@69: #else jpayne@69: #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS jpayne@69: #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS jpayne@69: #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS jpayne@69: #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS jpayne@69: #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS jpayne@69: #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) jpayne@69: #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) jpayne@69: #endif jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS jpayne@69: #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) jpayne@69: #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) jpayne@69: #else jpayne@69: #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) jpayne@69: #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) jpayne@69: #endif jpayne@69: jpayne@69: /* ListCompAppend.proto */ jpayne@69: #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS jpayne@69: static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { jpayne@69: PyListObject* L = (PyListObject*) list; jpayne@69: Py_ssize_t len = Py_SIZE(list); jpayne@69: if (likely(L->allocated > len)) { jpayne@69: Py_INCREF(x); jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 jpayne@69: L->ob_item[len] = x; jpayne@69: #else jpayne@69: PyList_SET_ITEM(list, len, x); jpayne@69: #endif jpayne@69: __Pyx_SET_SIZE(list, len + 1); jpayne@69: return 0; jpayne@69: } jpayne@69: return PyList_Append(list, x); jpayne@69: } jpayne@69: #else jpayne@69: #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) jpayne@69: #endif jpayne@69: jpayne@69: /* PyObjectCall.proto */ jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON jpayne@69: static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); jpayne@69: #else jpayne@69: #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) jpayne@69: #endif jpayne@69: jpayne@69: /* RaiseDoubleKeywords.proto */ jpayne@69: static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); jpayne@69: jpayne@69: /* ParseKeywords.proto */ jpayne@69: static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, jpayne@69: PyObject **argnames[], jpayne@69: PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, jpayne@69: const char* function_name); jpayne@69: jpayne@69: /* RaiseArgTupleInvalid.proto */ jpayne@69: static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, jpayne@69: Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); jpayne@69: jpayne@69: /* GetItemInt.proto */ jpayne@69: #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ jpayne@69: (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ jpayne@69: __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ jpayne@69: (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ jpayne@69: __Pyx_GetItemInt_Generic(o, to_py_func(i)))) jpayne@69: #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ jpayne@69: (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ jpayne@69: __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ jpayne@69: (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) jpayne@69: static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, jpayne@69: int wraparound, int boundscheck); jpayne@69: #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ jpayne@69: (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ jpayne@69: __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ jpayne@69: (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) jpayne@69: static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, jpayne@69: int wraparound, int boundscheck); jpayne@69: static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); jpayne@69: static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, jpayne@69: int is_list, int wraparound, int boundscheck); jpayne@69: jpayne@69: /* SetItemInt.proto */ jpayne@69: #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ jpayne@69: (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ jpayne@69: __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\ jpayne@69: (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\ jpayne@69: __Pyx_SetItemInt_Generic(o, to_py_func(i), v))) jpayne@69: static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v); jpayne@69: static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, jpayne@69: int is_list, int wraparound, int boundscheck); jpayne@69: jpayne@69: /* PyFunctionFastCall.proto */ jpayne@69: #if CYTHON_FAST_PYCALL jpayne@69: #if !CYTHON_VECTORCALL jpayne@69: #define __Pyx_PyFunction_FastCall(func, args, nargs)\ jpayne@69: __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) jpayne@69: static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); jpayne@69: #endif jpayne@69: #define __Pyx_BUILD_ASSERT_EXPR(cond)\ jpayne@69: (sizeof(char [1 - 2*!(cond)]) - 1) jpayne@69: #ifndef Py_MEMBER_SIZE jpayne@69: #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) jpayne@69: #endif jpayne@69: #if !CYTHON_VECTORCALL jpayne@69: #if PY_VERSION_HEX >= 0x03080000 jpayne@69: #include "frameobject.h" jpayne@69: #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API jpayne@69: #ifndef Py_BUILD_CORE jpayne@69: #define Py_BUILD_CORE 1 jpayne@69: #endif jpayne@69: #include "internal/pycore_frame.h" jpayne@69: #endif jpayne@69: #define __Pxy_PyFrame_Initialize_Offsets() jpayne@69: #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) jpayne@69: #else jpayne@69: static size_t __pyx_pyframe_localsplus_offset = 0; jpayne@69: #include "frameobject.h" jpayne@69: #define __Pxy_PyFrame_Initialize_Offsets()\ jpayne@69: ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ jpayne@69: (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) jpayne@69: #define __Pyx_PyFrame_GetLocalsplus(frame)\ jpayne@69: (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) jpayne@69: #endif jpayne@69: #endif jpayne@69: #endif jpayne@69: jpayne@69: /* PyObjectCallMethO.proto */ jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON jpayne@69: static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); jpayne@69: #endif jpayne@69: jpayne@69: /* PyObjectFastCall.proto */ jpayne@69: #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) jpayne@69: static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); jpayne@69: jpayne@69: /* ArgTypeTest.proto */ jpayne@69: #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ jpayne@69: ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ jpayne@69: __Pyx__ArgTypeTest(obj, type, name, exact)) jpayne@69: static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); jpayne@69: jpayne@69: /* ExtTypeTest.proto */ jpayne@69: static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); jpayne@69: jpayne@69: /* PyObjectCallOneArg.proto */ jpayne@69: static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); jpayne@69: jpayne@69: /* ObjectGetItem.proto */ jpayne@69: #if CYTHON_USE_TYPE_SLOTS jpayne@69: static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); jpayne@69: #else jpayne@69: #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) jpayne@69: #endif jpayne@69: jpayne@69: /* RaiseUnexpectedTypeError.proto */ jpayne@69: static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); jpayne@69: jpayne@69: /* PyDictVersioning.proto */ jpayne@69: #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS jpayne@69: #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) jpayne@69: #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) jpayne@69: #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ jpayne@69: (version_var) = __PYX_GET_DICT_VERSION(dict);\ jpayne@69: (cache_var) = (value); jpayne@69: #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ jpayne@69: static PY_UINT64_T __pyx_dict_version = 0;\ jpayne@69: static PyObject *__pyx_dict_cached_value = NULL;\ jpayne@69: if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ jpayne@69: (VAR) = __pyx_dict_cached_value;\ jpayne@69: } else {\ jpayne@69: (VAR) = __pyx_dict_cached_value = (LOOKUP);\ jpayne@69: __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ jpayne@69: }\ jpayne@69: } jpayne@69: static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); jpayne@69: static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); jpayne@69: static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); jpayne@69: #else jpayne@69: #define __PYX_GET_DICT_VERSION(dict) (0) jpayne@69: #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) jpayne@69: #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); jpayne@69: #endif jpayne@69: jpayne@69: /* GetModuleGlobalName.proto */ jpayne@69: #if CYTHON_USE_DICT_VERSIONS jpayne@69: #define __Pyx_GetModuleGlobalName(var, name) do {\ jpayne@69: static PY_UINT64_T __pyx_dict_version = 0;\ jpayne@69: static PyObject *__pyx_dict_cached_value = NULL;\ jpayne@69: (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ jpayne@69: (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ jpayne@69: __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ jpayne@69: } while(0) jpayne@69: #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ jpayne@69: PY_UINT64_T __pyx_dict_version;\ jpayne@69: PyObject *__pyx_dict_cached_value;\ jpayne@69: (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ jpayne@69: } while(0) jpayne@69: static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); jpayne@69: #else jpayne@69: #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) jpayne@69: #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) jpayne@69: static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); jpayne@69: #endif jpayne@69: jpayne@69: /* RaiseException.proto */ jpayne@69: static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); jpayne@69: jpayne@69: /* GetTopmostException.proto */ jpayne@69: #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE jpayne@69: static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); jpayne@69: #endif jpayne@69: jpayne@69: /* SaveResetException.proto */ jpayne@69: #if CYTHON_FAST_THREAD_STATE jpayne@69: #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) jpayne@69: static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); jpayne@69: #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) jpayne@69: static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); jpayne@69: #else jpayne@69: #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) jpayne@69: #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) jpayne@69: #endif jpayne@69: jpayne@69: /* GetException.proto */ jpayne@69: #if CYTHON_FAST_THREAD_STATE jpayne@69: #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) jpayne@69: static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); jpayne@69: #else jpayne@69: static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); jpayne@69: #endif jpayne@69: jpayne@69: /* PySequenceContains.proto */ jpayne@69: static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { jpayne@69: int result = PySequence_Contains(seq, item); jpayne@69: return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); jpayne@69: } jpayne@69: jpayne@69: /* RaiseTooManyValuesToUnpack.proto */ jpayne@69: static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); jpayne@69: jpayne@69: /* RaiseNeedMoreValuesToUnpack.proto */ jpayne@69: static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); jpayne@69: jpayne@69: /* IterFinish.proto */ jpayne@69: static CYTHON_INLINE int __Pyx_IterFinish(void); jpayne@69: jpayne@69: /* UnpackItemEndCheck.proto */ jpayne@69: static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); jpayne@69: jpayne@69: /* PyIntBinop.proto */ jpayne@69: #if !CYTHON_COMPILING_IN_PYPY jpayne@69: static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); jpayne@69: #else jpayne@69: #define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\ jpayne@69: (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2)) jpayne@69: #endif jpayne@69: jpayne@69: /* PyObjectLookupSpecial.proto */ jpayne@69: #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS jpayne@69: #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) jpayne@69: #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) jpayne@69: static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); jpayne@69: #else jpayne@69: #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) jpayne@69: #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) jpayne@69: #endif jpayne@69: jpayne@69: /* SwapException.proto */ jpayne@69: #if CYTHON_FAST_THREAD_STATE jpayne@69: #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) jpayne@69: static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); jpayne@69: #else jpayne@69: static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); jpayne@69: #endif jpayne@69: jpayne@69: /* PyIntCompare.proto */ jpayne@69: static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); jpayne@69: jpayne@69: /* DictGetItem.proto */ jpayne@69: #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY jpayne@69: static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); jpayne@69: #define __Pyx_PyObject_Dict_GetItem(obj, name)\ jpayne@69: (likely(PyDict_CheckExact(obj)) ?\ jpayne@69: __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) jpayne@69: #else jpayne@69: #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) jpayne@69: #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) jpayne@69: #endif jpayne@69: jpayne@69: /* IncludeStructmemberH.proto */ jpayne@69: #include jpayne@69: jpayne@69: /* FixUpExtensionType.proto */ jpayne@69: #if CYTHON_USE_TYPE_SPECS jpayne@69: static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); jpayne@69: #endif jpayne@69: jpayne@69: /* FetchSharedCythonModule.proto */ jpayne@69: static PyObject *__Pyx_FetchSharedCythonABIModule(void); jpayne@69: jpayne@69: /* FetchCommonType.proto */ jpayne@69: #if !CYTHON_USE_TYPE_SPECS jpayne@69: static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); jpayne@69: #else jpayne@69: static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); jpayne@69: #endif jpayne@69: jpayne@69: /* PyMethodNew.proto */ jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { jpayne@69: PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; jpayne@69: CYTHON_UNUSED_VAR(typ); jpayne@69: if (!self) jpayne@69: return __Pyx_NewRef(func); jpayne@69: typesModule = PyImport_ImportModule("types"); jpayne@69: if (!typesModule) return NULL; jpayne@69: methodType = PyObject_GetAttrString(typesModule, "MethodType"); jpayne@69: Py_DECREF(typesModule); jpayne@69: if (!methodType) return NULL; jpayne@69: result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); jpayne@69: Py_DECREF(methodType); jpayne@69: return result; jpayne@69: } jpayne@69: #elif PY_MAJOR_VERSION >= 3 jpayne@69: static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { jpayne@69: CYTHON_UNUSED_VAR(typ); jpayne@69: if (!self) jpayne@69: return __Pyx_NewRef(func); jpayne@69: return PyMethod_New(func, self); jpayne@69: } jpayne@69: #else jpayne@69: #define __Pyx_PyMethod_New PyMethod_New jpayne@69: #endif jpayne@69: jpayne@69: /* PyVectorcallFastCallDict.proto */ jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); jpayne@69: #endif jpayne@69: jpayne@69: /* CythonFunctionShared.proto */ jpayne@69: #define __Pyx_CyFunction_USED jpayne@69: #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 jpayne@69: #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 jpayne@69: #define __Pyx_CYFUNCTION_CCLASS 0x04 jpayne@69: #define __Pyx_CYFUNCTION_COROUTINE 0x08 jpayne@69: #define __Pyx_CyFunction_GetClosure(f)\ jpayne@69: (((__pyx_CyFunctionObject *) (f))->func_closure) jpayne@69: #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API jpayne@69: #define __Pyx_CyFunction_GetClassObj(f)\ jpayne@69: (((__pyx_CyFunctionObject *) (f))->func_classobj) jpayne@69: #else jpayne@69: #define __Pyx_CyFunction_GetClassObj(f)\ jpayne@69: ((PyObject*) ((PyCMethodObject *) (f))->mm_class) jpayne@69: #endif jpayne@69: #define __Pyx_CyFunction_SetClassObj(f, classobj)\ jpayne@69: __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) jpayne@69: #define __Pyx_CyFunction_Defaults(type, f)\ jpayne@69: ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) jpayne@69: #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ jpayne@69: ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) jpayne@69: typedef struct { jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: PyObject_HEAD jpayne@69: PyObject *func; jpayne@69: #elif PY_VERSION_HEX < 0x030900B1 jpayne@69: PyCFunctionObject func; jpayne@69: #else jpayne@69: PyCMethodObject func; jpayne@69: #endif jpayne@69: #if CYTHON_BACKPORT_VECTORCALL jpayne@69: __pyx_vectorcallfunc func_vectorcall; jpayne@69: #endif jpayne@69: #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API jpayne@69: PyObject *func_weakreflist; jpayne@69: #endif jpayne@69: PyObject *func_dict; jpayne@69: PyObject *func_name; jpayne@69: PyObject *func_qualname; jpayne@69: PyObject *func_doc; jpayne@69: PyObject *func_globals; jpayne@69: PyObject *func_code; jpayne@69: PyObject *func_closure; jpayne@69: #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API jpayne@69: PyObject *func_classobj; jpayne@69: #endif jpayne@69: void *defaults; jpayne@69: int defaults_pyobjects; jpayne@69: size_t defaults_size; jpayne@69: int flags; jpayne@69: PyObject *defaults_tuple; jpayne@69: PyObject *defaults_kwdict; jpayne@69: PyObject *(*defaults_getter)(PyObject *); jpayne@69: PyObject *func_annotations; jpayne@69: PyObject *func_is_coroutine; jpayne@69: } __pyx_CyFunctionObject; jpayne@69: #undef __Pyx_CyOrPyCFunction_Check jpayne@69: #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) jpayne@69: #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) jpayne@69: #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) jpayne@69: static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); jpayne@69: #undef __Pyx_IsSameCFunction jpayne@69: #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) jpayne@69: static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, jpayne@69: int flags, PyObject* qualname, jpayne@69: PyObject *closure, jpayne@69: PyObject *module, PyObject *globals, jpayne@69: PyObject* code); jpayne@69: static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); jpayne@69: static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, jpayne@69: size_t size, jpayne@69: int pyobjects); jpayne@69: static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, jpayne@69: PyObject *tuple); jpayne@69: static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, jpayne@69: PyObject *dict); jpayne@69: static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, jpayne@69: PyObject *dict); jpayne@69: static int __pyx_CyFunction_init(PyObject *module); jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); jpayne@69: static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); jpayne@69: static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); jpayne@69: static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); jpayne@69: #if CYTHON_BACKPORT_VECTORCALL jpayne@69: #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) jpayne@69: #else jpayne@69: #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) jpayne@69: #endif jpayne@69: #endif jpayne@69: jpayne@69: /* CythonFunction.proto */ jpayne@69: static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, jpayne@69: int flags, PyObject* qualname, jpayne@69: PyObject *closure, jpayne@69: PyObject *module, PyObject *globals, jpayne@69: PyObject* code); jpayne@69: jpayne@69: /* RaiseUnboundLocalError.proto */ jpayne@69: static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); jpayne@69: jpayne@69: /* TypeImport.proto */ jpayne@69: #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_11 jpayne@69: #define __PYX_HAVE_RT_ImportType_proto_3_0_11 jpayne@69: #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L jpayne@69: #include jpayne@69: #endif jpayne@69: #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L jpayne@69: #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) alignof(s) jpayne@69: #else jpayne@69: #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) sizeof(void*) jpayne@69: #endif jpayne@69: enum __Pyx_ImportType_CheckSize_3_0_11 { jpayne@69: __Pyx_ImportType_CheckSize_Error_3_0_11 = 0, jpayne@69: __Pyx_ImportType_CheckSize_Warn_3_0_11 = 1, jpayne@69: __Pyx_ImportType_CheckSize_Ignore_3_0_11 = 2 jpayne@69: }; jpayne@69: static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size); jpayne@69: #endif jpayne@69: jpayne@69: /* Import.proto */ jpayne@69: static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); jpayne@69: jpayne@69: /* ImportDottedModule.proto */ jpayne@69: static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); jpayne@69: #endif jpayne@69: jpayne@69: /* ImportFrom.proto */ jpayne@69: static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); jpayne@69: jpayne@69: /* PyObjectCallNoArg.proto */ jpayne@69: static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); jpayne@69: jpayne@69: /* CLineInTraceback.proto */ jpayne@69: #ifdef CYTHON_CLINE_IN_TRACEBACK jpayne@69: #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) jpayne@69: #else jpayne@69: static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); jpayne@69: #endif jpayne@69: jpayne@69: /* CodeObjectCache.proto */ jpayne@69: #if !CYTHON_COMPILING_IN_LIMITED_API jpayne@69: typedef struct { jpayne@69: PyCodeObject* code_object; jpayne@69: int code_line; jpayne@69: } __Pyx_CodeObjectCacheEntry; jpayne@69: struct __Pyx_CodeObjectCache { jpayne@69: int count; jpayne@69: int max_count; jpayne@69: __Pyx_CodeObjectCacheEntry* entries; jpayne@69: }; jpayne@69: static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; jpayne@69: static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); jpayne@69: static PyCodeObject *__pyx_find_code_object(int code_line); jpayne@69: static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); jpayne@69: #endif jpayne@69: jpayne@69: /* AddTraceback.proto */ jpayne@69: static void __Pyx_AddTraceback(const char *funcname, int c_line, jpayne@69: int py_line, const char *filename); jpayne@69: jpayne@69: /* ArrayAPI.proto */ jpayne@69: #ifndef _ARRAYARRAY_H jpayne@69: #define _ARRAYARRAY_H jpayne@69: typedef struct arraydescr { jpayne@69: int typecode; jpayne@69: int itemsize; jpayne@69: PyObject * (*getitem)(struct arrayobject *, Py_ssize_t); jpayne@69: int (*setitem)(struct arrayobject *, Py_ssize_t, PyObject *); jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: char *formats; jpayne@69: #endif jpayne@69: } arraydescr; jpayne@69: struct arrayobject { jpayne@69: PyObject_HEAD jpayne@69: Py_ssize_t ob_size; jpayne@69: union { jpayne@69: char *ob_item; jpayne@69: float *as_floats; jpayne@69: double *as_doubles; jpayne@69: int *as_ints; jpayne@69: unsigned int *as_uints; jpayne@69: unsigned char *as_uchars; jpayne@69: signed char *as_schars; jpayne@69: char *as_chars; jpayne@69: unsigned long *as_ulongs; jpayne@69: long *as_longs; jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: unsigned long long *as_ulonglongs; jpayne@69: long long *as_longlongs; jpayne@69: #endif jpayne@69: short *as_shorts; jpayne@69: unsigned short *as_ushorts; jpayne@69: Py_UNICODE *as_pyunicodes; jpayne@69: void *as_voidptr; jpayne@69: } data; jpayne@69: Py_ssize_t allocated; jpayne@69: struct arraydescr *ob_descr; jpayne@69: PyObject *weakreflist; jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: int ob_exports; jpayne@69: #endif jpayne@69: }; jpayne@69: #ifndef NO_NEWARRAY_INLINE jpayne@69: static CYTHON_INLINE PyObject * newarrayobject(PyTypeObject *type, Py_ssize_t size, jpayne@69: struct arraydescr *descr) { jpayne@69: arrayobject *op; jpayne@69: size_t nbytes; jpayne@69: if (size < 0) { jpayne@69: PyErr_BadInternalCall(); jpayne@69: return NULL; jpayne@69: } jpayne@69: nbytes = size * descr->itemsize; jpayne@69: if (nbytes / descr->itemsize != (size_t)size) { jpayne@69: return PyErr_NoMemory(); jpayne@69: } jpayne@69: op = (arrayobject *) type->tp_alloc(type, 0); jpayne@69: if (op == NULL) { jpayne@69: return NULL; jpayne@69: } jpayne@69: op->ob_descr = descr; jpayne@69: op->allocated = size; jpayne@69: op->weakreflist = NULL; jpayne@69: __Pyx_SET_SIZE(op, size); jpayne@69: if (size <= 0) { jpayne@69: op->data.ob_item = NULL; jpayne@69: } jpayne@69: else { jpayne@69: op->data.ob_item = PyMem_NEW(char, nbytes); jpayne@69: if (op->data.ob_item == NULL) { jpayne@69: Py_DECREF(op); jpayne@69: return PyErr_NoMemory(); jpayne@69: } jpayne@69: } jpayne@69: return (PyObject *) op; jpayne@69: } jpayne@69: #else jpayne@69: PyObject* newarrayobject(PyTypeObject *type, Py_ssize_t size, jpayne@69: struct arraydescr *descr); jpayne@69: #endif jpayne@69: static CYTHON_INLINE int resize(arrayobject *self, Py_ssize_t n) { jpayne@69: void *items = (void*) self->data.ob_item; jpayne@69: PyMem_Resize(items, char, (size_t)(n * self->ob_descr->itemsize)); jpayne@69: if (items == NULL) { jpayne@69: PyErr_NoMemory(); jpayne@69: return -1; jpayne@69: } jpayne@69: self->data.ob_item = (char*) items; jpayne@69: __Pyx_SET_SIZE(self, n); jpayne@69: self->allocated = n; jpayne@69: return 0; jpayne@69: } jpayne@69: static CYTHON_INLINE int resize_smart(arrayobject *self, Py_ssize_t n) { jpayne@69: void *items = (void*) self->data.ob_item; jpayne@69: Py_ssize_t newsize; jpayne@69: if (n < self->allocated && n*4 > self->allocated) { jpayne@69: __Pyx_SET_SIZE(self, n); jpayne@69: return 0; jpayne@69: } jpayne@69: newsize = n + (n / 2) + 1; jpayne@69: if (newsize <= n) { jpayne@69: PyErr_NoMemory(); jpayne@69: return -1; jpayne@69: } jpayne@69: PyMem_Resize(items, char, (size_t)(newsize * self->ob_descr->itemsize)); jpayne@69: if (items == NULL) { jpayne@69: PyErr_NoMemory(); jpayne@69: return -1; jpayne@69: } jpayne@69: self->data.ob_item = (char*) items; jpayne@69: __Pyx_SET_SIZE(self, n); jpayne@69: self->allocated = newsize; jpayne@69: return 0; jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: /* GCCDiagnostics.proto */ jpayne@69: #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) jpayne@69: #define __Pyx_HAS_GCC_DIAGNOSTIC jpayne@69: #endif jpayne@69: jpayne@69: /* CIntFromPy.proto */ jpayne@69: static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); jpayne@69: jpayne@69: /* CIntFromPy.proto */ jpayne@69: static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); jpayne@69: jpayne@69: /* CIntToPy.proto */ jpayne@69: static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); jpayne@69: jpayne@69: /* CIntFromPy.proto */ jpayne@69: static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *); jpayne@69: jpayne@69: /* CIntToPy.proto */ jpayne@69: static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); jpayne@69: jpayne@69: /* CIntToPy.proto */ jpayne@69: static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value); jpayne@69: jpayne@69: /* FormatTypeName.proto */ jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: typedef PyObject *__Pyx_TypeName; jpayne@69: #define __Pyx_FMT_TYPENAME "%U" jpayne@69: static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); jpayne@69: #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) jpayne@69: #else jpayne@69: typedef const char *__Pyx_TypeName; jpayne@69: #define __Pyx_FMT_TYPENAME "%.200s" jpayne@69: #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) jpayne@69: #define __Pyx_DECREF_TypeName(obj) jpayne@69: #endif jpayne@69: jpayne@69: /* CIntFromPy.proto */ jpayne@69: static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); jpayne@69: jpayne@69: /* FastTypeChecks.proto */ jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON jpayne@69: #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) jpayne@69: #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) jpayne@69: static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); jpayne@69: static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); jpayne@69: static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); jpayne@69: static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); jpayne@69: #else jpayne@69: #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) jpayne@69: #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) jpayne@69: #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) jpayne@69: #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) jpayne@69: #endif jpayne@69: #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) jpayne@69: #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) jpayne@69: jpayne@69: /* CheckBinaryVersion.proto */ jpayne@69: static unsigned long __Pyx_get_runtime_version(void); jpayne@69: static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); jpayne@69: jpayne@69: /* FunctionExport.proto */ jpayne@69: static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); jpayne@69: jpayne@69: /* InitStrings.proto */ jpayne@69: static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); jpayne@69: jpayne@69: /* #### Code section: module_declarations ### */ jpayne@69: static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self); /* proto*/ jpayne@69: static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self); /* proto*/ jpayne@69: jpayne@69: /* Module declarations from "cython" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.version" */ jpayne@69: jpayne@69: /* Module declarations from "__builtin__" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.type" */ jpayne@69: jpayne@69: /* Module declarations from "libc.string" */ jpayne@69: jpayne@69: /* Module declarations from "libc.stdio" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.object" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.ref" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.exc" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.module" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.mem" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.tuple" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.list" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.sequence" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.mapping" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.iterator" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.number" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.int" */ jpayne@69: jpayne@69: /* Module declarations from "__builtin__" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.bool" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.long" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.float" */ jpayne@69: jpayne@69: /* Module declarations from "__builtin__" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.complex" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.string" */ jpayne@69: jpayne@69: /* Module declarations from "libc.stddef" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.unicode" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.pyport" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.dict" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.instance" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.function" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.method" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.weakref" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.getargs" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.pythread" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.pystate" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.cobject" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.oldbuffer" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.set" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.buffer" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.bytes" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.pycapsule" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.contextvars" */ jpayne@69: jpayne@69: /* Module declarations from "cpython" */ jpayne@69: jpayne@69: /* Module declarations from "array" */ jpayne@69: jpayne@69: /* Module declarations from "cpython.array" */ jpayne@69: static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_clone(arrayobject *, Py_ssize_t, int); /*proto*/ jpayne@69: static CYTHON_INLINE int __pyx_f_7cpython_5array_extend_buffer(arrayobject *, char *, Py_ssize_t); /*proto*/ jpayne@69: jpayne@69: /* Module declarations from "libc.errno" */ jpayne@69: jpayne@69: /* Module declarations from "libc.stdlib" */ jpayne@69: jpayne@69: /* Module declarations from "libc.stdint" */ jpayne@69: jpayne@69: /* Module declarations from "posix.types" */ jpayne@69: jpayne@69: /* Module declarations from "posix.fcntl" */ jpayne@69: jpayne@69: /* Module declarations from "posix.unistd" */ jpayne@69: jpayne@69: /* Module declarations from "pysam.libcsamtools" */ jpayne@69: jpayne@69: /* Module declarations from "pysam.libcbcftools" */ jpayne@69: jpayne@69: /* Module declarations from "pysam.libcutils" */ jpayne@69: static int __pyx_v_5pysam_9libcutils_MAX_POS; jpayne@69: static PyObject *__pyx_v_5pysam_9libcutils_ERROR_HANDLER = 0; jpayne@69: static PyObject *__pyx_v_5pysam_9libcutils_FILENAME_ENCODING = 0; jpayne@69: static PyObject *__pyx_v_5pysam_9libcutils_TEXT_ENCODING = 0; jpayne@69: static PyObject *__pyx_f_5pysam_9libcutils_parse_region(int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_9libcutils_parse_region *__pyx_optional_args); /*proto*/ jpayne@69: static arrayobject *__pyx_f_5pysam_9libcutils_qualitystring_to_array(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_9libcutils_qualitystring_to_array *__pyx_optional_args); /*proto*/ jpayne@69: static PyObject *__pyx_f_5pysam_9libcutils_array_to_qualitystring(arrayobject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_9libcutils_array_to_qualitystring *__pyx_optional_args); /*proto*/ jpayne@69: static PyObject *__pyx_f_5pysam_9libcutils_qualities_to_qualitystring(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_9libcutils_qualities_to_qualitystring *__pyx_optional_args); /*proto*/ jpayne@69: static PyObject *__pyx_f_5pysam_9libcutils_get_encoding_error_handler(int __pyx_skip_dispatch); /*proto*/ jpayne@69: static PyObject *__pyx_f_5pysam_9libcutils_set_encoding_error_handler(PyObject *, int __pyx_skip_dispatch); /*proto*/ jpayne@69: static PyObject *__pyx_f_5pysam_9libcutils_force_str(PyObject *, struct __pyx_opt_args_5pysam_9libcutils_force_str *__pyx_optional_args); /*proto*/ jpayne@69: static PyObject *__pyx_f_5pysam_9libcutils_force_bytes(PyObject *, struct __pyx_opt_args_5pysam_9libcutils_force_bytes *__pyx_optional_args); /*proto*/ jpayne@69: /* #### Code section: typeinfo ### */ jpayne@69: /* #### Code section: before_global_var ### */ jpayne@69: #define __Pyx_MODULE_NAME "pysam.libcutils" jpayne@69: extern int __pyx_module_is_main_pysam__libcutils; jpayne@69: int __pyx_module_is_main_pysam__libcutils = 0; jpayne@69: jpayne@69: /* Implementation of "pysam.libcutils" */ jpayne@69: /* #### Code section: global_var ### */ jpayne@69: static PyObject *__pyx_builtin_chr; jpayne@69: static PyObject *__pyx_builtin_TypeError; jpayne@69: static PyObject *__pyx_builtin_ValueError; jpayne@69: static PyObject *__pyx_builtin_OverflowError; jpayne@69: static PyObject *__pyx_builtin_IOError; jpayne@69: static PyObject *__pyx_builtin_OSError; jpayne@69: static PyObject *__pyx_builtin_open; jpayne@69: static PyObject *__pyx_builtin_UnicodeDecodeError; jpayne@69: static PyObject *__pyx_builtin_MemoryError; jpayne@69: /* #### Code section: string_decls ### */ jpayne@69: static const char __pyx_k_[] = ""; jpayne@69: static const char __pyx_k_B[] = "B"; jpayne@69: static const char __pyx_k_a[] = "a"; jpayne@69: static const char __pyx_k_c[] = "-c"; jpayne@69: static const char __pyx_k_i[] = "i"; jpayne@69: static const char __pyx_k_l[] = "l"; jpayne@69: static const char __pyx_k_m[] = "-m"; jpayne@69: static const char __pyx_k_n[] = "n"; jpayne@69: static const char __pyx_k_o[] = "-o"; jpayne@69: static const char __pyx_k_r[] = "r"; jpayne@69: static const char __pyx_k__7[] = ":"; jpayne@69: static const char __pyx_k__8[] = "-"; jpayne@69: static const char __pyx_k_fn[] = "fn"; jpayne@69: static const char __pyx_k_io[] = "io"; jpayne@69: static const char __pyx_k_os[] = "os"; jpayne@69: static const char __pyx_k_rb[] = "rb"; jpayne@69: static const char __pyx_k_re[] = "re"; jpayne@69: static const char __pyx_k__10[] = "-@"; jpayne@69: static const char __pyx_k__11[] = " "; jpayne@69: static const char __pyx_k__14[] = "*"; jpayne@69: static const char __pyx_k__15[] = "."; jpayne@69: static const char __pyx_k__33[] = "?"; jpayne@69: static const char __pyx_k_all[] = "__all__"; jpayne@69: static const char __pyx_k_arg[] = "arg"; jpayne@69: static const char __pyx_k_chr[] = "chr"; jpayne@69: static const char __pyx_k_end[] = "end"; jpayne@69: static const char __pyx_k_inf[] = "inf"; jpayne@69: static const char __pyx_k_o_2[] = "-o {}"; jpayne@69: static const char __pyx_k_out[] = "out"; jpayne@69: static const char __pyx_k_roh[] = "roh"; jpayne@69: static const char __pyx_k_sys[] = "sys"; jpayne@69: static const char __pyx_k_args[] = "args"; jpayne@69: static const char __pyx_k_exit[] = "__exit__"; jpayne@69: static const char __pyx_k_head[] = "head"; jpayne@69: static const char __pyx_k_main[] = "__main__"; jpayne@69: static const char __pyx_k_name[] = "name"; jpayne@69: static const char __pyx_k_open[] = "open"; jpayne@69: static const char __pyx_k_path[] = "path"; jpayne@69: static const char __pyx_k_read[] = "read"; jpayne@69: static const char __pyx_k_spec[] = "__spec__"; jpayne@69: static const char __pyx_k_stop[] = "stop"; jpayne@69: static const char __pyx_k_test[] = "__test__"; jpayne@69: static const char __pyx_k_view[] = "view"; jpayne@69: static const char __pyx_k_ascii[] = "ascii"; jpayne@69: static const char __pyx_k_calmd[] = "calmd"; jpayne@69: static const char __pyx_k_cargs[] = "cargs"; jpayne@69: static const char __pyx_k_close[] = "close"; jpayne@69: static const char __pyx_k_depad[] = "depad"; jpayne@69: static const char __pyx_k_enter[] = "__enter__"; jpayne@69: static const char __pyx_k_index[] = "index"; jpayne@69: static const char __pyx_k_split[] = "split"; jpayne@69: static const char __pyx_k_start[] = "start"; jpayne@69: static const char __pyx_k_stats[] = "stats"; jpayne@69: static const char __pyx_k_types[] = "types"; jpayne@69: static const char __pyx_k_utf_8[] = "utf-8"; jpayne@69: static const char __pyx_k_codecs[] = "codecs"; jpayne@69: static const char __pyx_k_contig[] = "contig"; jpayne@69: static const char __pyx_k_decode[] = "decode"; jpayne@69: static const char __pyx_k_encode[] = "encode"; jpayne@69: static const char __pyx_k_exists[] = "exists"; jpayne@69: static const char __pyx_k_extend[] = "extend"; jpayne@69: static const char __pyx_k_format[] = "format"; jpayne@69: static const char __pyx_k_import[] = "__import__"; jpayne@69: static const char __pyx_k_method[] = "method"; jpayne@69: static const char __pyx_k_name_2[] = "__name__"; jpayne@69: static const char __pyx_k_object[] = "object"; jpayne@69: static const char __pyx_k_offset[] = "offset"; jpayne@69: static const char __pyx_k_output[] = "--output"; jpayne@69: static const char __pyx_k_region[] = "region"; jpayne@69: static const char __pyx_k_remove[] = "remove"; jpayne@69: static const char __pyx_k_retval[] = "retval"; jpayne@69: static const char __pyx_k_strict[] = "strict"; jpayne@69: static const char __pyx_k_string[] = "string"; jpayne@69: static const char __pyx_k_IOError[] = "IOError"; jpayne@69: static const char __pyx_k_OSError[] = "OSError"; jpayne@69: static const char __pyx_k_collect[] = "_collect"; jpayne@69: static const char __pyx_k_mkstemp[] = "mkstemp"; jpayne@69: static const char __pyx_k_mpileup[] = "mpileup"; jpayne@69: static const char __pyx_k_threads[] = "--threads"; jpayne@69: static const char __pyx_k_tobytes[] = "tobytes"; jpayne@69: static const char __pyx_k_bcftools[] = "bcftools"; jpayne@69: static const char __pyx_k_fsencode[] = "fsencode"; jpayne@69: static const char __pyx_k_is_usage[] = "is_usage"; jpayne@69: static const char __pyx_k_samtools[] = "samtools"; jpayne@69: static const char __pyx_k_stderr_f[] = "stderr_f"; jpayne@69: static const char __pyx_k_stderr_h[] = "stderr_h"; jpayne@69: static const char __pyx_k_stdout_f[] = "stdout_f"; jpayne@69: static const char __pyx_k_stdout_h[] = "stdout_h"; jpayne@69: static const char __pyx_k_tempfile[] = "tempfile"; jpayne@69: static const char __pyx_k_ARGUMENTS[] = "ARGUMENTS"; jpayne@69: static const char __pyx_k_TypeError[] = "TypeError"; jpayne@69: static const char __pyx_k_exception[] = "exception"; jpayne@69: static const char __pyx_k_input_str[] = "input_str"; jpayne@69: static const char __pyx_k_min_shift[] = "--min-shift"; jpayne@69: static const char __pyx_k_qualities[] = "qualities"; jpayne@69: static const char __pyx_k_reference[] = "reference"; jpayne@69: static const char __pyx_k_skip_next[] = "skip_next"; jpayne@69: static const char __pyx_k_ValueError[] = "ValueError"; jpayne@69: static const char __pyx_k_collection[] = "collection"; jpayne@69: static const char __pyx_k_contextlib[] = "contextlib"; jpayne@69: static const char __pyx_k_extra_args[] = "extra_args"; jpayne@69: static const char __pyx_k_out_stderr[] = "out_stderr"; jpayne@69: static const char __pyx_k_out_stdout[] = "out_stdout"; jpayne@69: static const char __pyx_k_startswith[] = "startswith"; jpayne@69: static const char __pyx_k_MemoryError[] = "MemoryError"; jpayne@69: static const char __pyx_k_output_file[] = "--output-file"; jpayne@69: static const char __pyx_k_save_stdout[] = "save_stdout"; jpayne@69: static const char __pyx_k_catch_stdout[] = "catch_stdout"; jpayne@69: static const char __pyx_k_initializing[] = "_initializing"; jpayne@69: static const char __pyx_k_is_coroutine[] = "_is_coroutine"; jpayne@69: static const char __pyx_k_parse_region[] = "parse_region"; jpayne@69: static const char __pyx_k_OverflowError[] = "OverflowError"; jpayne@69: static const char __pyx_k_class_getitem[] = "__class_getitem__"; jpayne@69: static const char __pyx_k_stdout_option[] = "stdout_option"; jpayne@69: static const char __pyx_k_contextmanager[] = "contextmanager"; jpayne@69: static const char __pyx_k_latin1_replace[] = "latin1_replace"; jpayne@69: static const char __pyx_k_pysam_dispatch[] = "_pysam_dispatch"; jpayne@69: static const char __pyx_k_register_error[] = "register_error"; jpayne@69: static const char __pyx_k_pysam_libcutils[] = "pysam.libcutils"; jpayne@69: static const char __pyx_k_MAP_STDOUT_OPTIONS[] = "MAP_STDOUT_OPTIONS"; jpayne@69: static const char __pyx_k_UnicodeDecodeError[] = "UnicodeDecodeError"; jpayne@69: static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; jpayne@69: static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; jpayne@69: static const char __pyx_k_getdefaultencoding[] = "getdefaultencoding"; jpayne@69: static const char __pyx_k_pysam_latin1replace[] = "pysam.latin1replace"; jpayne@69: static const char __pyx_k_pysam_libcutils_pyx[] = "pysam/libcutils.pyx"; jpayne@69: static const char __pyx_k_stop_out_of_range_i[] = "stop out of range (%i)"; jpayne@69: static const char __pyx_k_start_out_of_range_i[] = "start out of range (%i)"; jpayne@69: static const char __pyx_k_getfilesystemencoding[] = "getfilesystemencoding"; jpayne@69: static const char __pyx_k_array_to_qualitystring[] = "array_to_qualitystring"; jpayne@69: static const char __pyx_k_qualitystring_to_array[] = "qualitystring_to_array"; jpayne@69: static const char __pyx_k_get_encoding_error_handler[] = "get_encoding_error_handler"; jpayne@69: static const char __pyx_k_qualities_to_qualitystring[] = "qualities_to_qualitystring"; jpayne@69: static const char __pyx_k_set_encoding_error_handler[] = "set_encoding_error_handler"; jpayne@69: static const char __pyx_k_No_such_file_or_directory_s[] = "No such file or directory: '%s'"; jpayne@69: static const char __pyx_k_pysam_dispatch_locals__collect[] = "_pysam_dispatch.._collect"; jpayne@69: static const char __pyx_k_contig_and_reference_should_not[] = "contig and reference should not both be specified"; jpayne@69: static const char __pyx_k_stop_and_end_should_not_both_be[] = "stop and end should not both be specified"; jpayne@69: static const char __pyx_k_Argument_must_be_string_bytes_or[] = "Argument must be string, bytes or unicode."; jpayne@69: static const char __pyx_k_contig_reference_and_region_shou[] = "contig/reference and region should not both be specified"; jpayne@69: static const char __pyx_k_error_while_opening_file_for_wri[] = "error while opening file for writing"; jpayne@69: static const char __pyx_k_invalid_coordinates_start_i_stop[] = "invalid coordinates: start (%i) > stop (%i)"; jpayne@69: static const char __pyx_k_neither_contig_nor_region_are_gi[] = "neither contig nor region are given"; jpayne@69: /* #### Code section: decls ### */ jpayne@69: static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags); /* proto */ jpayne@69: static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ jpayne@69: static PyObject *__pyx_pf_5pysam_9libcutils_qualitystring_to_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input_str, int __pyx_v_offset); /* proto */ jpayne@69: static PyObject *__pyx_pf_5pysam_9libcutils_2array_to_qualitystring(CYTHON_UNUSED PyObject *__pyx_self, arrayobject *__pyx_v_qualities, int __pyx_v_offset); /* proto */ jpayne@69: static PyObject *__pyx_pf_5pysam_9libcutils_4qualities_to_qualitystring(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_qualities, int __pyx_v_offset); /* proto */ jpayne@69: static PyObject *__pyx_pf_5pysam_9libcutils_6latin1_replace(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_exception); /* proto */ jpayne@69: static PyObject *__pyx_pf_5pysam_9libcutils_8get_encoding_error_handler(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ jpayne@69: static PyObject *__pyx_pf_5pysam_9libcutils_10set_encoding_error_handler(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */ jpayne@69: static PyObject *__pyx_pf_5pysam_9libcutils_12parse_region(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_contig, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_region, PyObject *__pyx_v_reference, PyObject *__pyx_v_end); /* proto */ jpayne@69: static PyObject *__pyx_pf_5pysam_9libcutils_15_pysam_dispatch__collect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fn); /* proto */ jpayne@69: static PyObject *__pyx_pf_5pysam_9libcutils_14_pysam_dispatch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_collection, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_catch_stdout, PyObject *__pyx_v_is_usage, PyObject *__pyx_v_save_stdout); /* proto */ jpayne@69: /* #### Code section: late_includes ### */ jpayne@69: /* #### Code section: module_state ### */ jpayne@69: typedef struct { jpayne@69: PyObject *__pyx_d; jpayne@69: PyObject *__pyx_b; jpayne@69: PyObject *__pyx_cython_runtime; jpayne@69: PyObject *__pyx_empty_tuple; jpayne@69: PyObject *__pyx_empty_bytes; jpayne@69: PyObject *__pyx_empty_unicode; jpayne@69: #ifdef __Pyx_CyFunction_USED jpayne@69: PyTypeObject *__pyx_CyFunctionType; jpayne@69: #endif jpayne@69: #ifdef __Pyx_FusedFunction_USED jpayne@69: PyTypeObject *__pyx_FusedFunctionType; jpayne@69: #endif jpayne@69: #ifdef __Pyx_Generator_USED jpayne@69: PyTypeObject *__pyx_GeneratorType; jpayne@69: #endif jpayne@69: #ifdef __Pyx_IterableCoroutine_USED jpayne@69: PyTypeObject *__pyx_IterableCoroutineType; jpayne@69: #endif jpayne@69: #ifdef __Pyx_Coroutine_USED jpayne@69: PyTypeObject *__pyx_CoroutineAwaitType; jpayne@69: #endif jpayne@69: #ifdef __Pyx_Coroutine_USED jpayne@69: PyTypeObject *__pyx_CoroutineType; jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: PyTypeObject *__pyx_ptype_7cpython_4type_type; jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: PyTypeObject *__pyx_ptype_7cpython_4bool_bool; jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: PyTypeObject *__pyx_ptype_7cpython_7complex_complex; jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: PyTypeObject *__pyx_ptype_7cpython_5array_array; jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: PyObject *__pyx_kp_u_; jpayne@69: PyObject *__pyx_n_s_ARGUMENTS; jpayne@69: PyObject *__pyx_kp_u_Argument_must_be_string_bytes_or; jpayne@69: PyObject *__pyx_n_u_B; jpayne@69: PyObject *__pyx_n_s_IOError; jpayne@69: PyObject *__pyx_n_s_MAP_STDOUT_OPTIONS; jpayne@69: PyObject *__pyx_n_s_MemoryError; jpayne@69: PyObject *__pyx_kp_u_No_such_file_or_directory_s; jpayne@69: PyObject *__pyx_n_s_OSError; jpayne@69: PyObject *__pyx_n_s_OverflowError; jpayne@69: PyObject *__pyx_n_s_TypeError; jpayne@69: PyObject *__pyx_n_s_UnicodeDecodeError; jpayne@69: PyObject *__pyx_n_s_ValueError; jpayne@69: PyObject *__pyx_kp_u__10; jpayne@69: PyObject *__pyx_kp_u__11; jpayne@69: PyObject *__pyx_n_s__14; jpayne@69: PyObject *__pyx_kp_u__15; jpayne@69: PyObject *__pyx_n_s__33; jpayne@69: PyObject *__pyx_kp_u__7; jpayne@69: PyObject *__pyx_kp_u__8; jpayne@69: PyObject *__pyx_n_s_a; jpayne@69: PyObject *__pyx_n_s_all; jpayne@69: PyObject *__pyx_n_s_arg; jpayne@69: PyObject *__pyx_n_s_args; jpayne@69: PyObject *__pyx_n_s_array_to_qualitystring; jpayne@69: PyObject *__pyx_n_u_array_to_qualitystring; jpayne@69: PyObject *__pyx_n_u_ascii; jpayne@69: PyObject *__pyx_n_s_asyncio_coroutines; jpayne@69: PyObject *__pyx_n_b_bcftools; jpayne@69: PyObject *__pyx_n_u_bcftools; jpayne@69: PyObject *__pyx_kp_u_c; jpayne@69: PyObject *__pyx_n_u_calmd; jpayne@69: PyObject *__pyx_n_s_cargs; jpayne@69: PyObject *__pyx_n_s_catch_stdout; jpayne@69: PyObject *__pyx_n_s_chr; jpayne@69: PyObject *__pyx_n_s_class_getitem; jpayne@69: PyObject *__pyx_n_s_cline_in_traceback; jpayne@69: PyObject *__pyx_n_s_close; jpayne@69: PyObject *__pyx_n_s_codecs; jpayne@69: PyObject *__pyx_n_s_collect; jpayne@69: PyObject *__pyx_n_s_collection; jpayne@69: PyObject *__pyx_n_s_contextlib; jpayne@69: PyObject *__pyx_n_s_contextmanager; jpayne@69: PyObject *__pyx_n_s_contig; jpayne@69: PyObject *__pyx_kp_u_contig_and_reference_should_not; jpayne@69: PyObject *__pyx_kp_u_contig_reference_and_region_shou; jpayne@69: PyObject *__pyx_n_s_decode; jpayne@69: PyObject *__pyx_n_u_depad; jpayne@69: PyObject *__pyx_n_s_encode; jpayne@69: PyObject *__pyx_n_s_end; jpayne@69: PyObject *__pyx_n_s_enter; jpayne@69: PyObject *__pyx_kp_u_error_while_opening_file_for_wri; jpayne@69: PyObject *__pyx_n_s_exception; jpayne@69: PyObject *__pyx_n_s_exists; jpayne@69: PyObject *__pyx_n_s_exit; jpayne@69: PyObject *__pyx_n_s_extend; jpayne@69: PyObject *__pyx_n_s_extra_args; jpayne@69: PyObject *__pyx_n_s_fn; jpayne@69: PyObject *__pyx_n_s_format; jpayne@69: PyObject *__pyx_n_s_fsencode; jpayne@69: PyObject *__pyx_n_s_get_encoding_error_handler; jpayne@69: PyObject *__pyx_n_u_get_encoding_error_handler; jpayne@69: PyObject *__pyx_n_s_getdefaultencoding; jpayne@69: PyObject *__pyx_n_s_getfilesystemencoding; jpayne@69: PyObject *__pyx_n_u_head; jpayne@69: PyObject *__pyx_n_s_i; jpayne@69: PyObject *__pyx_n_s_import; jpayne@69: PyObject *__pyx_n_b_index; jpayne@69: PyObject *__pyx_n_u_index; jpayne@69: PyObject *__pyx_n_s_inf; jpayne@69: PyObject *__pyx_n_s_initializing; jpayne@69: PyObject *__pyx_n_s_input_str; jpayne@69: PyObject *__pyx_kp_u_invalid_coordinates_start_i_stop; jpayne@69: PyObject *__pyx_n_s_io; jpayne@69: PyObject *__pyx_n_s_is_coroutine; jpayne@69: PyObject *__pyx_n_s_is_usage; jpayne@69: PyObject *__pyx_n_s_l; jpayne@69: PyObject *__pyx_n_s_latin1_replace; jpayne@69: PyObject *__pyx_kp_u_m; jpayne@69: PyObject *__pyx_n_s_main; jpayne@69: PyObject *__pyx_n_s_method; jpayne@69: PyObject *__pyx_kp_u_min_shift; jpayne@69: PyObject *__pyx_n_s_mkstemp; jpayne@69: PyObject *__pyx_n_u_mpileup; jpayne@69: PyObject *__pyx_n_s_n; jpayne@69: PyObject *__pyx_n_s_name; jpayne@69: PyObject *__pyx_n_s_name_2; jpayne@69: PyObject *__pyx_kp_u_neither_contig_nor_region_are_gi; jpayne@69: PyObject *__pyx_kp_u_o; jpayne@69: PyObject *__pyx_kp_u_o_2; jpayne@69: PyObject *__pyx_n_s_object; jpayne@69: PyObject *__pyx_n_s_offset; jpayne@69: PyObject *__pyx_n_s_open; jpayne@69: PyObject *__pyx_n_s_os; jpayne@69: PyObject *__pyx_n_s_out; jpayne@69: PyObject *__pyx_n_s_out_stderr; jpayne@69: PyObject *__pyx_n_s_out_stdout; jpayne@69: PyObject *__pyx_kp_u_output; jpayne@69: PyObject *__pyx_kp_u_output_file; jpayne@69: PyObject *__pyx_n_s_parse_region; jpayne@69: PyObject *__pyx_n_s_path; jpayne@69: PyObject *__pyx_n_s_pysam_dispatch; jpayne@69: PyObject *__pyx_n_s_pysam_dispatch_locals__collect; jpayne@69: PyObject *__pyx_kp_u_pysam_latin1replace; jpayne@69: PyObject *__pyx_n_s_pysam_libcutils; jpayne@69: PyObject *__pyx_kp_s_pysam_libcutils_pyx; jpayne@69: PyObject *__pyx_n_s_qualities; jpayne@69: PyObject *__pyx_n_s_qualities_to_qualitystring; jpayne@69: PyObject *__pyx_n_u_qualities_to_qualitystring; jpayne@69: PyObject *__pyx_n_s_qualitystring_to_array; jpayne@69: PyObject *__pyx_n_u_qualitystring_to_array; jpayne@69: PyObject *__pyx_n_u_r; jpayne@69: PyObject *__pyx_n_u_rb; jpayne@69: PyObject *__pyx_n_s_re; jpayne@69: PyObject *__pyx_n_s_read; jpayne@69: PyObject *__pyx_n_s_reference; jpayne@69: PyObject *__pyx_n_s_region; jpayne@69: PyObject *__pyx_n_s_register_error; jpayne@69: PyObject *__pyx_n_s_remove; jpayne@69: PyObject *__pyx_n_s_retval; jpayne@69: PyObject *__pyx_n_u_roh; jpayne@69: PyObject *__pyx_n_b_samtools; jpayne@69: PyObject *__pyx_n_u_samtools; jpayne@69: PyObject *__pyx_n_s_save_stdout; jpayne@69: PyObject *__pyx_n_s_set_encoding_error_handler; jpayne@69: PyObject *__pyx_n_u_set_encoding_error_handler; jpayne@69: PyObject *__pyx_n_s_skip_next; jpayne@69: PyObject *__pyx_n_s_spec; jpayne@69: PyObject *__pyx_n_s_split; jpayne@69: PyObject *__pyx_n_s_start; jpayne@69: PyObject *__pyx_kp_u_start_out_of_range_i; jpayne@69: PyObject *__pyx_n_s_startswith; jpayne@69: PyObject *__pyx_n_u_stats; jpayne@69: PyObject *__pyx_n_s_stderr_f; jpayne@69: PyObject *__pyx_n_s_stderr_h; jpayne@69: PyObject *__pyx_n_s_stdout_f; jpayne@69: PyObject *__pyx_n_s_stdout_h; jpayne@69: PyObject *__pyx_n_s_stdout_option; jpayne@69: PyObject *__pyx_n_s_stop; jpayne@69: PyObject *__pyx_kp_u_stop_and_end_should_not_both_be; jpayne@69: PyObject *__pyx_kp_u_stop_out_of_range_i; jpayne@69: PyObject *__pyx_n_u_strict; jpayne@69: PyObject *__pyx_n_s_string; jpayne@69: PyObject *__pyx_n_s_sys; jpayne@69: PyObject *__pyx_n_s_tempfile; jpayne@69: PyObject *__pyx_n_s_test; jpayne@69: PyObject *__pyx_kp_u_threads; jpayne@69: PyObject *__pyx_n_s_tobytes; jpayne@69: PyObject *__pyx_n_s_types; jpayne@69: PyObject *__pyx_kp_u_utf_8; jpayne@69: PyObject *__pyx_n_u_view; jpayne@69: PyObject *__pyx_int_1; jpayne@69: PyObject *__pyx_int_33; jpayne@69: PyObject *__pyx_int_neg_1; jpayne@69: PyObject *__pyx_tuple__2; jpayne@69: PyObject *__pyx_tuple__3; jpayne@69: PyObject *__pyx_tuple__4; jpayne@69: PyObject *__pyx_tuple__5; jpayne@69: PyObject *__pyx_tuple__6; jpayne@69: PyObject *__pyx_tuple__9; jpayne@69: PyObject *__pyx_tuple__12; jpayne@69: PyObject *__pyx_tuple__16; jpayne@69: PyObject *__pyx_tuple__18; jpayne@69: PyObject *__pyx_tuple__19; jpayne@69: PyObject *__pyx_tuple__22; jpayne@69: PyObject *__pyx_tuple__25; jpayne@69: PyObject *__pyx_tuple__27; jpayne@69: PyObject *__pyx_tuple__29; jpayne@69: PyObject *__pyx_tuple__30; jpayne@69: PyObject *__pyx_tuple__32; jpayne@69: PyObject *__pyx_codeobj__13; jpayne@69: PyObject *__pyx_codeobj__17; jpayne@69: PyObject *__pyx_codeobj__20; jpayne@69: PyObject *__pyx_codeobj__21; jpayne@69: PyObject *__pyx_codeobj__23; jpayne@69: PyObject *__pyx_codeobj__24; jpayne@69: PyObject *__pyx_codeobj__26; jpayne@69: PyObject *__pyx_codeobj__28; jpayne@69: PyObject *__pyx_codeobj__31; jpayne@69: } __pyx_mstate; jpayne@69: jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #ifdef __cplusplus jpayne@69: namespace { jpayne@69: extern struct PyModuleDef __pyx_moduledef; jpayne@69: } /* anonymous namespace */ jpayne@69: #else jpayne@69: static struct PyModuleDef __pyx_moduledef; jpayne@69: #endif jpayne@69: jpayne@69: #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) jpayne@69: jpayne@69: #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) jpayne@69: jpayne@69: #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) jpayne@69: #else jpayne@69: static __pyx_mstate __pyx_mstate_global_static = jpayne@69: #ifdef __cplusplus jpayne@69: {}; jpayne@69: #else jpayne@69: {0}; jpayne@69: #endif jpayne@69: static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; jpayne@69: #endif jpayne@69: /* #### Code section: module_state_clear ### */ jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: static int __pyx_m_clear(PyObject *m) { jpayne@69: __pyx_mstate *clear_module_state = __pyx_mstate(m); jpayne@69: if (!clear_module_state) return 0; jpayne@69: Py_CLEAR(clear_module_state->__pyx_d); jpayne@69: Py_CLEAR(clear_module_state->__pyx_b); jpayne@69: Py_CLEAR(clear_module_state->__pyx_cython_runtime); jpayne@69: Py_CLEAR(clear_module_state->__pyx_empty_tuple); jpayne@69: Py_CLEAR(clear_module_state->__pyx_empty_bytes); jpayne@69: Py_CLEAR(clear_module_state->__pyx_empty_unicode); jpayne@69: #ifdef __Pyx_CyFunction_USED jpayne@69: Py_CLEAR(clear_module_state->__pyx_CyFunctionType); jpayne@69: #endif jpayne@69: #ifdef __Pyx_FusedFunction_USED jpayne@69: Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); jpayne@69: #endif jpayne@69: Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type); jpayne@69: Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4bool_bool); jpayne@69: Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_7complex_complex); jpayne@69: Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_5array_array); jpayne@69: Py_CLEAR(clear_module_state->__pyx_kp_u_); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_ARGUMENTS); jpayne@69: Py_CLEAR(clear_module_state->__pyx_kp_u_Argument_must_be_string_bytes_or); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_u_B); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_IOError); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_MAP_STDOUT_OPTIONS); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError); jpayne@69: Py_CLEAR(clear_module_state->__pyx_kp_u_No_such_file_or_directory_s); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_OSError); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_OverflowError); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_UnicodeDecodeError); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); jpayne@69: Py_CLEAR(clear_module_state->__pyx_kp_u__10); jpayne@69: Py_CLEAR(clear_module_state->__pyx_kp_u__11); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s__14); jpayne@69: Py_CLEAR(clear_module_state->__pyx_kp_u__15); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s__33); jpayne@69: Py_CLEAR(clear_module_state->__pyx_kp_u__7); jpayne@69: Py_CLEAR(clear_module_state->__pyx_kp_u__8); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_a); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_all); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_arg); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_args); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_array_to_qualitystring); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_u_array_to_qualitystring); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_u_ascii); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_b_bcftools); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_u_bcftools); jpayne@69: Py_CLEAR(clear_module_state->__pyx_kp_u_c); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_u_calmd); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_cargs); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_catch_stdout); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_chr); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_close); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_codecs); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_collect); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_collection); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_contextlib); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_contextmanager); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_contig); jpayne@69: Py_CLEAR(clear_module_state->__pyx_kp_u_contig_and_reference_should_not); jpayne@69: Py_CLEAR(clear_module_state->__pyx_kp_u_contig_reference_and_region_shou); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_decode); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_u_depad); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_encode); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_end); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_enter); jpayne@69: Py_CLEAR(clear_module_state->__pyx_kp_u_error_while_opening_file_for_wri); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_exception); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_exists); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_exit); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_extend); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_extra_args); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_fn); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_format); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_fsencode); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_get_encoding_error_handler); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_u_get_encoding_error_handler); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_getdefaultencoding); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_getfilesystemencoding); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_u_head); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_i); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_import); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_b_index); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_u_index); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_inf); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_initializing); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_input_str); jpayne@69: Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_coordinates_start_i_stop); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_io); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_is_usage); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_l); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_latin1_replace); jpayne@69: Py_CLEAR(clear_module_state->__pyx_kp_u_m); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_main); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_method); jpayne@69: Py_CLEAR(clear_module_state->__pyx_kp_u_min_shift); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_mkstemp); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_u_mpileup); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_n); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_name); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_name_2); jpayne@69: Py_CLEAR(clear_module_state->__pyx_kp_u_neither_contig_nor_region_are_gi); jpayne@69: Py_CLEAR(clear_module_state->__pyx_kp_u_o); jpayne@69: Py_CLEAR(clear_module_state->__pyx_kp_u_o_2); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_object); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_offset); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_open); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_os); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_out); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_out_stderr); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_out_stdout); jpayne@69: Py_CLEAR(clear_module_state->__pyx_kp_u_output); jpayne@69: Py_CLEAR(clear_module_state->__pyx_kp_u_output_file); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_parse_region); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_path); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_pysam_dispatch); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_pysam_dispatch_locals__collect); jpayne@69: Py_CLEAR(clear_module_state->__pyx_kp_u_pysam_latin1replace); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_pysam_libcutils); jpayne@69: Py_CLEAR(clear_module_state->__pyx_kp_s_pysam_libcutils_pyx); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_qualities); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_qualities_to_qualitystring); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_u_qualities_to_qualitystring); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_qualitystring_to_array); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_u_qualitystring_to_array); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_u_r); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_u_rb); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_re); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_read); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_reference); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_region); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_register_error); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_remove); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_retval); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_u_roh); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_b_samtools); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_u_samtools); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_save_stdout); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_set_encoding_error_handler); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_u_set_encoding_error_handler); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_skip_next); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_spec); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_split); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_start); jpayne@69: Py_CLEAR(clear_module_state->__pyx_kp_u_start_out_of_range_i); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_startswith); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_u_stats); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_stderr_f); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_stderr_h); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_stdout_f); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_stdout_h); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_stdout_option); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_stop); jpayne@69: Py_CLEAR(clear_module_state->__pyx_kp_u_stop_and_end_should_not_both_be); jpayne@69: Py_CLEAR(clear_module_state->__pyx_kp_u_stop_out_of_range_i); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_u_strict); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_string); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_sys); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_tempfile); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_test); jpayne@69: Py_CLEAR(clear_module_state->__pyx_kp_u_threads); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_tobytes); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_s_types); jpayne@69: Py_CLEAR(clear_module_state->__pyx_kp_u_utf_8); jpayne@69: Py_CLEAR(clear_module_state->__pyx_n_u_view); jpayne@69: Py_CLEAR(clear_module_state->__pyx_int_1); jpayne@69: Py_CLEAR(clear_module_state->__pyx_int_33); jpayne@69: Py_CLEAR(clear_module_state->__pyx_int_neg_1); jpayne@69: Py_CLEAR(clear_module_state->__pyx_tuple__2); jpayne@69: Py_CLEAR(clear_module_state->__pyx_tuple__3); jpayne@69: Py_CLEAR(clear_module_state->__pyx_tuple__4); jpayne@69: Py_CLEAR(clear_module_state->__pyx_tuple__5); jpayne@69: Py_CLEAR(clear_module_state->__pyx_tuple__6); jpayne@69: Py_CLEAR(clear_module_state->__pyx_tuple__9); jpayne@69: Py_CLEAR(clear_module_state->__pyx_tuple__12); jpayne@69: Py_CLEAR(clear_module_state->__pyx_tuple__16); jpayne@69: Py_CLEAR(clear_module_state->__pyx_tuple__18); jpayne@69: Py_CLEAR(clear_module_state->__pyx_tuple__19); jpayne@69: Py_CLEAR(clear_module_state->__pyx_tuple__22); jpayne@69: Py_CLEAR(clear_module_state->__pyx_tuple__25); jpayne@69: Py_CLEAR(clear_module_state->__pyx_tuple__27); jpayne@69: Py_CLEAR(clear_module_state->__pyx_tuple__29); jpayne@69: Py_CLEAR(clear_module_state->__pyx_tuple__30); jpayne@69: Py_CLEAR(clear_module_state->__pyx_tuple__32); jpayne@69: Py_CLEAR(clear_module_state->__pyx_codeobj__13); jpayne@69: Py_CLEAR(clear_module_state->__pyx_codeobj__17); jpayne@69: Py_CLEAR(clear_module_state->__pyx_codeobj__20); jpayne@69: Py_CLEAR(clear_module_state->__pyx_codeobj__21); jpayne@69: Py_CLEAR(clear_module_state->__pyx_codeobj__23); jpayne@69: Py_CLEAR(clear_module_state->__pyx_codeobj__24); jpayne@69: Py_CLEAR(clear_module_state->__pyx_codeobj__26); jpayne@69: Py_CLEAR(clear_module_state->__pyx_codeobj__28); jpayne@69: Py_CLEAR(clear_module_state->__pyx_codeobj__31); jpayne@69: return 0; jpayne@69: } jpayne@69: #endif jpayne@69: /* #### Code section: module_state_traverse ### */ jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { jpayne@69: __pyx_mstate *traverse_module_state = __pyx_mstate(m); jpayne@69: if (!traverse_module_state) return 0; jpayne@69: Py_VISIT(traverse_module_state->__pyx_d); jpayne@69: Py_VISIT(traverse_module_state->__pyx_b); jpayne@69: Py_VISIT(traverse_module_state->__pyx_cython_runtime); jpayne@69: Py_VISIT(traverse_module_state->__pyx_empty_tuple); jpayne@69: Py_VISIT(traverse_module_state->__pyx_empty_bytes); jpayne@69: Py_VISIT(traverse_module_state->__pyx_empty_unicode); jpayne@69: #ifdef __Pyx_CyFunction_USED jpayne@69: Py_VISIT(traverse_module_state->__pyx_CyFunctionType); jpayne@69: #endif jpayne@69: #ifdef __Pyx_FusedFunction_USED jpayne@69: Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); jpayne@69: #endif jpayne@69: Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type); jpayne@69: Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4bool_bool); jpayne@69: Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_7complex_complex); jpayne@69: Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_5array_array); jpayne@69: Py_VISIT(traverse_module_state->__pyx_kp_u_); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_ARGUMENTS); jpayne@69: Py_VISIT(traverse_module_state->__pyx_kp_u_Argument_must_be_string_bytes_or); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_u_B); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_IOError); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_MAP_STDOUT_OPTIONS); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError); jpayne@69: Py_VISIT(traverse_module_state->__pyx_kp_u_No_such_file_or_directory_s); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_OSError); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_OverflowError); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_UnicodeDecodeError); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); jpayne@69: Py_VISIT(traverse_module_state->__pyx_kp_u__10); jpayne@69: Py_VISIT(traverse_module_state->__pyx_kp_u__11); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s__14); jpayne@69: Py_VISIT(traverse_module_state->__pyx_kp_u__15); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s__33); jpayne@69: Py_VISIT(traverse_module_state->__pyx_kp_u__7); jpayne@69: Py_VISIT(traverse_module_state->__pyx_kp_u__8); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_a); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_all); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_arg); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_args); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_array_to_qualitystring); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_u_array_to_qualitystring); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_u_ascii); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_b_bcftools); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_u_bcftools); jpayne@69: Py_VISIT(traverse_module_state->__pyx_kp_u_c); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_u_calmd); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_cargs); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_catch_stdout); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_chr); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_close); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_codecs); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_collect); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_collection); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_contextlib); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_contextmanager); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_contig); jpayne@69: Py_VISIT(traverse_module_state->__pyx_kp_u_contig_and_reference_should_not); jpayne@69: Py_VISIT(traverse_module_state->__pyx_kp_u_contig_reference_and_region_shou); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_decode); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_u_depad); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_encode); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_end); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_enter); jpayne@69: Py_VISIT(traverse_module_state->__pyx_kp_u_error_while_opening_file_for_wri); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_exception); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_exists); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_exit); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_extend); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_extra_args); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_fn); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_format); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_fsencode); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_get_encoding_error_handler); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_u_get_encoding_error_handler); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_getdefaultencoding); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_getfilesystemencoding); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_u_head); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_i); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_import); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_b_index); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_u_index); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_inf); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_initializing); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_input_str); jpayne@69: Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_coordinates_start_i_stop); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_io); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_is_usage); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_l); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_latin1_replace); jpayne@69: Py_VISIT(traverse_module_state->__pyx_kp_u_m); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_main); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_method); jpayne@69: Py_VISIT(traverse_module_state->__pyx_kp_u_min_shift); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_mkstemp); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_u_mpileup); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_n); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_name); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_name_2); jpayne@69: Py_VISIT(traverse_module_state->__pyx_kp_u_neither_contig_nor_region_are_gi); jpayne@69: Py_VISIT(traverse_module_state->__pyx_kp_u_o); jpayne@69: Py_VISIT(traverse_module_state->__pyx_kp_u_o_2); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_object); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_offset); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_open); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_os); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_out); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_out_stderr); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_out_stdout); jpayne@69: Py_VISIT(traverse_module_state->__pyx_kp_u_output); jpayne@69: Py_VISIT(traverse_module_state->__pyx_kp_u_output_file); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_parse_region); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_path); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_pysam_dispatch); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_pysam_dispatch_locals__collect); jpayne@69: Py_VISIT(traverse_module_state->__pyx_kp_u_pysam_latin1replace); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_pysam_libcutils); jpayne@69: Py_VISIT(traverse_module_state->__pyx_kp_s_pysam_libcutils_pyx); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_qualities); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_qualities_to_qualitystring); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_u_qualities_to_qualitystring); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_qualitystring_to_array); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_u_qualitystring_to_array); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_u_r); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_u_rb); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_re); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_read); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_reference); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_region); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_register_error); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_remove); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_retval); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_u_roh); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_b_samtools); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_u_samtools); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_save_stdout); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_set_encoding_error_handler); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_u_set_encoding_error_handler); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_skip_next); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_spec); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_split); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_start); jpayne@69: Py_VISIT(traverse_module_state->__pyx_kp_u_start_out_of_range_i); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_startswith); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_u_stats); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_stderr_f); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_stderr_h); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_stdout_f); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_stdout_h); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_stdout_option); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_stop); jpayne@69: Py_VISIT(traverse_module_state->__pyx_kp_u_stop_and_end_should_not_both_be); jpayne@69: Py_VISIT(traverse_module_state->__pyx_kp_u_stop_out_of_range_i); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_u_strict); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_string); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_sys); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_tempfile); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_test); jpayne@69: Py_VISIT(traverse_module_state->__pyx_kp_u_threads); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_tobytes); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_s_types); jpayne@69: Py_VISIT(traverse_module_state->__pyx_kp_u_utf_8); jpayne@69: Py_VISIT(traverse_module_state->__pyx_n_u_view); jpayne@69: Py_VISIT(traverse_module_state->__pyx_int_1); jpayne@69: Py_VISIT(traverse_module_state->__pyx_int_33); jpayne@69: Py_VISIT(traverse_module_state->__pyx_int_neg_1); jpayne@69: Py_VISIT(traverse_module_state->__pyx_tuple__2); jpayne@69: Py_VISIT(traverse_module_state->__pyx_tuple__3); jpayne@69: Py_VISIT(traverse_module_state->__pyx_tuple__4); jpayne@69: Py_VISIT(traverse_module_state->__pyx_tuple__5); jpayne@69: Py_VISIT(traverse_module_state->__pyx_tuple__6); jpayne@69: Py_VISIT(traverse_module_state->__pyx_tuple__9); jpayne@69: Py_VISIT(traverse_module_state->__pyx_tuple__12); jpayne@69: Py_VISIT(traverse_module_state->__pyx_tuple__16); jpayne@69: Py_VISIT(traverse_module_state->__pyx_tuple__18); jpayne@69: Py_VISIT(traverse_module_state->__pyx_tuple__19); jpayne@69: Py_VISIT(traverse_module_state->__pyx_tuple__22); jpayne@69: Py_VISIT(traverse_module_state->__pyx_tuple__25); jpayne@69: Py_VISIT(traverse_module_state->__pyx_tuple__27); jpayne@69: Py_VISIT(traverse_module_state->__pyx_tuple__29); jpayne@69: Py_VISIT(traverse_module_state->__pyx_tuple__30); jpayne@69: Py_VISIT(traverse_module_state->__pyx_tuple__32); jpayne@69: Py_VISIT(traverse_module_state->__pyx_codeobj__13); jpayne@69: Py_VISIT(traverse_module_state->__pyx_codeobj__17); jpayne@69: Py_VISIT(traverse_module_state->__pyx_codeobj__20); jpayne@69: Py_VISIT(traverse_module_state->__pyx_codeobj__21); jpayne@69: Py_VISIT(traverse_module_state->__pyx_codeobj__23); jpayne@69: Py_VISIT(traverse_module_state->__pyx_codeobj__24); jpayne@69: Py_VISIT(traverse_module_state->__pyx_codeobj__26); jpayne@69: Py_VISIT(traverse_module_state->__pyx_codeobj__28); jpayne@69: Py_VISIT(traverse_module_state->__pyx_codeobj__31); jpayne@69: return 0; jpayne@69: } jpayne@69: #endif jpayne@69: /* #### Code section: module_state_defines ### */ jpayne@69: #define __pyx_d __pyx_mstate_global->__pyx_d jpayne@69: #define __pyx_b __pyx_mstate_global->__pyx_b jpayne@69: #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime jpayne@69: #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple jpayne@69: #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes jpayne@69: #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode jpayne@69: #ifdef __Pyx_CyFunction_USED jpayne@69: #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType jpayne@69: #endif jpayne@69: #ifdef __Pyx_FusedFunction_USED jpayne@69: #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType jpayne@69: #endif jpayne@69: #ifdef __Pyx_Generator_USED jpayne@69: #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType jpayne@69: #endif jpayne@69: #ifdef __Pyx_IterableCoroutine_USED jpayne@69: #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType jpayne@69: #endif jpayne@69: #ifdef __Pyx_Coroutine_USED jpayne@69: #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType jpayne@69: #endif jpayne@69: #ifdef __Pyx_Coroutine_USED jpayne@69: #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #define __pyx_ptype_7cpython_4bool_bool __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #define __pyx_ptype_7cpython_7complex_complex __pyx_mstate_global->__pyx_ptype_7cpython_7complex_complex jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #define __pyx_ptype_7cpython_5array_array __pyx_mstate_global->__pyx_ptype_7cpython_5array_array jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: #endif jpayne@69: #define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_ jpayne@69: #define __pyx_n_s_ARGUMENTS __pyx_mstate_global->__pyx_n_s_ARGUMENTS jpayne@69: #define __pyx_kp_u_Argument_must_be_string_bytes_or __pyx_mstate_global->__pyx_kp_u_Argument_must_be_string_bytes_or jpayne@69: #define __pyx_n_u_B __pyx_mstate_global->__pyx_n_u_B jpayne@69: #define __pyx_n_s_IOError __pyx_mstate_global->__pyx_n_s_IOError jpayne@69: #define __pyx_n_s_MAP_STDOUT_OPTIONS __pyx_mstate_global->__pyx_n_s_MAP_STDOUT_OPTIONS jpayne@69: #define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError jpayne@69: #define __pyx_kp_u_No_such_file_or_directory_s __pyx_mstate_global->__pyx_kp_u_No_such_file_or_directory_s jpayne@69: #define __pyx_n_s_OSError __pyx_mstate_global->__pyx_n_s_OSError jpayne@69: #define __pyx_n_s_OverflowError __pyx_mstate_global->__pyx_n_s_OverflowError jpayne@69: #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError jpayne@69: #define __pyx_n_s_UnicodeDecodeError __pyx_mstate_global->__pyx_n_s_UnicodeDecodeError jpayne@69: #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError jpayne@69: #define __pyx_kp_u__10 __pyx_mstate_global->__pyx_kp_u__10 jpayne@69: #define __pyx_kp_u__11 __pyx_mstate_global->__pyx_kp_u__11 jpayne@69: #define __pyx_n_s__14 __pyx_mstate_global->__pyx_n_s__14 jpayne@69: #define __pyx_kp_u__15 __pyx_mstate_global->__pyx_kp_u__15 jpayne@69: #define __pyx_n_s__33 __pyx_mstate_global->__pyx_n_s__33 jpayne@69: #define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7 jpayne@69: #define __pyx_kp_u__8 __pyx_mstate_global->__pyx_kp_u__8 jpayne@69: #define __pyx_n_s_a __pyx_mstate_global->__pyx_n_s_a jpayne@69: #define __pyx_n_s_all __pyx_mstate_global->__pyx_n_s_all jpayne@69: #define __pyx_n_s_arg __pyx_mstate_global->__pyx_n_s_arg jpayne@69: #define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args jpayne@69: #define __pyx_n_s_array_to_qualitystring __pyx_mstate_global->__pyx_n_s_array_to_qualitystring jpayne@69: #define __pyx_n_u_array_to_qualitystring __pyx_mstate_global->__pyx_n_u_array_to_qualitystring jpayne@69: #define __pyx_n_u_ascii __pyx_mstate_global->__pyx_n_u_ascii jpayne@69: #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines jpayne@69: #define __pyx_n_b_bcftools __pyx_mstate_global->__pyx_n_b_bcftools jpayne@69: #define __pyx_n_u_bcftools __pyx_mstate_global->__pyx_n_u_bcftools jpayne@69: #define __pyx_kp_u_c __pyx_mstate_global->__pyx_kp_u_c jpayne@69: #define __pyx_n_u_calmd __pyx_mstate_global->__pyx_n_u_calmd jpayne@69: #define __pyx_n_s_cargs __pyx_mstate_global->__pyx_n_s_cargs jpayne@69: #define __pyx_n_s_catch_stdout __pyx_mstate_global->__pyx_n_s_catch_stdout jpayne@69: #define __pyx_n_s_chr __pyx_mstate_global->__pyx_n_s_chr jpayne@69: #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem jpayne@69: #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback jpayne@69: #define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close jpayne@69: #define __pyx_n_s_codecs __pyx_mstate_global->__pyx_n_s_codecs jpayne@69: #define __pyx_n_s_collect __pyx_mstate_global->__pyx_n_s_collect jpayne@69: #define __pyx_n_s_collection __pyx_mstate_global->__pyx_n_s_collection jpayne@69: #define __pyx_n_s_contextlib __pyx_mstate_global->__pyx_n_s_contextlib jpayne@69: #define __pyx_n_s_contextmanager __pyx_mstate_global->__pyx_n_s_contextmanager jpayne@69: #define __pyx_n_s_contig __pyx_mstate_global->__pyx_n_s_contig jpayne@69: #define __pyx_kp_u_contig_and_reference_should_not __pyx_mstate_global->__pyx_kp_u_contig_and_reference_should_not jpayne@69: #define __pyx_kp_u_contig_reference_and_region_shou __pyx_mstate_global->__pyx_kp_u_contig_reference_and_region_shou jpayne@69: #define __pyx_n_s_decode __pyx_mstate_global->__pyx_n_s_decode jpayne@69: #define __pyx_n_u_depad __pyx_mstate_global->__pyx_n_u_depad jpayne@69: #define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode jpayne@69: #define __pyx_n_s_end __pyx_mstate_global->__pyx_n_s_end jpayne@69: #define __pyx_n_s_enter __pyx_mstate_global->__pyx_n_s_enter jpayne@69: #define __pyx_kp_u_error_while_opening_file_for_wri __pyx_mstate_global->__pyx_kp_u_error_while_opening_file_for_wri jpayne@69: #define __pyx_n_s_exception __pyx_mstate_global->__pyx_n_s_exception jpayne@69: #define __pyx_n_s_exists __pyx_mstate_global->__pyx_n_s_exists jpayne@69: #define __pyx_n_s_exit __pyx_mstate_global->__pyx_n_s_exit jpayne@69: #define __pyx_n_s_extend __pyx_mstate_global->__pyx_n_s_extend jpayne@69: #define __pyx_n_s_extra_args __pyx_mstate_global->__pyx_n_s_extra_args jpayne@69: #define __pyx_n_s_fn __pyx_mstate_global->__pyx_n_s_fn jpayne@69: #define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format jpayne@69: #define __pyx_n_s_fsencode __pyx_mstate_global->__pyx_n_s_fsencode jpayne@69: #define __pyx_n_s_get_encoding_error_handler __pyx_mstate_global->__pyx_n_s_get_encoding_error_handler jpayne@69: #define __pyx_n_u_get_encoding_error_handler __pyx_mstate_global->__pyx_n_u_get_encoding_error_handler jpayne@69: #define __pyx_n_s_getdefaultencoding __pyx_mstate_global->__pyx_n_s_getdefaultencoding jpayne@69: #define __pyx_n_s_getfilesystemencoding __pyx_mstate_global->__pyx_n_s_getfilesystemencoding jpayne@69: #define __pyx_n_u_head __pyx_mstate_global->__pyx_n_u_head jpayne@69: #define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i jpayne@69: #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import jpayne@69: #define __pyx_n_b_index __pyx_mstate_global->__pyx_n_b_index jpayne@69: #define __pyx_n_u_index __pyx_mstate_global->__pyx_n_u_index jpayne@69: #define __pyx_n_s_inf __pyx_mstate_global->__pyx_n_s_inf jpayne@69: #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing jpayne@69: #define __pyx_n_s_input_str __pyx_mstate_global->__pyx_n_s_input_str jpayne@69: #define __pyx_kp_u_invalid_coordinates_start_i_stop __pyx_mstate_global->__pyx_kp_u_invalid_coordinates_start_i_stop jpayne@69: #define __pyx_n_s_io __pyx_mstate_global->__pyx_n_s_io jpayne@69: #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine jpayne@69: #define __pyx_n_s_is_usage __pyx_mstate_global->__pyx_n_s_is_usage jpayne@69: #define __pyx_n_s_l __pyx_mstate_global->__pyx_n_s_l jpayne@69: #define __pyx_n_s_latin1_replace __pyx_mstate_global->__pyx_n_s_latin1_replace jpayne@69: #define __pyx_kp_u_m __pyx_mstate_global->__pyx_kp_u_m jpayne@69: #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main jpayne@69: #define __pyx_n_s_method __pyx_mstate_global->__pyx_n_s_method jpayne@69: #define __pyx_kp_u_min_shift __pyx_mstate_global->__pyx_kp_u_min_shift jpayne@69: #define __pyx_n_s_mkstemp __pyx_mstate_global->__pyx_n_s_mkstemp jpayne@69: #define __pyx_n_u_mpileup __pyx_mstate_global->__pyx_n_u_mpileup jpayne@69: #define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n jpayne@69: #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name jpayne@69: #define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2 jpayne@69: #define __pyx_kp_u_neither_contig_nor_region_are_gi __pyx_mstate_global->__pyx_kp_u_neither_contig_nor_region_are_gi jpayne@69: #define __pyx_kp_u_o __pyx_mstate_global->__pyx_kp_u_o jpayne@69: #define __pyx_kp_u_o_2 __pyx_mstate_global->__pyx_kp_u_o_2 jpayne@69: #define __pyx_n_s_object __pyx_mstate_global->__pyx_n_s_object jpayne@69: #define __pyx_n_s_offset __pyx_mstate_global->__pyx_n_s_offset jpayne@69: #define __pyx_n_s_open __pyx_mstate_global->__pyx_n_s_open jpayne@69: #define __pyx_n_s_os __pyx_mstate_global->__pyx_n_s_os jpayne@69: #define __pyx_n_s_out __pyx_mstate_global->__pyx_n_s_out jpayne@69: #define __pyx_n_s_out_stderr __pyx_mstate_global->__pyx_n_s_out_stderr jpayne@69: #define __pyx_n_s_out_stdout __pyx_mstate_global->__pyx_n_s_out_stdout jpayne@69: #define __pyx_kp_u_output __pyx_mstate_global->__pyx_kp_u_output jpayne@69: #define __pyx_kp_u_output_file __pyx_mstate_global->__pyx_kp_u_output_file jpayne@69: #define __pyx_n_s_parse_region __pyx_mstate_global->__pyx_n_s_parse_region jpayne@69: #define __pyx_n_s_path __pyx_mstate_global->__pyx_n_s_path jpayne@69: #define __pyx_n_s_pysam_dispatch __pyx_mstate_global->__pyx_n_s_pysam_dispatch jpayne@69: #define __pyx_n_s_pysam_dispatch_locals__collect __pyx_mstate_global->__pyx_n_s_pysam_dispatch_locals__collect jpayne@69: #define __pyx_kp_u_pysam_latin1replace __pyx_mstate_global->__pyx_kp_u_pysam_latin1replace jpayne@69: #define __pyx_n_s_pysam_libcutils __pyx_mstate_global->__pyx_n_s_pysam_libcutils jpayne@69: #define __pyx_kp_s_pysam_libcutils_pyx __pyx_mstate_global->__pyx_kp_s_pysam_libcutils_pyx jpayne@69: #define __pyx_n_s_qualities __pyx_mstate_global->__pyx_n_s_qualities jpayne@69: #define __pyx_n_s_qualities_to_qualitystring __pyx_mstate_global->__pyx_n_s_qualities_to_qualitystring jpayne@69: #define __pyx_n_u_qualities_to_qualitystring __pyx_mstate_global->__pyx_n_u_qualities_to_qualitystring jpayne@69: #define __pyx_n_s_qualitystring_to_array __pyx_mstate_global->__pyx_n_s_qualitystring_to_array jpayne@69: #define __pyx_n_u_qualitystring_to_array __pyx_mstate_global->__pyx_n_u_qualitystring_to_array jpayne@69: #define __pyx_n_u_r __pyx_mstate_global->__pyx_n_u_r jpayne@69: #define __pyx_n_u_rb __pyx_mstate_global->__pyx_n_u_rb jpayne@69: #define __pyx_n_s_re __pyx_mstate_global->__pyx_n_s_re jpayne@69: #define __pyx_n_s_read __pyx_mstate_global->__pyx_n_s_read jpayne@69: #define __pyx_n_s_reference __pyx_mstate_global->__pyx_n_s_reference jpayne@69: #define __pyx_n_s_region __pyx_mstate_global->__pyx_n_s_region jpayne@69: #define __pyx_n_s_register_error __pyx_mstate_global->__pyx_n_s_register_error jpayne@69: #define __pyx_n_s_remove __pyx_mstate_global->__pyx_n_s_remove jpayne@69: #define __pyx_n_s_retval __pyx_mstate_global->__pyx_n_s_retval jpayne@69: #define __pyx_n_u_roh __pyx_mstate_global->__pyx_n_u_roh jpayne@69: #define __pyx_n_b_samtools __pyx_mstate_global->__pyx_n_b_samtools jpayne@69: #define __pyx_n_u_samtools __pyx_mstate_global->__pyx_n_u_samtools jpayne@69: #define __pyx_n_s_save_stdout __pyx_mstate_global->__pyx_n_s_save_stdout jpayne@69: #define __pyx_n_s_set_encoding_error_handler __pyx_mstate_global->__pyx_n_s_set_encoding_error_handler jpayne@69: #define __pyx_n_u_set_encoding_error_handler __pyx_mstate_global->__pyx_n_u_set_encoding_error_handler jpayne@69: #define __pyx_n_s_skip_next __pyx_mstate_global->__pyx_n_s_skip_next jpayne@69: #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec jpayne@69: #define __pyx_n_s_split __pyx_mstate_global->__pyx_n_s_split jpayne@69: #define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start jpayne@69: #define __pyx_kp_u_start_out_of_range_i __pyx_mstate_global->__pyx_kp_u_start_out_of_range_i jpayne@69: #define __pyx_n_s_startswith __pyx_mstate_global->__pyx_n_s_startswith jpayne@69: #define __pyx_n_u_stats __pyx_mstate_global->__pyx_n_u_stats jpayne@69: #define __pyx_n_s_stderr_f __pyx_mstate_global->__pyx_n_s_stderr_f jpayne@69: #define __pyx_n_s_stderr_h __pyx_mstate_global->__pyx_n_s_stderr_h jpayne@69: #define __pyx_n_s_stdout_f __pyx_mstate_global->__pyx_n_s_stdout_f jpayne@69: #define __pyx_n_s_stdout_h __pyx_mstate_global->__pyx_n_s_stdout_h jpayne@69: #define __pyx_n_s_stdout_option __pyx_mstate_global->__pyx_n_s_stdout_option jpayne@69: #define __pyx_n_s_stop __pyx_mstate_global->__pyx_n_s_stop jpayne@69: #define __pyx_kp_u_stop_and_end_should_not_both_be __pyx_mstate_global->__pyx_kp_u_stop_and_end_should_not_both_be jpayne@69: #define __pyx_kp_u_stop_out_of_range_i __pyx_mstate_global->__pyx_kp_u_stop_out_of_range_i jpayne@69: #define __pyx_n_u_strict __pyx_mstate_global->__pyx_n_u_strict jpayne@69: #define __pyx_n_s_string __pyx_mstate_global->__pyx_n_s_string jpayne@69: #define __pyx_n_s_sys __pyx_mstate_global->__pyx_n_s_sys jpayne@69: #define __pyx_n_s_tempfile __pyx_mstate_global->__pyx_n_s_tempfile jpayne@69: #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test jpayne@69: #define __pyx_kp_u_threads __pyx_mstate_global->__pyx_kp_u_threads jpayne@69: #define __pyx_n_s_tobytes __pyx_mstate_global->__pyx_n_s_tobytes jpayne@69: #define __pyx_n_s_types __pyx_mstate_global->__pyx_n_s_types jpayne@69: #define __pyx_kp_u_utf_8 __pyx_mstate_global->__pyx_kp_u_utf_8 jpayne@69: #define __pyx_n_u_view __pyx_mstate_global->__pyx_n_u_view jpayne@69: #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 jpayne@69: #define __pyx_int_33 __pyx_mstate_global->__pyx_int_33 jpayne@69: #define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1 jpayne@69: #define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 jpayne@69: #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 jpayne@69: #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 jpayne@69: #define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 jpayne@69: #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 jpayne@69: #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 jpayne@69: #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 jpayne@69: #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 jpayne@69: #define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 jpayne@69: #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 jpayne@69: #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 jpayne@69: #define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 jpayne@69: #define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 jpayne@69: #define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29 jpayne@69: #define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30 jpayne@69: #define __pyx_tuple__32 __pyx_mstate_global->__pyx_tuple__32 jpayne@69: #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 jpayne@69: #define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 jpayne@69: #define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 jpayne@69: #define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 jpayne@69: #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 jpayne@69: #define __pyx_codeobj__24 __pyx_mstate_global->__pyx_codeobj__24 jpayne@69: #define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 jpayne@69: #define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 jpayne@69: #define __pyx_codeobj__31 __pyx_mstate_global->__pyx_codeobj__31 jpayne@69: /* #### Code section: module_code ### */ jpayne@69: jpayne@69: /* "cpython/complex.pxd":19 jpayne@69: * jpayne@69: * @property jpayne@69: * cdef inline double real(self) noexcept: # <<<<<<<<<<<<<< jpayne@69: * return self.cval.real jpayne@69: * jpayne@69: */ jpayne@69: jpayne@69: static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self) { jpayne@69: double __pyx_r; jpayne@69: jpayne@69: /* "cpython/complex.pxd":20 jpayne@69: * @property jpayne@69: * cdef inline double real(self) noexcept: jpayne@69: * return self.cval.real # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * @property jpayne@69: */ jpayne@69: __pyx_r = __pyx_v_self->cval.real; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "cpython/complex.pxd":19 jpayne@69: * jpayne@69: * @property jpayne@69: * cdef inline double real(self) noexcept: # <<<<<<<<<<<<<< jpayne@69: * return self.cval.real jpayne@69: * jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L0:; jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* "cpython/complex.pxd":23 jpayne@69: * jpayne@69: * @property jpayne@69: * cdef inline double imag(self) noexcept: # <<<<<<<<<<<<<< jpayne@69: * return self.cval.imag jpayne@69: * jpayne@69: */ jpayne@69: jpayne@69: static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self) { jpayne@69: double __pyx_r; jpayne@69: jpayne@69: /* "cpython/complex.pxd":24 jpayne@69: * @property jpayne@69: * cdef inline double imag(self) noexcept: jpayne@69: * return self.cval.imag # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * # PyTypeObject PyComplex_Type jpayne@69: */ jpayne@69: __pyx_r = __pyx_v_self->cval.imag; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "cpython/complex.pxd":23 jpayne@69: * jpayne@69: * @property jpayne@69: * cdef inline double imag(self) noexcept: # <<<<<<<<<<<<<< jpayne@69: * return self.cval.imag jpayne@69: * jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L0:; jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* "cpython/contextvars.pxd":112 jpayne@69: * jpayne@69: * jpayne@69: * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< jpayne@69: * """Return a new reference to the value of the context variable, jpayne@69: * or the default value of the context variable, jpayne@69: */ jpayne@69: jpayne@69: static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value *__pyx_optional_args) { jpayne@69: PyObject *__pyx_v_default_value = ((PyObject *)Py_None); jpayne@69: PyObject *__pyx_v_value; jpayne@69: PyObject *__pyx_v_pyvalue = NULL; jpayne@69: PyObject *__pyx_r = NULL; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: int __pyx_t_1; jpayne@69: int __pyx_t_2; jpayne@69: PyObject *__pyx_t_3 = NULL; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: __Pyx_RefNannySetupContext("get_value", 1); jpayne@69: if (__pyx_optional_args) { jpayne@69: if (__pyx_optional_args->__pyx_n > 0) { jpayne@69: __pyx_v_default_value = __pyx_optional_args->default_value; jpayne@69: } jpayne@69: } jpayne@69: jpayne@69: /* "cpython/contextvars.pxd":117 jpayne@69: * or None if no such value or default was found. jpayne@69: * """ jpayne@69: * cdef PyObject *value = NULL # <<<<<<<<<<<<<< jpayne@69: * PyContextVar_Get(var, NULL, &value) jpayne@69: * if value is NULL: jpayne@69: */ jpayne@69: __pyx_v_value = NULL; jpayne@69: jpayne@69: /* "cpython/contextvars.pxd":118 jpayne@69: * """ jpayne@69: * cdef PyObject *value = NULL jpayne@69: * PyContextVar_Get(var, NULL, &value) # <<<<<<<<<<<<<< jpayne@69: * if value is NULL: jpayne@69: * # context variable does not have a default jpayne@69: */ jpayne@69: __pyx_t_1 = PyContextVar_Get(__pyx_v_var, NULL, (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 118, __pyx_L1_error) jpayne@69: jpayne@69: /* "cpython/contextvars.pxd":119 jpayne@69: * cdef PyObject *value = NULL jpayne@69: * PyContextVar_Get(var, NULL, &value) jpayne@69: * if value is NULL: # <<<<<<<<<<<<<< jpayne@69: * # context variable does not have a default jpayne@69: * pyvalue = default_value jpayne@69: */ jpayne@69: __pyx_t_2 = (__pyx_v_value == NULL); jpayne@69: if (__pyx_t_2) { jpayne@69: jpayne@69: /* "cpython/contextvars.pxd":121 jpayne@69: * if value is NULL: jpayne@69: * # context variable does not have a default jpayne@69: * pyvalue = default_value # <<<<<<<<<<<<<< jpayne@69: * else: jpayne@69: * # value or default value of context variable jpayne@69: */ jpayne@69: __Pyx_INCREF(__pyx_v_default_value); jpayne@69: __pyx_v_pyvalue = __pyx_v_default_value; jpayne@69: jpayne@69: /* "cpython/contextvars.pxd":119 jpayne@69: * cdef PyObject *value = NULL jpayne@69: * PyContextVar_Get(var, NULL, &value) jpayne@69: * if value is NULL: # <<<<<<<<<<<<<< jpayne@69: * # context variable does not have a default jpayne@69: * pyvalue = default_value jpayne@69: */ jpayne@69: goto __pyx_L3; jpayne@69: } jpayne@69: jpayne@69: /* "cpython/contextvars.pxd":124 jpayne@69: * else: jpayne@69: * # value or default value of context variable jpayne@69: * pyvalue = value # <<<<<<<<<<<<<< jpayne@69: * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' jpayne@69: * return pyvalue jpayne@69: */ jpayne@69: /*else*/ { jpayne@69: __pyx_t_3 = ((PyObject *)__pyx_v_value); jpayne@69: __Pyx_INCREF(__pyx_t_3); jpayne@69: __pyx_v_pyvalue = __pyx_t_3; jpayne@69: __pyx_t_3 = 0; jpayne@69: jpayne@69: /* "cpython/contextvars.pxd":125 jpayne@69: * # value or default value of context variable jpayne@69: * pyvalue = value jpayne@69: * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' # <<<<<<<<<<<<<< jpayne@69: * return pyvalue jpayne@69: * jpayne@69: */ jpayne@69: Py_XDECREF(__pyx_v_value); jpayne@69: } jpayne@69: __pyx_L3:; jpayne@69: jpayne@69: /* "cpython/contextvars.pxd":126 jpayne@69: * pyvalue = value jpayne@69: * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' jpayne@69: * return pyvalue # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * jpayne@69: */ jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __Pyx_INCREF(__pyx_v_pyvalue); jpayne@69: __pyx_r = __pyx_v_pyvalue; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "cpython/contextvars.pxd":112 jpayne@69: * jpayne@69: * jpayne@69: * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< jpayne@69: * """Return a new reference to the value of the context variable, jpayne@69: * or the default value of the context variable, jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_3); jpayne@69: __Pyx_AddTraceback("cpython.contextvars.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __pyx_r = 0; jpayne@69: __pyx_L0:; jpayne@69: __Pyx_XDECREF(__pyx_v_pyvalue); jpayne@69: __Pyx_XGIVEREF(__pyx_r); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* "cpython/contextvars.pxd":129 jpayne@69: * jpayne@69: * jpayne@69: * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< jpayne@69: * """Return a new reference to the value of the context variable, jpayne@69: * or the provided default value if no such value was found. jpayne@69: */ jpayne@69: jpayne@69: static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value_no_default(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default *__pyx_optional_args) { jpayne@69: PyObject *__pyx_v_default_value = ((PyObject *)Py_None); jpayne@69: PyObject *__pyx_v_value; jpayne@69: PyObject *__pyx_v_pyvalue = NULL; jpayne@69: PyObject *__pyx_r = NULL; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: int __pyx_t_1; jpayne@69: PyObject *__pyx_t_2 = NULL; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: __Pyx_RefNannySetupContext("get_value_no_default", 1); jpayne@69: if (__pyx_optional_args) { jpayne@69: if (__pyx_optional_args->__pyx_n > 0) { jpayne@69: __pyx_v_default_value = __pyx_optional_args->default_value; jpayne@69: } jpayne@69: } jpayne@69: jpayne@69: /* "cpython/contextvars.pxd":135 jpayne@69: * Ignores the default value of the context variable, if any. jpayne@69: * """ jpayne@69: * cdef PyObject *value = NULL # <<<<<<<<<<<<<< jpayne@69: * PyContextVar_Get(var, default_value, &value) jpayne@69: * # value of context variable or 'default_value' jpayne@69: */ jpayne@69: __pyx_v_value = NULL; jpayne@69: jpayne@69: /* "cpython/contextvars.pxd":136 jpayne@69: * """ jpayne@69: * cdef PyObject *value = NULL jpayne@69: * PyContextVar_Get(var, default_value, &value) # <<<<<<<<<<<<<< jpayne@69: * # value of context variable or 'default_value' jpayne@69: * pyvalue = value jpayne@69: */ jpayne@69: __pyx_t_1 = PyContextVar_Get(__pyx_v_var, ((PyObject *)__pyx_v_default_value), (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 136, __pyx_L1_error) jpayne@69: jpayne@69: /* "cpython/contextvars.pxd":138 jpayne@69: * PyContextVar_Get(var, default_value, &value) jpayne@69: * # value of context variable or 'default_value' jpayne@69: * pyvalue = value # <<<<<<<<<<<<<< jpayne@69: * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' jpayne@69: * return pyvalue jpayne@69: */ jpayne@69: __pyx_t_2 = ((PyObject *)__pyx_v_value); jpayne@69: __Pyx_INCREF(__pyx_t_2); jpayne@69: __pyx_v_pyvalue = __pyx_t_2; jpayne@69: __pyx_t_2 = 0; jpayne@69: jpayne@69: /* "cpython/contextvars.pxd":139 jpayne@69: * # value of context variable or 'default_value' jpayne@69: * pyvalue = value jpayne@69: * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' # <<<<<<<<<<<<<< jpayne@69: * return pyvalue jpayne@69: */ jpayne@69: Py_XDECREF(__pyx_v_value); jpayne@69: jpayne@69: /* "cpython/contextvars.pxd":140 jpayne@69: * pyvalue = value jpayne@69: * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' jpayne@69: * return pyvalue # <<<<<<<<<<<<<< jpayne@69: */ jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __Pyx_INCREF(__pyx_v_pyvalue); jpayne@69: __pyx_r = __pyx_v_pyvalue; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "cpython/contextvars.pxd":129 jpayne@69: * jpayne@69: * jpayne@69: * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< jpayne@69: * """Return a new reference to the value of the context variable, jpayne@69: * or the provided default value if no such value was found. jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_2); jpayne@69: __Pyx_AddTraceback("cpython.contextvars.get_value_no_default", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __pyx_r = 0; jpayne@69: __pyx_L0:; jpayne@69: __Pyx_XDECREF(__pyx_v_pyvalue); jpayne@69: __Pyx_XGIVEREF(__pyx_r); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* "array.pxd":104 jpayne@69: * __data_union data jpayne@69: * jpayne@69: * def __getbuffer__(self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< jpayne@69: * # This implementation of getbuffer is geared towards Cython jpayne@69: * # requirements, and does not yet fulfill the PEP. jpayne@69: */ jpayne@69: jpayne@69: /* Python wrapper */ jpayne@69: CYTHON_UNUSED static int __pyx_pw_7cpython_5array_5array_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ jpayne@69: CYTHON_UNUSED static int __pyx_pw_7cpython_5array_5array_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { jpayne@69: CYTHON_UNUSED PyObject *const *__pyx_kwvalues; jpayne@69: int __pyx_r; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); jpayne@69: __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); jpayne@69: __pyx_r = __pyx_pf_7cpython_5array_5array___getbuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags) { jpayne@69: PyObject *__pyx_v_item_count = NULL; jpayne@69: int __pyx_r; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: PyObject *__pyx_t_1 = NULL; jpayne@69: char *__pyx_t_2; jpayne@69: int __pyx_t_3; jpayne@69: PyObject *__pyx_t_4 = NULL; jpayne@69: Py_ssize_t __pyx_t_5; jpayne@69: int __pyx_t_6; jpayne@69: char __pyx_t_7; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: if (unlikely(__pyx_v_info == NULL)) { jpayne@69: PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); jpayne@69: return -1; jpayne@69: } jpayne@69: __Pyx_RefNannySetupContext("__getbuffer__", 0); jpayne@69: __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); jpayne@69: __Pyx_GIVEREF(__pyx_v_info->obj); jpayne@69: jpayne@69: /* "array.pxd":109 jpayne@69: * # In particular strided access is always provided regardless jpayne@69: * # of flags jpayne@69: * item_count = Py_SIZE(self) # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * info.suboffsets = NULL jpayne@69: */ jpayne@69: __pyx_t_1 = PyInt_FromSsize_t(Py_SIZE(((PyObject *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 109, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_1); jpayne@69: __pyx_v_item_count = __pyx_t_1; jpayne@69: __pyx_t_1 = 0; jpayne@69: jpayne@69: /* "array.pxd":111 jpayne@69: * item_count = Py_SIZE(self) jpayne@69: * jpayne@69: * info.suboffsets = NULL # <<<<<<<<<<<<<< jpayne@69: * info.buf = self.data.as_chars jpayne@69: * info.readonly = 0 jpayne@69: */ jpayne@69: __pyx_v_info->suboffsets = NULL; jpayne@69: jpayne@69: /* "array.pxd":112 jpayne@69: * jpayne@69: * info.suboffsets = NULL jpayne@69: * info.buf = self.data.as_chars # <<<<<<<<<<<<<< jpayne@69: * info.readonly = 0 jpayne@69: * info.ndim = 1 jpayne@69: */ jpayne@69: __pyx_t_2 = __pyx_v_self->data.as_chars; jpayne@69: __pyx_v_info->buf = __pyx_t_2; jpayne@69: jpayne@69: /* "array.pxd":113 jpayne@69: * info.suboffsets = NULL jpayne@69: * info.buf = self.data.as_chars jpayne@69: * info.readonly = 0 # <<<<<<<<<<<<<< jpayne@69: * info.ndim = 1 jpayne@69: * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) jpayne@69: */ jpayne@69: __pyx_v_info->readonly = 0; jpayne@69: jpayne@69: /* "array.pxd":114 jpayne@69: * info.buf = self.data.as_chars jpayne@69: * info.readonly = 0 jpayne@69: * info.ndim = 1 # <<<<<<<<<<<<<< jpayne@69: * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) jpayne@69: * info.len = info.itemsize * item_count jpayne@69: */ jpayne@69: __pyx_v_info->ndim = 1; jpayne@69: jpayne@69: /* "array.pxd":115 jpayne@69: * info.readonly = 0 jpayne@69: * info.ndim = 1 jpayne@69: * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) # <<<<<<<<<<<<<< jpayne@69: * info.len = info.itemsize * item_count jpayne@69: * jpayne@69: */ jpayne@69: __pyx_t_3 = __pyx_v_self->ob_descr->itemsize; jpayne@69: __pyx_v_info->itemsize = __pyx_t_3; jpayne@69: jpayne@69: /* "array.pxd":116 jpayne@69: * info.ndim = 1 jpayne@69: * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) jpayne@69: * info.len = info.itemsize * item_count # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * info.shape = PyObject_Malloc(sizeof(Py_ssize_t) + 2) jpayne@69: */ jpayne@69: __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_info->itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 116, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_1); jpayne@69: __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_v_item_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 116, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_4); jpayne@69: __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; jpayne@69: __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 116, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; jpayne@69: __pyx_v_info->len = __pyx_t_5; jpayne@69: jpayne@69: /* "array.pxd":118 jpayne@69: * info.len = info.itemsize * item_count jpayne@69: * jpayne@69: * info.shape = PyObject_Malloc(sizeof(Py_ssize_t) + 2) # <<<<<<<<<<<<<< jpayne@69: * if not info.shape: jpayne@69: * raise MemoryError() jpayne@69: */ jpayne@69: __pyx_v_info->shape = ((Py_ssize_t *)PyObject_Malloc(((sizeof(Py_ssize_t)) + 2))); jpayne@69: jpayne@69: /* "array.pxd":119 jpayne@69: * jpayne@69: * info.shape = PyObject_Malloc(sizeof(Py_ssize_t) + 2) jpayne@69: * if not info.shape: # <<<<<<<<<<<<<< jpayne@69: * raise MemoryError() jpayne@69: * info.shape[0] = item_count # constant regardless of resizing jpayne@69: */ jpayne@69: __pyx_t_6 = (!(__pyx_v_info->shape != 0)); jpayne@69: if (unlikely(__pyx_t_6)) { jpayne@69: jpayne@69: /* "array.pxd":120 jpayne@69: * info.shape = PyObject_Malloc(sizeof(Py_ssize_t) + 2) jpayne@69: * if not info.shape: jpayne@69: * raise MemoryError() # <<<<<<<<<<<<<< jpayne@69: * info.shape[0] = item_count # constant regardless of resizing jpayne@69: * info.strides = &info.itemsize jpayne@69: */ jpayne@69: PyErr_NoMemory(); __PYX_ERR(2, 120, __pyx_L1_error) jpayne@69: jpayne@69: /* "array.pxd":119 jpayne@69: * jpayne@69: * info.shape = PyObject_Malloc(sizeof(Py_ssize_t) + 2) jpayne@69: * if not info.shape: # <<<<<<<<<<<<<< jpayne@69: * raise MemoryError() jpayne@69: * info.shape[0] = item_count # constant regardless of resizing jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "array.pxd":121 jpayne@69: * if not info.shape: jpayne@69: * raise MemoryError() jpayne@69: * info.shape[0] = item_count # constant regardless of resizing # <<<<<<<<<<<<<< jpayne@69: * info.strides = &info.itemsize jpayne@69: * jpayne@69: */ jpayne@69: __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_item_count); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 121, __pyx_L1_error) jpayne@69: (__pyx_v_info->shape[0]) = __pyx_t_5; jpayne@69: jpayne@69: /* "array.pxd":122 jpayne@69: * raise MemoryError() jpayne@69: * info.shape[0] = item_count # constant regardless of resizing jpayne@69: * info.strides = &info.itemsize # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * info.format = (info.shape + 1) jpayne@69: */ jpayne@69: __pyx_v_info->strides = (&__pyx_v_info->itemsize); jpayne@69: jpayne@69: /* "array.pxd":124 jpayne@69: * info.strides = &info.itemsize jpayne@69: * jpayne@69: * info.format = (info.shape + 1) # <<<<<<<<<<<<<< jpayne@69: * info.format[0] = self.ob_descr.typecode jpayne@69: * info.format[1] = 0 jpayne@69: */ jpayne@69: __pyx_v_info->format = ((char *)(__pyx_v_info->shape + 1)); jpayne@69: jpayne@69: /* "array.pxd":125 jpayne@69: * jpayne@69: * info.format = (info.shape + 1) jpayne@69: * info.format[0] = self.ob_descr.typecode # <<<<<<<<<<<<<< jpayne@69: * info.format[1] = 0 jpayne@69: * info.obj = self jpayne@69: */ jpayne@69: __pyx_t_7 = __pyx_v_self->ob_descr->typecode; jpayne@69: (__pyx_v_info->format[0]) = __pyx_t_7; jpayne@69: jpayne@69: /* "array.pxd":126 jpayne@69: * info.format = (info.shape + 1) jpayne@69: * info.format[0] = self.ob_descr.typecode jpayne@69: * info.format[1] = 0 # <<<<<<<<<<<<<< jpayne@69: * info.obj = self jpayne@69: * jpayne@69: */ jpayne@69: (__pyx_v_info->format[1]) = 0; jpayne@69: jpayne@69: /* "array.pxd":127 jpayne@69: * info.format[0] = self.ob_descr.typecode jpayne@69: * info.format[1] = 0 jpayne@69: * info.obj = self # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * def __releasebuffer__(self, Py_buffer* info): jpayne@69: */ jpayne@69: __Pyx_INCREF((PyObject *)__pyx_v_self); jpayne@69: __Pyx_GIVEREF((PyObject *)__pyx_v_self); jpayne@69: __Pyx_GOTREF(__pyx_v_info->obj); jpayne@69: __Pyx_DECREF(__pyx_v_info->obj); jpayne@69: __pyx_v_info->obj = ((PyObject *)__pyx_v_self); jpayne@69: jpayne@69: /* "array.pxd":104 jpayne@69: * __data_union data jpayne@69: * jpayne@69: * def __getbuffer__(self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< jpayne@69: * # This implementation of getbuffer is geared towards Cython jpayne@69: * # requirements, and does not yet fulfill the PEP. jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_r = 0; jpayne@69: goto __pyx_L0; jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_1); jpayne@69: __Pyx_XDECREF(__pyx_t_4); jpayne@69: __Pyx_AddTraceback("cpython.array.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __pyx_r = -1; jpayne@69: if (__pyx_v_info->obj != NULL) { jpayne@69: __Pyx_GOTREF(__pyx_v_info->obj); jpayne@69: __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; jpayne@69: } jpayne@69: goto __pyx_L2; jpayne@69: __pyx_L0:; jpayne@69: if (__pyx_v_info->obj == Py_None) { jpayne@69: __Pyx_GOTREF(__pyx_v_info->obj); jpayne@69: __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; jpayne@69: } jpayne@69: __pyx_L2:; jpayne@69: __Pyx_XDECREF(__pyx_v_item_count); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* "array.pxd":129 jpayne@69: * info.obj = self jpayne@69: * jpayne@69: * def __releasebuffer__(self, Py_buffer* info): # <<<<<<<<<<<<<< jpayne@69: * PyObject_Free(info.shape) jpayne@69: * jpayne@69: */ jpayne@69: jpayne@69: /* Python wrapper */ jpayne@69: CYTHON_UNUSED static void __pyx_pw_7cpython_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ jpayne@69: CYTHON_UNUSED static void __pyx_pw_7cpython_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { jpayne@69: CYTHON_UNUSED PyObject *const *__pyx_kwvalues; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); jpayne@69: __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); jpayne@69: __pyx_pf_7cpython_5array_5array_2__releasebuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: } jpayne@69: jpayne@69: static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info) { jpayne@69: jpayne@69: /* "array.pxd":130 jpayne@69: * jpayne@69: * def __releasebuffer__(self, Py_buffer* info): jpayne@69: * PyObject_Free(info.shape) # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * array newarrayobject(PyTypeObject* type, Py_ssize_t size, arraydescr *descr) jpayne@69: */ jpayne@69: PyObject_Free(__pyx_v_info->shape); jpayne@69: jpayne@69: /* "array.pxd":129 jpayne@69: * info.obj = self jpayne@69: * jpayne@69: * def __releasebuffer__(self, Py_buffer* info): # <<<<<<<<<<<<<< jpayne@69: * PyObject_Free(info.shape) jpayne@69: * jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: } jpayne@69: jpayne@69: /* "array.pxd":141 jpayne@69: * jpayne@69: * jpayne@69: * cdef inline array clone(array template, Py_ssize_t length, bint zero): # <<<<<<<<<<<<<< jpayne@69: * """ fast creation of a new array, given a template array. jpayne@69: * type will be same as template. jpayne@69: */ jpayne@69: jpayne@69: static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_clone(arrayobject *__pyx_v_template, Py_ssize_t __pyx_v_length, int __pyx_v_zero) { jpayne@69: arrayobject *__pyx_v_op = 0; jpayne@69: arrayobject *__pyx_r = NULL; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: PyObject *__pyx_t_1 = NULL; jpayne@69: int __pyx_t_2; jpayne@69: int __pyx_t_3; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: __Pyx_RefNannySetupContext("clone", 1); jpayne@69: jpayne@69: /* "array.pxd":145 jpayne@69: * type will be same as template. jpayne@69: * if zero is true, new array will be initialized with zeroes.""" jpayne@69: * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr) # <<<<<<<<<<<<<< jpayne@69: * if zero and op is not None: jpayne@69: * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) jpayne@69: */ jpayne@69: __pyx_t_1 = ((PyObject *)newarrayobject(Py_TYPE(((PyObject *)__pyx_v_template)), __pyx_v_length, __pyx_v_template->ob_descr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 145, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_1); jpayne@69: __pyx_v_op = ((arrayobject *)__pyx_t_1); jpayne@69: __pyx_t_1 = 0; jpayne@69: jpayne@69: /* "array.pxd":146 jpayne@69: * if zero is true, new array will be initialized with zeroes.""" jpayne@69: * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr) jpayne@69: * if zero and op is not None: # <<<<<<<<<<<<<< jpayne@69: * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) jpayne@69: * return op jpayne@69: */ jpayne@69: if (__pyx_v_zero) { jpayne@69: } else { jpayne@69: __pyx_t_2 = __pyx_v_zero; jpayne@69: goto __pyx_L4_bool_binop_done; jpayne@69: } jpayne@69: __pyx_t_3 = (((PyObject *)__pyx_v_op) != Py_None); jpayne@69: __pyx_t_2 = __pyx_t_3; jpayne@69: __pyx_L4_bool_binop_done:; jpayne@69: if (__pyx_t_2) { jpayne@69: jpayne@69: /* "array.pxd":147 jpayne@69: * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr) jpayne@69: * if zero and op is not None: jpayne@69: * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) # <<<<<<<<<<<<<< jpayne@69: * return op jpayne@69: * jpayne@69: */ jpayne@69: (void)(memset(__pyx_v_op->data.as_chars, 0, (__pyx_v_length * __pyx_v_op->ob_descr->itemsize))); jpayne@69: jpayne@69: /* "array.pxd":146 jpayne@69: * if zero is true, new array will be initialized with zeroes.""" jpayne@69: * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr) jpayne@69: * if zero and op is not None: # <<<<<<<<<<<<<< jpayne@69: * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) jpayne@69: * return op jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "array.pxd":148 jpayne@69: * if zero and op is not None: jpayne@69: * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) jpayne@69: * return op # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * cdef inline array copy(array self): jpayne@69: */ jpayne@69: __Pyx_XDECREF((PyObject *)__pyx_r); jpayne@69: __Pyx_INCREF((PyObject *)__pyx_v_op); jpayne@69: __pyx_r = __pyx_v_op; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "array.pxd":141 jpayne@69: * jpayne@69: * jpayne@69: * cdef inline array clone(array template, Py_ssize_t length, bint zero): # <<<<<<<<<<<<<< jpayne@69: * """ fast creation of a new array, given a template array. jpayne@69: * type will be same as template. jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_1); jpayne@69: __Pyx_AddTraceback("cpython.array.clone", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __pyx_r = 0; jpayne@69: __pyx_L0:; jpayne@69: __Pyx_XDECREF((PyObject *)__pyx_v_op); jpayne@69: __Pyx_XGIVEREF((PyObject *)__pyx_r); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* "array.pxd":150 jpayne@69: * return op jpayne@69: * jpayne@69: * cdef inline array copy(array self): # <<<<<<<<<<<<<< jpayne@69: * """ make a copy of an array. """ jpayne@69: * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) jpayne@69: */ jpayne@69: jpayne@69: static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_copy(arrayobject *__pyx_v_self) { jpayne@69: arrayobject *__pyx_v_op = 0; jpayne@69: arrayobject *__pyx_r = NULL; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: PyObject *__pyx_t_1 = NULL; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: __Pyx_RefNannySetupContext("copy", 1); jpayne@69: jpayne@69: /* "array.pxd":152 jpayne@69: * cdef inline array copy(array self): jpayne@69: * """ make a copy of an array. """ jpayne@69: * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) # <<<<<<<<<<<<<< jpayne@69: * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize) jpayne@69: * return op jpayne@69: */ jpayne@69: __pyx_t_1 = ((PyObject *)newarrayobject(Py_TYPE(((PyObject *)__pyx_v_self)), Py_SIZE(((PyObject *)__pyx_v_self)), __pyx_v_self->ob_descr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 152, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_1); jpayne@69: __pyx_v_op = ((arrayobject *)__pyx_t_1); jpayne@69: __pyx_t_1 = 0; jpayne@69: jpayne@69: /* "array.pxd":153 jpayne@69: * """ make a copy of an array. """ jpayne@69: * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) jpayne@69: * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize) # <<<<<<<<<<<<<< jpayne@69: * return op jpayne@69: * jpayne@69: */ jpayne@69: (void)(memcpy(__pyx_v_op->data.as_chars, __pyx_v_self->data.as_chars, (Py_SIZE(((PyObject *)__pyx_v_op)) * __pyx_v_op->ob_descr->itemsize))); jpayne@69: jpayne@69: /* "array.pxd":154 jpayne@69: * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) jpayne@69: * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize) jpayne@69: * return op # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: jpayne@69: */ jpayne@69: __Pyx_XDECREF((PyObject *)__pyx_r); jpayne@69: __Pyx_INCREF((PyObject *)__pyx_v_op); jpayne@69: __pyx_r = __pyx_v_op; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "array.pxd":150 jpayne@69: * return op jpayne@69: * jpayne@69: * cdef inline array copy(array self): # <<<<<<<<<<<<<< jpayne@69: * """ make a copy of an array. """ jpayne@69: * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_1); jpayne@69: __Pyx_AddTraceback("cpython.array.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __pyx_r = 0; jpayne@69: __pyx_L0:; jpayne@69: __Pyx_XDECREF((PyObject *)__pyx_v_op); jpayne@69: __Pyx_XGIVEREF((PyObject *)__pyx_r); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* "array.pxd":156 jpayne@69: * return op jpayne@69: * jpayne@69: * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: # <<<<<<<<<<<<<< jpayne@69: * """ efficient appending of new stuff of same type jpayne@69: * (e.g. of same array type) jpayne@69: */ jpayne@69: jpayne@69: static CYTHON_INLINE int __pyx_f_7cpython_5array_extend_buffer(arrayobject *__pyx_v_self, char *__pyx_v_stuff, Py_ssize_t __pyx_v_n) { jpayne@69: Py_ssize_t __pyx_v_itemsize; jpayne@69: Py_ssize_t __pyx_v_origsize; jpayne@69: int __pyx_r; jpayne@69: int __pyx_t_1; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: jpayne@69: /* "array.pxd":160 jpayne@69: * (e.g. of same array type) jpayne@69: * n: number of elements (not number of bytes!) """ jpayne@69: * cdef Py_ssize_t itemsize = self.ob_descr.itemsize # <<<<<<<<<<<<<< jpayne@69: * cdef Py_ssize_t origsize = Py_SIZE(self) jpayne@69: * resize_smart(self, origsize + n) jpayne@69: */ jpayne@69: __pyx_t_1 = __pyx_v_self->ob_descr->itemsize; jpayne@69: __pyx_v_itemsize = __pyx_t_1; jpayne@69: jpayne@69: /* "array.pxd":161 jpayne@69: * n: number of elements (not number of bytes!) """ jpayne@69: * cdef Py_ssize_t itemsize = self.ob_descr.itemsize jpayne@69: * cdef Py_ssize_t origsize = Py_SIZE(self) # <<<<<<<<<<<<<< jpayne@69: * resize_smart(self, origsize + n) jpayne@69: * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) jpayne@69: */ jpayne@69: __pyx_v_origsize = Py_SIZE(((PyObject *)__pyx_v_self)); jpayne@69: jpayne@69: /* "array.pxd":162 jpayne@69: * cdef Py_ssize_t itemsize = self.ob_descr.itemsize jpayne@69: * cdef Py_ssize_t origsize = Py_SIZE(self) jpayne@69: * resize_smart(self, origsize + n) # <<<<<<<<<<<<<< jpayne@69: * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) jpayne@69: * return 0 jpayne@69: */ jpayne@69: __pyx_t_1 = resize_smart(__pyx_v_self, (__pyx_v_origsize + __pyx_v_n)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 162, __pyx_L1_error) jpayne@69: jpayne@69: /* "array.pxd":163 jpayne@69: * cdef Py_ssize_t origsize = Py_SIZE(self) jpayne@69: * resize_smart(self, origsize + n) jpayne@69: * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) # <<<<<<<<<<<<<< jpayne@69: * return 0 jpayne@69: * jpayne@69: */ jpayne@69: (void)(memcpy((__pyx_v_self->data.as_chars + (__pyx_v_origsize * __pyx_v_itemsize)), __pyx_v_stuff, (__pyx_v_n * __pyx_v_itemsize))); jpayne@69: jpayne@69: /* "array.pxd":164 jpayne@69: * resize_smart(self, origsize + n) jpayne@69: * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) jpayne@69: * return 0 # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * cdef inline int extend(array self, array other) except -1: jpayne@69: */ jpayne@69: __pyx_r = 0; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "array.pxd":156 jpayne@69: * return op jpayne@69: * jpayne@69: * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: # <<<<<<<<<<<<<< jpayne@69: * """ efficient appending of new stuff of same type jpayne@69: * (e.g. of same array type) jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_AddTraceback("cpython.array.extend_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __pyx_r = -1; jpayne@69: __pyx_L0:; jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* "array.pxd":166 jpayne@69: * return 0 jpayne@69: * jpayne@69: * cdef inline int extend(array self, array other) except -1: # <<<<<<<<<<<<<< jpayne@69: * """ extend array with data from another array; types must match. """ jpayne@69: * if self.ob_descr.typecode != other.ob_descr.typecode: jpayne@69: */ jpayne@69: jpayne@69: static CYTHON_INLINE int __pyx_f_7cpython_5array_extend(arrayobject *__pyx_v_self, arrayobject *__pyx_v_other) { jpayne@69: int __pyx_r; jpayne@69: int __pyx_t_1; jpayne@69: int __pyx_t_2; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: jpayne@69: /* "array.pxd":168 jpayne@69: * cdef inline int extend(array self, array other) except -1: jpayne@69: * """ extend array with data from another array; types must match. """ jpayne@69: * if self.ob_descr.typecode != other.ob_descr.typecode: # <<<<<<<<<<<<<< jpayne@69: * PyErr_BadArgument() jpayne@69: * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) jpayne@69: */ jpayne@69: __pyx_t_1 = (__pyx_v_self->ob_descr->typecode != __pyx_v_other->ob_descr->typecode); jpayne@69: if (__pyx_t_1) { jpayne@69: jpayne@69: /* "array.pxd":169 jpayne@69: * """ extend array with data from another array; types must match. """ jpayne@69: * if self.ob_descr.typecode != other.ob_descr.typecode: jpayne@69: * PyErr_BadArgument() # <<<<<<<<<<<<<< jpayne@69: * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) jpayne@69: * jpayne@69: */ jpayne@69: __pyx_t_2 = PyErr_BadArgument(); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 169, __pyx_L1_error) jpayne@69: jpayne@69: /* "array.pxd":168 jpayne@69: * cdef inline int extend(array self, array other) except -1: jpayne@69: * """ extend array with data from another array; types must match. """ jpayne@69: * if self.ob_descr.typecode != other.ob_descr.typecode: # <<<<<<<<<<<<<< jpayne@69: * PyErr_BadArgument() jpayne@69: * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "array.pxd":170 jpayne@69: * if self.ob_descr.typecode != other.ob_descr.typecode: jpayne@69: * PyErr_BadArgument() jpayne@69: * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * cdef inline void zero(array self) noexcept: jpayne@69: */ jpayne@69: __pyx_t_2 = __pyx_f_7cpython_5array_extend_buffer(__pyx_v_self, __pyx_v_other->data.as_chars, Py_SIZE(((PyObject *)__pyx_v_other))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 170, __pyx_L1_error) jpayne@69: __pyx_r = __pyx_t_2; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "array.pxd":166 jpayne@69: * return 0 jpayne@69: * jpayne@69: * cdef inline int extend(array self, array other) except -1: # <<<<<<<<<<<<<< jpayne@69: * """ extend array with data from another array; types must match. """ jpayne@69: * if self.ob_descr.typecode != other.ob_descr.typecode: jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_AddTraceback("cpython.array.extend", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __pyx_r = -1; jpayne@69: __pyx_L0:; jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* "array.pxd":172 jpayne@69: * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) jpayne@69: * jpayne@69: * cdef inline void zero(array self) noexcept: # <<<<<<<<<<<<<< jpayne@69: * """ set all elements of array to zero. """ jpayne@69: * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize) jpayne@69: */ jpayne@69: jpayne@69: static CYTHON_INLINE void __pyx_f_7cpython_5array_zero(arrayobject *__pyx_v_self) { jpayne@69: jpayne@69: /* "array.pxd":174 jpayne@69: * cdef inline void zero(array self) noexcept: jpayne@69: * """ set all elements of array to zero. """ jpayne@69: * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize) # <<<<<<<<<<<<<< jpayne@69: */ jpayne@69: (void)(memset(__pyx_v_self->data.as_chars, 0, (Py_SIZE(((PyObject *)__pyx_v_self)) * __pyx_v_self->ob_descr->itemsize))); jpayne@69: jpayne@69: /* "array.pxd":172 jpayne@69: * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) jpayne@69: * jpayne@69: * cdef inline void zero(array self) noexcept: # <<<<<<<<<<<<<< jpayne@69: * """ set all elements of array to zero. """ jpayne@69: * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize) jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":36 jpayne@69: * ################################################################# jpayne@69: * # Utility functions for quality string conversions jpayne@69: * cpdef c_array.array qualitystring_to_array(input_str, int offset=33): # <<<<<<<<<<<<<< jpayne@69: * """convert a qualitystring to an array of quality values.""" jpayne@69: * if input_str is None: jpayne@69: */ jpayne@69: jpayne@69: static PyObject *__pyx_pw_5pysam_9libcutils_1qualitystring_to_array(PyObject *__pyx_self, jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds jpayne@69: #else jpayne@69: PyObject *__pyx_args, PyObject *__pyx_kwds jpayne@69: #endif jpayne@69: ); /*proto*/ jpayne@69: static arrayobject *__pyx_f_5pysam_9libcutils_qualitystring_to_array(PyObject *__pyx_v_input_str, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_9libcutils_qualitystring_to_array *__pyx_optional_args) { jpayne@69: int __pyx_v_offset = ((int)33); jpayne@69: PyObject *__pyx_v_qs = NULL; jpayne@69: char __pyx_7genexpr__pyx_v_i; jpayne@69: arrayobject *__pyx_r = NULL; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: int __pyx_t_1; jpayne@69: PyObject *__pyx_t_2 = NULL; jpayne@69: PyObject *__pyx_t_3 = NULL; jpayne@69: char *__pyx_t_4; jpayne@69: char *__pyx_t_5; jpayne@69: char *__pyx_t_6; jpayne@69: char *__pyx_t_7; jpayne@69: PyObject *__pyx_t_8 = NULL; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: __Pyx_RefNannySetupContext("qualitystring_to_array", 1); jpayne@69: if (__pyx_optional_args) { jpayne@69: if (__pyx_optional_args->__pyx_n > 0) { jpayne@69: __pyx_v_offset = __pyx_optional_args->offset; jpayne@69: } jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":38 jpayne@69: * cpdef c_array.array qualitystring_to_array(input_str, int offset=33): jpayne@69: * """convert a qualitystring to an array of quality values.""" jpayne@69: * if input_str is None: # <<<<<<<<<<<<<< jpayne@69: * return None jpayne@69: * qs = force_bytes(input_str) jpayne@69: */ jpayne@69: __pyx_t_1 = (__pyx_v_input_str == Py_None); jpayne@69: if (__pyx_t_1) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":39 jpayne@69: * """convert a qualitystring to an array of quality values.""" jpayne@69: * if input_str is None: jpayne@69: * return None # <<<<<<<<<<<<<< jpayne@69: * qs = force_bytes(input_str) jpayne@69: * cdef char i jpayne@69: */ jpayne@69: __Pyx_XDECREF((PyObject *)__pyx_r); jpayne@69: __pyx_r = ((arrayobject *)Py_None); __Pyx_INCREF(Py_None); jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":38 jpayne@69: * cpdef c_array.array qualitystring_to_array(input_str, int offset=33): jpayne@69: * """convert a qualitystring to an array of quality values.""" jpayne@69: * if input_str is None: # <<<<<<<<<<<<<< jpayne@69: * return None jpayne@69: * qs = force_bytes(input_str) jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":40 jpayne@69: * if input_str is None: jpayne@69: * return None jpayne@69: * qs = force_bytes(input_str) # <<<<<<<<<<<<<< jpayne@69: * cdef char i jpayne@69: * return c_array.array('B', [i - offset for i in qs]) jpayne@69: */ jpayne@69: __pyx_t_2 = __pyx_f_5pysam_9libcutils_force_bytes(__pyx_v_input_str, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __pyx_v_qs = ((PyObject*)__pyx_t_2); jpayne@69: __pyx_t_2 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":42 jpayne@69: * qs = force_bytes(input_str) jpayne@69: * cdef char i jpayne@69: * return c_array.array('B', [i - offset for i in qs]) # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * jpayne@69: */ jpayne@69: __Pyx_XDECREF((PyObject *)__pyx_r); jpayne@69: { /* enter inner scope */ jpayne@69: __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: if (unlikely(__pyx_v_qs == Py_None)) { jpayne@69: PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); jpayne@69: __PYX_ERR(0, 42, __pyx_L1_error) jpayne@69: } jpayne@69: __Pyx_INCREF(__pyx_v_qs); jpayne@69: __pyx_t_3 = __pyx_v_qs; jpayne@69: __pyx_t_5 = PyBytes_AS_STRING(__pyx_t_3); jpayne@69: __pyx_t_6 = (__pyx_t_5 + PyBytes_GET_SIZE(__pyx_t_3)); jpayne@69: for (__pyx_t_7 = __pyx_t_5; __pyx_t_7 < __pyx_t_6; __pyx_t_7++) { jpayne@69: __pyx_t_4 = __pyx_t_7; jpayne@69: __pyx_7genexpr__pyx_v_i = (__pyx_t_4[0]); jpayne@69: __pyx_t_8 = __Pyx_PyInt_From_int((__pyx_7genexpr__pyx_v_i - __pyx_v_offset)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 42, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_8); jpayne@69: if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 42, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; jpayne@69: } jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: } /* exit inner scope */ jpayne@69: __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 42, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_8); jpayne@69: __Pyx_INCREF(__pyx_n_u_B); jpayne@69: __Pyx_GIVEREF(__pyx_n_u_B); jpayne@69: if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_n_u_B)) __PYX_ERR(0, 42, __pyx_L1_error); jpayne@69: __Pyx_GIVEREF(__pyx_t_2); jpayne@69: if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error); jpayne@69: __pyx_t_2 = 0; jpayne@69: __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cpython_5array_array), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; jpayne@69: __pyx_r = ((arrayobject *)__pyx_t_2); jpayne@69: __pyx_t_2 = 0; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":36 jpayne@69: * ################################################################# jpayne@69: * # Utility functions for quality string conversions jpayne@69: * cpdef c_array.array qualitystring_to_array(input_str, int offset=33): # <<<<<<<<<<<<<< jpayne@69: * """convert a qualitystring to an array of quality values.""" jpayne@69: * if input_str is None: jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_2); jpayne@69: __Pyx_XDECREF(__pyx_t_3); jpayne@69: __Pyx_XDECREF(__pyx_t_8); jpayne@69: __Pyx_AddTraceback("pysam.libcutils.qualitystring_to_array", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __pyx_r = 0; jpayne@69: __pyx_L0:; jpayne@69: __Pyx_XDECREF(__pyx_v_qs); jpayne@69: __Pyx_XGIVEREF((PyObject *)__pyx_r); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* Python wrapper */ jpayne@69: static PyObject *__pyx_pw_5pysam_9libcutils_1qualitystring_to_array(PyObject *__pyx_self, jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds jpayne@69: #else jpayne@69: PyObject *__pyx_args, PyObject *__pyx_kwds jpayne@69: #endif jpayne@69: ); /*proto*/ jpayne@69: PyDoc_STRVAR(__pyx_doc_5pysam_9libcutils_qualitystring_to_array, "convert a qualitystring to an array of quality values."); jpayne@69: static PyMethodDef __pyx_mdef_5pysam_9libcutils_1qualitystring_to_array = {"qualitystring_to_array", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcutils_1qualitystring_to_array, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcutils_qualitystring_to_array}; jpayne@69: static PyObject *__pyx_pw_5pysam_9libcutils_1qualitystring_to_array(PyObject *__pyx_self, jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds jpayne@69: #else jpayne@69: PyObject *__pyx_args, PyObject *__pyx_kwds jpayne@69: #endif jpayne@69: ) { jpayne@69: PyObject *__pyx_v_input_str = 0; jpayne@69: int __pyx_v_offset; jpayne@69: #if !CYTHON_METH_FASTCALL jpayne@69: CYTHON_UNUSED Py_ssize_t __pyx_nargs; jpayne@69: #endif jpayne@69: CYTHON_UNUSED PyObject *const *__pyx_kwvalues; jpayne@69: PyObject* values[2] = {0,0}; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: PyObject *__pyx_r = 0; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: __Pyx_RefNannySetupContext("qualitystring_to_array (wrapper)", 0); jpayne@69: #if !CYTHON_METH_FASTCALL jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS jpayne@69: __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); jpayne@69: #else jpayne@69: __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; jpayne@69: #endif jpayne@69: #endif jpayne@69: __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); jpayne@69: { jpayne@69: PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input_str,&__pyx_n_s_offset,0}; jpayne@69: if (__pyx_kwds) { jpayne@69: Py_ssize_t kw_args; jpayne@69: switch (__pyx_nargs) { jpayne@69: case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 0: break; jpayne@69: default: goto __pyx_L5_argtuple_error; jpayne@69: } jpayne@69: kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); jpayne@69: switch (__pyx_nargs) { jpayne@69: case 0: jpayne@69: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input_str)) != 0)) { jpayne@69: (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); jpayne@69: kw_args--; jpayne@69: } jpayne@69: else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L3_error) jpayne@69: else goto __pyx_L5_argtuple_error; jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 1: jpayne@69: if (kw_args > 0) { jpayne@69: PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_offset); jpayne@69: if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } jpayne@69: else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L3_error) jpayne@69: } jpayne@69: } jpayne@69: if (unlikely(kw_args > 0)) { jpayne@69: const Py_ssize_t kwd_pos_args = __pyx_nargs; jpayne@69: if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "qualitystring_to_array") < 0)) __PYX_ERR(0, 36, __pyx_L3_error) jpayne@69: } jpayne@69: } else { jpayne@69: switch (__pyx_nargs) { jpayne@69: case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); jpayne@69: break; jpayne@69: default: goto __pyx_L5_argtuple_error; jpayne@69: } jpayne@69: } jpayne@69: __pyx_v_input_str = values[0]; jpayne@69: if (values[1]) { jpayne@69: __pyx_v_offset = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L3_error) jpayne@69: } else { jpayne@69: __pyx_v_offset = ((int)33); jpayne@69: } jpayne@69: } jpayne@69: goto __pyx_L6_skip; jpayne@69: __pyx_L5_argtuple_error:; jpayne@69: __Pyx_RaiseArgtupleInvalid("qualitystring_to_array", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 36, __pyx_L3_error) jpayne@69: __pyx_L6_skip:; jpayne@69: goto __pyx_L4_argument_unpacking_done; jpayne@69: __pyx_L3_error:; jpayne@69: { jpayne@69: Py_ssize_t __pyx_temp; jpayne@69: for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { jpayne@69: __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); jpayne@69: } jpayne@69: } jpayne@69: __Pyx_AddTraceback("pysam.libcutils.qualitystring_to_array", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return NULL; jpayne@69: __pyx_L4_argument_unpacking_done:; jpayne@69: __pyx_r = __pyx_pf_5pysam_9libcutils_qualitystring_to_array(__pyx_self, __pyx_v_input_str, __pyx_v_offset); jpayne@69: jpayne@69: /* function exit code */ jpayne@69: { jpayne@69: Py_ssize_t __pyx_temp; jpayne@69: for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { jpayne@69: __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); jpayne@69: } jpayne@69: } jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: static PyObject *__pyx_pf_5pysam_9libcutils_qualitystring_to_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input_str, int __pyx_v_offset) { jpayne@69: PyObject *__pyx_r = NULL; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: PyObject *__pyx_t_1 = NULL; jpayne@69: struct __pyx_opt_args_5pysam_9libcutils_qualitystring_to_array __pyx_t_2; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: __Pyx_RefNannySetupContext("qualitystring_to_array", 1); jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __pyx_t_2.__pyx_n = 1; jpayne@69: __pyx_t_2.offset = __pyx_v_offset; jpayne@69: __pyx_t_1 = ((PyObject *)__pyx_f_5pysam_9libcutils_qualitystring_to_array(__pyx_v_input_str, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_1); jpayne@69: __pyx_r = __pyx_t_1; jpayne@69: __pyx_t_1 = 0; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_1); jpayne@69: __Pyx_AddTraceback("pysam.libcutils.qualitystring_to_array", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __pyx_r = NULL; jpayne@69: __pyx_L0:; jpayne@69: __Pyx_XGIVEREF(__pyx_r); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":45 jpayne@69: * jpayne@69: * jpayne@69: * cpdef array_to_qualitystring(c_array.array qualities, int offset=33): # <<<<<<<<<<<<<< jpayne@69: * """convert an array of quality values to a string.""" jpayne@69: * if qualities is None: jpayne@69: */ jpayne@69: jpayne@69: static PyObject *__pyx_pw_5pysam_9libcutils_3array_to_qualitystring(PyObject *__pyx_self, jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds jpayne@69: #else jpayne@69: PyObject *__pyx_args, PyObject *__pyx_kwds jpayne@69: #endif jpayne@69: ); /*proto*/ jpayne@69: static PyObject *__pyx_f_5pysam_9libcutils_array_to_qualitystring(arrayobject *__pyx_v_qualities, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_9libcutils_array_to_qualitystring *__pyx_optional_args) { jpayne@69: int __pyx_v_offset = ((int)33); jpayne@69: int __pyx_v_x; jpayne@69: arrayobject *__pyx_v_result = 0; jpayne@69: PyObject *__pyx_r = NULL; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: int __pyx_t_1; jpayne@69: Py_ssize_t __pyx_t_2; jpayne@69: PyObject *__pyx_t_3 = NULL; jpayne@69: PyObject *__pyx_t_4 = NULL; jpayne@69: PyObject *__pyx_t_5 = NULL; jpayne@69: unsigned int __pyx_t_6; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: __Pyx_RefNannySetupContext("array_to_qualitystring", 1); jpayne@69: if (__pyx_optional_args) { jpayne@69: if (__pyx_optional_args->__pyx_n > 0) { jpayne@69: __pyx_v_offset = __pyx_optional_args->offset; jpayne@69: } jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":47 jpayne@69: * cpdef array_to_qualitystring(c_array.array qualities, int offset=33): jpayne@69: * """convert an array of quality values to a string.""" jpayne@69: * if qualities is None: # <<<<<<<<<<<<<< jpayne@69: * return None jpayne@69: * cdef int x jpayne@69: */ jpayne@69: __pyx_t_1 = (((PyObject *)__pyx_v_qualities) == Py_None); jpayne@69: if (__pyx_t_1) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":48 jpayne@69: * """convert an array of quality values to a string.""" jpayne@69: * if qualities is None: jpayne@69: * return None # <<<<<<<<<<<<<< jpayne@69: * cdef int x jpayne@69: * jpayne@69: */ jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __pyx_r = Py_None; __Pyx_INCREF(Py_None); jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":47 jpayne@69: * cpdef array_to_qualitystring(c_array.array qualities, int offset=33): jpayne@69: * """convert an array of quality values to a string.""" jpayne@69: * if qualities is None: # <<<<<<<<<<<<<< jpayne@69: * return None jpayne@69: * cdef int x jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":52 jpayne@69: * jpayne@69: * cdef c_array.array result jpayne@69: * result = c_array.clone(qualities, len(qualities), zero=False) # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * for x from 0 <= x < len(qualities): jpayne@69: */ jpayne@69: if (unlikely(((PyObject *)__pyx_v_qualities) == Py_None)) { jpayne@69: PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); jpayne@69: __PYX_ERR(0, 52, __pyx_L1_error) jpayne@69: } jpayne@69: __pyx_t_2 = Py_SIZE(((PyObject *)__pyx_v_qualities)); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 52, __pyx_L1_error) jpayne@69: __pyx_t_3 = ((PyObject *)__pyx_f_7cpython_5array_clone(__pyx_v_qualities, __pyx_t_2, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __pyx_v_result = ((arrayobject *)__pyx_t_3); jpayne@69: __pyx_t_3 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":54 jpayne@69: * result = c_array.clone(qualities, len(qualities), zero=False) jpayne@69: * jpayne@69: * for x from 0 <= x < len(qualities): # <<<<<<<<<<<<<< jpayne@69: * result[x] = qualities[x] + offset jpayne@69: * return force_str(result.tobytes()) jpayne@69: */ jpayne@69: if (unlikely(((PyObject *)__pyx_v_qualities) == Py_None)) { jpayne@69: PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); jpayne@69: __PYX_ERR(0, 54, __pyx_L1_error) jpayne@69: } jpayne@69: __pyx_t_2 = Py_SIZE(((PyObject *)__pyx_v_qualities)); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 54, __pyx_L1_error) jpayne@69: for (__pyx_v_x = 0; __pyx_v_x < __pyx_t_2; __pyx_v_x++) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":55 jpayne@69: * jpayne@69: * for x from 0 <= x < len(qualities): jpayne@69: * result[x] = qualities[x] + offset # <<<<<<<<<<<<<< jpayne@69: * return force_str(result.tobytes()) jpayne@69: * jpayne@69: */ jpayne@69: __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_qualities), __pyx_v_x, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_offset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 55, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_4); jpayne@69: __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 55, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_5); jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; jpayne@69: if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_v_result), __pyx_v_x, __pyx_t_5, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0))) __PYX_ERR(0, 55, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":56 jpayne@69: * for x from 0 <= x < len(qualities): jpayne@69: * result[x] = qualities[x] + offset jpayne@69: * return force_str(result.tobytes()) # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * jpayne@69: */ jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_4); jpayne@69: __pyx_t_3 = NULL; jpayne@69: __pyx_t_6 = 0; jpayne@69: #if CYTHON_UNPACK_METHODS jpayne@69: if (likely(PyMethod_Check(__pyx_t_4))) { jpayne@69: __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); jpayne@69: if (likely(__pyx_t_3)) { jpayne@69: PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); jpayne@69: __Pyx_INCREF(__pyx_t_3); jpayne@69: __Pyx_INCREF(function); jpayne@69: __Pyx_DECREF_SET(__pyx_t_4, function); jpayne@69: __pyx_t_6 = 1; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: { jpayne@69: PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; jpayne@69: __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); jpayne@69: __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 56, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_5); jpayne@69: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; jpayne@69: } jpayne@69: __pyx_t_4 = __pyx_f_5pysam_9libcutils_force_str(__pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_4); jpayne@69: __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; jpayne@69: __pyx_r = __pyx_t_4; jpayne@69: __pyx_t_4 = 0; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":45 jpayne@69: * jpayne@69: * jpayne@69: * cpdef array_to_qualitystring(c_array.array qualities, int offset=33): # <<<<<<<<<<<<<< jpayne@69: * """convert an array of quality values to a string.""" jpayne@69: * if qualities is None: jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_3); jpayne@69: __Pyx_XDECREF(__pyx_t_4); jpayne@69: __Pyx_XDECREF(__pyx_t_5); jpayne@69: __Pyx_AddTraceback("pysam.libcutils.array_to_qualitystring", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __pyx_r = 0; jpayne@69: __pyx_L0:; jpayne@69: __Pyx_XDECREF((PyObject *)__pyx_v_result); jpayne@69: __Pyx_XGIVEREF(__pyx_r); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* Python wrapper */ jpayne@69: static PyObject *__pyx_pw_5pysam_9libcutils_3array_to_qualitystring(PyObject *__pyx_self, jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds jpayne@69: #else jpayne@69: PyObject *__pyx_args, PyObject *__pyx_kwds jpayne@69: #endif jpayne@69: ); /*proto*/ jpayne@69: PyDoc_STRVAR(__pyx_doc_5pysam_9libcutils_2array_to_qualitystring, "convert an array of quality values to a string."); jpayne@69: static PyMethodDef __pyx_mdef_5pysam_9libcutils_3array_to_qualitystring = {"array_to_qualitystring", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcutils_3array_to_qualitystring, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcutils_2array_to_qualitystring}; jpayne@69: static PyObject *__pyx_pw_5pysam_9libcutils_3array_to_qualitystring(PyObject *__pyx_self, jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds jpayne@69: #else jpayne@69: PyObject *__pyx_args, PyObject *__pyx_kwds jpayne@69: #endif jpayne@69: ) { jpayne@69: arrayobject *__pyx_v_qualities = 0; jpayne@69: int __pyx_v_offset; jpayne@69: #if !CYTHON_METH_FASTCALL jpayne@69: CYTHON_UNUSED Py_ssize_t __pyx_nargs; jpayne@69: #endif jpayne@69: CYTHON_UNUSED PyObject *const *__pyx_kwvalues; jpayne@69: PyObject* values[2] = {0,0}; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: PyObject *__pyx_r = 0; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: __Pyx_RefNannySetupContext("array_to_qualitystring (wrapper)", 0); jpayne@69: #if !CYTHON_METH_FASTCALL jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS jpayne@69: __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); jpayne@69: #else jpayne@69: __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; jpayne@69: #endif jpayne@69: #endif jpayne@69: __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); jpayne@69: { jpayne@69: PyObject **__pyx_pyargnames[] = {&__pyx_n_s_qualities,&__pyx_n_s_offset,0}; jpayne@69: if (__pyx_kwds) { jpayne@69: Py_ssize_t kw_args; jpayne@69: switch (__pyx_nargs) { jpayne@69: case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 0: break; jpayne@69: default: goto __pyx_L5_argtuple_error; jpayne@69: } jpayne@69: kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); jpayne@69: switch (__pyx_nargs) { jpayne@69: case 0: jpayne@69: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_qualities)) != 0)) { jpayne@69: (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); jpayne@69: kw_args--; jpayne@69: } jpayne@69: else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L3_error) jpayne@69: else goto __pyx_L5_argtuple_error; jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 1: jpayne@69: if (kw_args > 0) { jpayne@69: PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_offset); jpayne@69: if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } jpayne@69: else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L3_error) jpayne@69: } jpayne@69: } jpayne@69: if (unlikely(kw_args > 0)) { jpayne@69: const Py_ssize_t kwd_pos_args = __pyx_nargs; jpayne@69: if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "array_to_qualitystring") < 0)) __PYX_ERR(0, 45, __pyx_L3_error) jpayne@69: } jpayne@69: } else { jpayne@69: switch (__pyx_nargs) { jpayne@69: case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); jpayne@69: break; jpayne@69: default: goto __pyx_L5_argtuple_error; jpayne@69: } jpayne@69: } jpayne@69: __pyx_v_qualities = ((arrayobject *)values[0]); jpayne@69: if (values[1]) { jpayne@69: __pyx_v_offset = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L3_error) jpayne@69: } else { jpayne@69: __pyx_v_offset = ((int)33); jpayne@69: } jpayne@69: } jpayne@69: goto __pyx_L6_skip; jpayne@69: __pyx_L5_argtuple_error:; jpayne@69: __Pyx_RaiseArgtupleInvalid("array_to_qualitystring", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 45, __pyx_L3_error) jpayne@69: __pyx_L6_skip:; jpayne@69: goto __pyx_L4_argument_unpacking_done; jpayne@69: __pyx_L3_error:; jpayne@69: { jpayne@69: Py_ssize_t __pyx_temp; jpayne@69: for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { jpayne@69: __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); jpayne@69: } jpayne@69: } jpayne@69: __Pyx_AddTraceback("pysam.libcutils.array_to_qualitystring", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return NULL; jpayne@69: __pyx_L4_argument_unpacking_done:; jpayne@69: if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_qualities), __pyx_ptype_7cpython_5array_array, 1, "qualities", 0))) __PYX_ERR(0, 45, __pyx_L1_error) jpayne@69: __pyx_r = __pyx_pf_5pysam_9libcutils_2array_to_qualitystring(__pyx_self, __pyx_v_qualities, __pyx_v_offset); jpayne@69: jpayne@69: /* function exit code */ jpayne@69: goto __pyx_L0; jpayne@69: __pyx_L1_error:; jpayne@69: __pyx_r = NULL; jpayne@69: __pyx_L0:; jpayne@69: { jpayne@69: Py_ssize_t __pyx_temp; jpayne@69: for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { jpayne@69: __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); jpayne@69: } jpayne@69: } jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: static PyObject *__pyx_pf_5pysam_9libcutils_2array_to_qualitystring(CYTHON_UNUSED PyObject *__pyx_self, arrayobject *__pyx_v_qualities, int __pyx_v_offset) { jpayne@69: PyObject *__pyx_r = NULL; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: PyObject *__pyx_t_1 = NULL; jpayne@69: struct __pyx_opt_args_5pysam_9libcutils_array_to_qualitystring __pyx_t_2; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: __Pyx_RefNannySetupContext("array_to_qualitystring", 1); jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __pyx_t_2.__pyx_n = 1; jpayne@69: __pyx_t_2.offset = __pyx_v_offset; jpayne@69: __pyx_t_1 = __pyx_f_5pysam_9libcutils_array_to_qualitystring(__pyx_v_qualities, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_1); jpayne@69: __pyx_r = __pyx_t_1; jpayne@69: __pyx_t_1 = 0; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_1); jpayne@69: __Pyx_AddTraceback("pysam.libcutils.array_to_qualitystring", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __pyx_r = NULL; jpayne@69: __pyx_L0:; jpayne@69: __Pyx_XGIVEREF(__pyx_r); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":59 jpayne@69: * jpayne@69: * jpayne@69: * cpdef qualities_to_qualitystring(qualities, int offset=33): # <<<<<<<<<<<<<< jpayne@69: * """convert a list or array of quality scores to the string jpayne@69: * representation used in the SAM format. jpayne@69: */ jpayne@69: jpayne@69: static PyObject *__pyx_pw_5pysam_9libcutils_5qualities_to_qualitystring(PyObject *__pyx_self, jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds jpayne@69: #else jpayne@69: PyObject *__pyx_args, PyObject *__pyx_kwds jpayne@69: #endif jpayne@69: ); /*proto*/ jpayne@69: static PyObject *__pyx_f_5pysam_9libcutils_qualities_to_qualitystring(PyObject *__pyx_v_qualities, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_9libcutils_qualities_to_qualitystring *__pyx_optional_args) { jpayne@69: int __pyx_v_offset = ((int)33); jpayne@69: char __pyx_8genexpr1__pyx_v_x; jpayne@69: PyObject *__pyx_r = NULL; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: int __pyx_t_1; jpayne@69: PyObject *__pyx_t_2 = NULL; jpayne@69: struct __pyx_opt_args_5pysam_9libcutils_array_to_qualitystring __pyx_t_3; jpayne@69: PyObject *__pyx_t_4 = NULL; jpayne@69: Py_ssize_t __pyx_t_5; jpayne@69: PyObject *(*__pyx_t_6)(PyObject *); jpayne@69: PyObject *__pyx_t_7 = NULL; jpayne@69: char __pyx_t_8; jpayne@69: PyObject *__pyx_t_9 = NULL; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: __Pyx_RefNannySetupContext("qualities_to_qualitystring", 1); jpayne@69: if (__pyx_optional_args) { jpayne@69: if (__pyx_optional_args->__pyx_n > 0) { jpayne@69: __pyx_v_offset = __pyx_optional_args->offset; jpayne@69: } jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":76 jpayne@69: * """ jpayne@69: * cdef char x jpayne@69: * if qualities is None: # <<<<<<<<<<<<<< jpayne@69: * return None jpayne@69: * elif isinstance(qualities, c_array.array): jpayne@69: */ jpayne@69: __pyx_t_1 = (__pyx_v_qualities == Py_None); jpayne@69: if (__pyx_t_1) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":77 jpayne@69: * cdef char x jpayne@69: * if qualities is None: jpayne@69: * return None # <<<<<<<<<<<<<< jpayne@69: * elif isinstance(qualities, c_array.array): jpayne@69: * return array_to_qualitystring(qualities, offset=offset) jpayne@69: */ jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __pyx_r = Py_None; __Pyx_INCREF(Py_None); jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":76 jpayne@69: * """ jpayne@69: * cdef char x jpayne@69: * if qualities is None: # <<<<<<<<<<<<<< jpayne@69: * return None jpayne@69: * elif isinstance(qualities, c_array.array): jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":78 jpayne@69: * if qualities is None: jpayne@69: * return None jpayne@69: * elif isinstance(qualities, c_array.array): # <<<<<<<<<<<<<< jpayne@69: * return array_to_qualitystring(qualities, offset=offset) jpayne@69: * else: jpayne@69: */ jpayne@69: __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_qualities, __pyx_ptype_7cpython_5array_array); jpayne@69: if (__pyx_t_1) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":79 jpayne@69: * return None jpayne@69: * elif isinstance(qualities, c_array.array): jpayne@69: * return array_to_qualitystring(qualities, offset=offset) # <<<<<<<<<<<<<< jpayne@69: * else: jpayne@69: * # tuples and lists jpayne@69: */ jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: if (!(likely(((__pyx_v_qualities) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_qualities, __pyx_ptype_7cpython_5array_array))))) __PYX_ERR(0, 79, __pyx_L1_error) jpayne@69: __pyx_t_3.__pyx_n = 1; jpayne@69: __pyx_t_3.offset = __pyx_v_offset; jpayne@69: __pyx_t_2 = __pyx_f_5pysam_9libcutils_array_to_qualitystring(((arrayobject *)__pyx_v_qualities), 0, &__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __pyx_r = __pyx_t_2; jpayne@69: __pyx_t_2 = 0; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":78 jpayne@69: * if qualities is None: jpayne@69: * return None jpayne@69: * elif isinstance(qualities, c_array.array): # <<<<<<<<<<<<<< jpayne@69: * return array_to_qualitystring(qualities, offset=offset) jpayne@69: * else: jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":82 jpayne@69: * else: jpayne@69: * # tuples and lists jpayne@69: * return force_str("".join([chr(x + offset) for x in qualities])) # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * jpayne@69: */ jpayne@69: /*else*/ { jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: { /* enter inner scope */ jpayne@69: __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: if (likely(PyList_CheckExact(__pyx_v_qualities)) || PyTuple_CheckExact(__pyx_v_qualities)) { jpayne@69: __pyx_t_4 = __pyx_v_qualities; __Pyx_INCREF(__pyx_t_4); jpayne@69: __pyx_t_5 = 0; jpayne@69: __pyx_t_6 = NULL; jpayne@69: } else { jpayne@69: __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_qualities); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_4); jpayne@69: __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 82, __pyx_L1_error) jpayne@69: } jpayne@69: for (;;) { jpayne@69: if (likely(!__pyx_t_6)) { jpayne@69: if (likely(PyList_CheckExact(__pyx_t_4))) { jpayne@69: { jpayne@69: Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); jpayne@69: #if !CYTHON_ASSUME_SAFE_MACROS jpayne@69: if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 82, __pyx_L1_error) jpayne@69: #endif jpayne@69: if (__pyx_t_5 >= __pyx_temp) break; jpayne@69: } jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS jpayne@69: __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 82, __pyx_L1_error) jpayne@69: #else jpayne@69: __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 82, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_7); jpayne@69: #endif jpayne@69: } else { jpayne@69: { jpayne@69: Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); jpayne@69: #if !CYTHON_ASSUME_SAFE_MACROS jpayne@69: if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 82, __pyx_L1_error) jpayne@69: #endif jpayne@69: if (__pyx_t_5 >= __pyx_temp) break; jpayne@69: } jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS jpayne@69: __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 82, __pyx_L1_error) jpayne@69: #else jpayne@69: __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 82, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_7); jpayne@69: #endif jpayne@69: } jpayne@69: } else { jpayne@69: __pyx_t_7 = __pyx_t_6(__pyx_t_4); jpayne@69: if (unlikely(!__pyx_t_7)) { jpayne@69: PyObject* exc_type = PyErr_Occurred(); jpayne@69: if (exc_type) { jpayne@69: if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); jpayne@69: else __PYX_ERR(0, 82, __pyx_L1_error) jpayne@69: } jpayne@69: break; jpayne@69: } jpayne@69: __Pyx_GOTREF(__pyx_t_7); jpayne@69: } jpayne@69: __pyx_t_8 = __Pyx_PyInt_As_char(__pyx_t_7); if (unlikely((__pyx_t_8 == (char)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; jpayne@69: __pyx_8genexpr1__pyx_v_x = __pyx_t_8; jpayne@69: __pyx_t_7 = __Pyx_PyInt_From_int((__pyx_8genexpr1__pyx_v_x + __pyx_v_offset)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 82, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_7); jpayne@69: __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 82, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_9); jpayne@69: __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; jpayne@69: if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 82, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; jpayne@69: } jpayne@69: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; jpayne@69: } /* exit inner scope */ jpayne@69: __pyx_t_4 = PyUnicode_Join(__pyx_kp_u_, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_4); jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: __pyx_t_2 = __pyx_f_5pysam_9libcutils_force_str(__pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; jpayne@69: __pyx_r = __pyx_t_2; jpayne@69: __pyx_t_2 = 0; jpayne@69: goto __pyx_L0; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":59 jpayne@69: * jpayne@69: * jpayne@69: * cpdef qualities_to_qualitystring(qualities, int offset=33): # <<<<<<<<<<<<<< jpayne@69: * """convert a list or array of quality scores to the string jpayne@69: * representation used in the SAM format. jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_2); jpayne@69: __Pyx_XDECREF(__pyx_t_4); jpayne@69: __Pyx_XDECREF(__pyx_t_7); jpayne@69: __Pyx_XDECREF(__pyx_t_9); jpayne@69: __Pyx_AddTraceback("pysam.libcutils.qualities_to_qualitystring", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __pyx_r = 0; jpayne@69: __pyx_L0:; jpayne@69: __Pyx_XGIVEREF(__pyx_r); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* Python wrapper */ jpayne@69: static PyObject *__pyx_pw_5pysam_9libcutils_5qualities_to_qualitystring(PyObject *__pyx_self, jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds jpayne@69: #else jpayne@69: PyObject *__pyx_args, PyObject *__pyx_kwds jpayne@69: #endif jpayne@69: ); /*proto*/ jpayne@69: PyDoc_STRVAR(__pyx_doc_5pysam_9libcutils_4qualities_to_qualitystring, "convert a list or array of quality scores to the string\n representation used in the SAM format.\n\n Parameters\n ----------\n offset : int\n offset to be added to the quality scores to arrive at\n the characters of the quality string (default=33).\n\n Returns\n -------\n string\n a quality string\n\n "); jpayne@69: static PyMethodDef __pyx_mdef_5pysam_9libcutils_5qualities_to_qualitystring = {"qualities_to_qualitystring", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcutils_5qualities_to_qualitystring, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcutils_4qualities_to_qualitystring}; jpayne@69: static PyObject *__pyx_pw_5pysam_9libcutils_5qualities_to_qualitystring(PyObject *__pyx_self, jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds jpayne@69: #else jpayne@69: PyObject *__pyx_args, PyObject *__pyx_kwds jpayne@69: #endif jpayne@69: ) { jpayne@69: PyObject *__pyx_v_qualities = 0; jpayne@69: int __pyx_v_offset; jpayne@69: #if !CYTHON_METH_FASTCALL jpayne@69: CYTHON_UNUSED Py_ssize_t __pyx_nargs; jpayne@69: #endif jpayne@69: CYTHON_UNUSED PyObject *const *__pyx_kwvalues; jpayne@69: PyObject* values[2] = {0,0}; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: PyObject *__pyx_r = 0; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: __Pyx_RefNannySetupContext("qualities_to_qualitystring (wrapper)", 0); jpayne@69: #if !CYTHON_METH_FASTCALL jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS jpayne@69: __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); jpayne@69: #else jpayne@69: __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; jpayne@69: #endif jpayne@69: #endif jpayne@69: __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); jpayne@69: { jpayne@69: PyObject **__pyx_pyargnames[] = {&__pyx_n_s_qualities,&__pyx_n_s_offset,0}; jpayne@69: if (__pyx_kwds) { jpayne@69: Py_ssize_t kw_args; jpayne@69: switch (__pyx_nargs) { jpayne@69: case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 0: break; jpayne@69: default: goto __pyx_L5_argtuple_error; jpayne@69: } jpayne@69: kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); jpayne@69: switch (__pyx_nargs) { jpayne@69: case 0: jpayne@69: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_qualities)) != 0)) { jpayne@69: (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); jpayne@69: kw_args--; jpayne@69: } jpayne@69: else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L3_error) jpayne@69: else goto __pyx_L5_argtuple_error; jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 1: jpayne@69: if (kw_args > 0) { jpayne@69: PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_offset); jpayne@69: if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } jpayne@69: else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L3_error) jpayne@69: } jpayne@69: } jpayne@69: if (unlikely(kw_args > 0)) { jpayne@69: const Py_ssize_t kwd_pos_args = __pyx_nargs; jpayne@69: if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "qualities_to_qualitystring") < 0)) __PYX_ERR(0, 59, __pyx_L3_error) jpayne@69: } jpayne@69: } else { jpayne@69: switch (__pyx_nargs) { jpayne@69: case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); jpayne@69: break; jpayne@69: default: goto __pyx_L5_argtuple_error; jpayne@69: } jpayne@69: } jpayne@69: __pyx_v_qualities = values[0]; jpayne@69: if (values[1]) { jpayne@69: __pyx_v_offset = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L3_error) jpayne@69: } else { jpayne@69: __pyx_v_offset = ((int)33); jpayne@69: } jpayne@69: } jpayne@69: goto __pyx_L6_skip; jpayne@69: __pyx_L5_argtuple_error:; jpayne@69: __Pyx_RaiseArgtupleInvalid("qualities_to_qualitystring", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 59, __pyx_L3_error) jpayne@69: __pyx_L6_skip:; jpayne@69: goto __pyx_L4_argument_unpacking_done; jpayne@69: __pyx_L3_error:; jpayne@69: { jpayne@69: Py_ssize_t __pyx_temp; jpayne@69: for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { jpayne@69: __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); jpayne@69: } jpayne@69: } jpayne@69: __Pyx_AddTraceback("pysam.libcutils.qualities_to_qualitystring", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return NULL; jpayne@69: __pyx_L4_argument_unpacking_done:; jpayne@69: __pyx_r = __pyx_pf_5pysam_9libcutils_4qualities_to_qualitystring(__pyx_self, __pyx_v_qualities, __pyx_v_offset); jpayne@69: jpayne@69: /* function exit code */ jpayne@69: { jpayne@69: Py_ssize_t __pyx_temp; jpayne@69: for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { jpayne@69: __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); jpayne@69: } jpayne@69: } jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: static PyObject *__pyx_pf_5pysam_9libcutils_4qualities_to_qualitystring(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_qualities, int __pyx_v_offset) { jpayne@69: PyObject *__pyx_r = NULL; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: PyObject *__pyx_t_1 = NULL; jpayne@69: struct __pyx_opt_args_5pysam_9libcutils_qualities_to_qualitystring __pyx_t_2; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: __Pyx_RefNannySetupContext("qualities_to_qualitystring", 1); jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __pyx_t_2.__pyx_n = 1; jpayne@69: __pyx_t_2.offset = __pyx_v_offset; jpayne@69: __pyx_t_1 = __pyx_f_5pysam_9libcutils_qualities_to_qualitystring(__pyx_v_qualities, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_1); jpayne@69: __pyx_r = __pyx_t_1; jpayne@69: __pyx_t_1 = 0; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_1); jpayne@69: __Pyx_AddTraceback("pysam.libcutils.qualities_to_qualitystring", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __pyx_r = NULL; jpayne@69: __pyx_L0:; jpayne@69: __Pyx_XGIVEREF(__pyx_r); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":90 jpayne@69: * jpayne@69: * # Codec error handler that just interprets each bad byte as ISO-8859-1. jpayne@69: * def latin1_replace(exception): # <<<<<<<<<<<<<< jpayne@69: * return (chr(exception.object[exception.start]), exception.end) jpayne@69: * jpayne@69: */ jpayne@69: jpayne@69: /* Python wrapper */ jpayne@69: static PyObject *__pyx_pw_5pysam_9libcutils_7latin1_replace(PyObject *__pyx_self, jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds jpayne@69: #else jpayne@69: PyObject *__pyx_args, PyObject *__pyx_kwds jpayne@69: #endif jpayne@69: ); /*proto*/ jpayne@69: static PyMethodDef __pyx_mdef_5pysam_9libcutils_7latin1_replace = {"latin1_replace", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcutils_7latin1_replace, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; jpayne@69: static PyObject *__pyx_pw_5pysam_9libcutils_7latin1_replace(PyObject *__pyx_self, jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds jpayne@69: #else jpayne@69: PyObject *__pyx_args, PyObject *__pyx_kwds jpayne@69: #endif jpayne@69: ) { jpayne@69: PyObject *__pyx_v_exception = 0; jpayne@69: #if !CYTHON_METH_FASTCALL jpayne@69: CYTHON_UNUSED Py_ssize_t __pyx_nargs; jpayne@69: #endif jpayne@69: CYTHON_UNUSED PyObject *const *__pyx_kwvalues; jpayne@69: PyObject* values[1] = {0}; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: PyObject *__pyx_r = 0; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: __Pyx_RefNannySetupContext("latin1_replace (wrapper)", 0); jpayne@69: #if !CYTHON_METH_FASTCALL jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS jpayne@69: __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); jpayne@69: #else jpayne@69: __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; jpayne@69: #endif jpayne@69: #endif jpayne@69: __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); jpayne@69: { jpayne@69: PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exception,0}; jpayne@69: if (__pyx_kwds) { jpayne@69: Py_ssize_t kw_args; jpayne@69: switch (__pyx_nargs) { jpayne@69: case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 0: break; jpayne@69: default: goto __pyx_L5_argtuple_error; jpayne@69: } jpayne@69: kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); jpayne@69: switch (__pyx_nargs) { jpayne@69: case 0: jpayne@69: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exception)) != 0)) { jpayne@69: (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); jpayne@69: kw_args--; jpayne@69: } jpayne@69: else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) jpayne@69: else goto __pyx_L5_argtuple_error; jpayne@69: } jpayne@69: if (unlikely(kw_args > 0)) { jpayne@69: const Py_ssize_t kwd_pos_args = __pyx_nargs; jpayne@69: if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "latin1_replace") < 0)) __PYX_ERR(0, 90, __pyx_L3_error) jpayne@69: } jpayne@69: } else if (unlikely(__pyx_nargs != 1)) { jpayne@69: goto __pyx_L5_argtuple_error; jpayne@69: } else { jpayne@69: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); jpayne@69: } jpayne@69: __pyx_v_exception = values[0]; jpayne@69: } jpayne@69: goto __pyx_L6_skip; jpayne@69: __pyx_L5_argtuple_error:; jpayne@69: __Pyx_RaiseArgtupleInvalid("latin1_replace", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 90, __pyx_L3_error) jpayne@69: __pyx_L6_skip:; jpayne@69: goto __pyx_L4_argument_unpacking_done; jpayne@69: __pyx_L3_error:; jpayne@69: { jpayne@69: Py_ssize_t __pyx_temp; jpayne@69: for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { jpayne@69: __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); jpayne@69: } jpayne@69: } jpayne@69: __Pyx_AddTraceback("pysam.libcutils.latin1_replace", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return NULL; jpayne@69: __pyx_L4_argument_unpacking_done:; jpayne@69: __pyx_r = __pyx_pf_5pysam_9libcutils_6latin1_replace(__pyx_self, __pyx_v_exception); jpayne@69: jpayne@69: /* function exit code */ jpayne@69: { jpayne@69: Py_ssize_t __pyx_temp; jpayne@69: for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { jpayne@69: __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); jpayne@69: } jpayne@69: } jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: static PyObject *__pyx_pf_5pysam_9libcutils_6latin1_replace(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_exception) { jpayne@69: PyObject *__pyx_r = NULL; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: PyObject *__pyx_t_1 = NULL; jpayne@69: PyObject *__pyx_t_2 = NULL; jpayne@69: PyObject *__pyx_t_3 = NULL; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: __Pyx_RefNannySetupContext("latin1_replace", 1); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":91 jpayne@69: * # Codec error handler that just interprets each bad byte as ISO-8859-1. jpayne@69: * def latin1_replace(exception): jpayne@69: * return (chr(exception.object[exception.start]), exception.end) # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * register_error('pysam.latin1replace', latin1_replace) jpayne@69: */ jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_exception, __pyx_n_s_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_1); jpayne@69: __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_exception, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_exception, __pyx_n_s_end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_1); jpayne@69: __Pyx_GIVEREF(__pyx_t_2); jpayne@69: if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error); jpayne@69: __Pyx_GIVEREF(__pyx_t_3); jpayne@69: if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error); jpayne@69: __pyx_t_2 = 0; jpayne@69: __pyx_t_3 = 0; jpayne@69: __pyx_r = __pyx_t_1; jpayne@69: __pyx_t_1 = 0; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":90 jpayne@69: * jpayne@69: * # Codec error handler that just interprets each bad byte as ISO-8859-1. jpayne@69: * def latin1_replace(exception): # <<<<<<<<<<<<<< jpayne@69: * return (chr(exception.object[exception.start]), exception.end) jpayne@69: * jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_1); jpayne@69: __Pyx_XDECREF(__pyx_t_2); jpayne@69: __Pyx_XDECREF(__pyx_t_3); jpayne@69: __Pyx_AddTraceback("pysam.libcutils.latin1_replace", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __pyx_r = NULL; jpayne@69: __pyx_L0:; jpayne@69: __Pyx_XGIVEREF(__pyx_r); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":98 jpayne@69: * cdef str ERROR_HANDLER = 'strict' jpayne@69: * jpayne@69: * cpdef get_encoding_error_handler(): # <<<<<<<<<<<<<< jpayne@69: * return ERROR_HANDLER jpayne@69: * jpayne@69: */ jpayne@69: jpayne@69: static PyObject *__pyx_pw_5pysam_9libcutils_9get_encoding_error_handler(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ jpayne@69: static PyObject *__pyx_f_5pysam_9libcutils_get_encoding_error_handler(CYTHON_UNUSED int __pyx_skip_dispatch) { jpayne@69: PyObject *__pyx_r = NULL; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: __Pyx_RefNannySetupContext("get_encoding_error_handler", 1); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":99 jpayne@69: * jpayne@69: * cpdef get_encoding_error_handler(): jpayne@69: * return ERROR_HANDLER # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * cpdef set_encoding_error_handler(name): jpayne@69: */ jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __Pyx_INCREF(__pyx_v_5pysam_9libcutils_ERROR_HANDLER); jpayne@69: __pyx_r = __pyx_v_5pysam_9libcutils_ERROR_HANDLER; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":98 jpayne@69: * cdef str ERROR_HANDLER = 'strict' jpayne@69: * jpayne@69: * cpdef get_encoding_error_handler(): # <<<<<<<<<<<<<< jpayne@69: * return ERROR_HANDLER jpayne@69: * jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L0:; jpayne@69: __Pyx_XGIVEREF(__pyx_r); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* Python wrapper */ jpayne@69: static PyObject *__pyx_pw_5pysam_9libcutils_9get_encoding_error_handler(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ jpayne@69: static PyMethodDef __pyx_mdef_5pysam_9libcutils_9get_encoding_error_handler = {"get_encoding_error_handler", (PyCFunction)__pyx_pw_5pysam_9libcutils_9get_encoding_error_handler, METH_NOARGS, 0}; jpayne@69: static PyObject *__pyx_pw_5pysam_9libcutils_9get_encoding_error_handler(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { jpayne@69: CYTHON_UNUSED PyObject *const *__pyx_kwvalues; jpayne@69: PyObject *__pyx_r = 0; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: __Pyx_RefNannySetupContext("get_encoding_error_handler (wrapper)", 0); jpayne@69: __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); jpayne@69: __pyx_r = __pyx_pf_5pysam_9libcutils_8get_encoding_error_handler(__pyx_self); jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: static PyObject *__pyx_pf_5pysam_9libcutils_8get_encoding_error_handler(CYTHON_UNUSED PyObject *__pyx_self) { jpayne@69: PyObject *__pyx_r = NULL; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: PyObject *__pyx_t_1 = NULL; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: __Pyx_RefNannySetupContext("get_encoding_error_handler", 1); jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __pyx_t_1 = __pyx_f_5pysam_9libcutils_get_encoding_error_handler(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_1); jpayne@69: __pyx_r = __pyx_t_1; jpayne@69: __pyx_t_1 = 0; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_1); jpayne@69: __Pyx_AddTraceback("pysam.libcutils.get_encoding_error_handler", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __pyx_r = NULL; jpayne@69: __pyx_L0:; jpayne@69: __Pyx_XGIVEREF(__pyx_r); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":101 jpayne@69: * return ERROR_HANDLER jpayne@69: * jpayne@69: * cpdef set_encoding_error_handler(name): # <<<<<<<<<<<<<< jpayne@69: * global ERROR_HANDLER jpayne@69: * previous = ERROR_HANDLER jpayne@69: */ jpayne@69: jpayne@69: static PyObject *__pyx_pw_5pysam_9libcutils_11set_encoding_error_handler(PyObject *__pyx_self, jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds jpayne@69: #else jpayne@69: PyObject *__pyx_args, PyObject *__pyx_kwds jpayne@69: #endif jpayne@69: ); /*proto*/ jpayne@69: static PyObject *__pyx_f_5pysam_9libcutils_set_encoding_error_handler(PyObject *__pyx_v_name, CYTHON_UNUSED int __pyx_skip_dispatch) { jpayne@69: PyObject *__pyx_v_previous = NULL; jpayne@69: PyObject *__pyx_r = NULL; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: PyObject *__pyx_t_1 = NULL; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: __Pyx_RefNannySetupContext("set_encoding_error_handler", 1); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":103 jpayne@69: * cpdef set_encoding_error_handler(name): jpayne@69: * global ERROR_HANDLER jpayne@69: * previous = ERROR_HANDLER # <<<<<<<<<<<<<< jpayne@69: * ERROR_HANDLER = name jpayne@69: * return previous jpayne@69: */ jpayne@69: __Pyx_INCREF(__pyx_v_5pysam_9libcutils_ERROR_HANDLER); jpayne@69: __pyx_v_previous = __pyx_v_5pysam_9libcutils_ERROR_HANDLER; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":104 jpayne@69: * global ERROR_HANDLER jpayne@69: * previous = ERROR_HANDLER jpayne@69: * ERROR_HANDLER = name # <<<<<<<<<<<<<< jpayne@69: * return previous jpayne@69: * jpayne@69: */ jpayne@69: if (!(likely(PyUnicode_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_name))) __PYX_ERR(0, 104, __pyx_L1_error) jpayne@69: __pyx_t_1 = __pyx_v_name; jpayne@69: __Pyx_INCREF(__pyx_t_1); jpayne@69: __Pyx_XGOTREF(__pyx_v_5pysam_9libcutils_ERROR_HANDLER); jpayne@69: __Pyx_DECREF_SET(__pyx_v_5pysam_9libcutils_ERROR_HANDLER, ((PyObject*)__pyx_t_1)); jpayne@69: __Pyx_GIVEREF(__pyx_t_1); jpayne@69: __pyx_t_1 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":105 jpayne@69: * previous = ERROR_HANDLER jpayne@69: * ERROR_HANDLER = name jpayne@69: * return previous # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * ######################################################################## jpayne@69: */ jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __Pyx_INCREF(__pyx_v_previous); jpayne@69: __pyx_r = __pyx_v_previous; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":101 jpayne@69: * return ERROR_HANDLER jpayne@69: * jpayne@69: * cpdef set_encoding_error_handler(name): # <<<<<<<<<<<<<< jpayne@69: * global ERROR_HANDLER jpayne@69: * previous = ERROR_HANDLER jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_1); jpayne@69: __Pyx_AddTraceback("pysam.libcutils.set_encoding_error_handler", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __pyx_r = 0; jpayne@69: __pyx_L0:; jpayne@69: __Pyx_XDECREF(__pyx_v_previous); jpayne@69: __Pyx_XGIVEREF(__pyx_r); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* Python wrapper */ jpayne@69: static PyObject *__pyx_pw_5pysam_9libcutils_11set_encoding_error_handler(PyObject *__pyx_self, jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds jpayne@69: #else jpayne@69: PyObject *__pyx_args, PyObject *__pyx_kwds jpayne@69: #endif jpayne@69: ); /*proto*/ jpayne@69: static PyMethodDef __pyx_mdef_5pysam_9libcutils_11set_encoding_error_handler = {"set_encoding_error_handler", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcutils_11set_encoding_error_handler, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; jpayne@69: static PyObject *__pyx_pw_5pysam_9libcutils_11set_encoding_error_handler(PyObject *__pyx_self, jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds jpayne@69: #else jpayne@69: PyObject *__pyx_args, PyObject *__pyx_kwds jpayne@69: #endif jpayne@69: ) { jpayne@69: PyObject *__pyx_v_name = 0; jpayne@69: #if !CYTHON_METH_FASTCALL jpayne@69: CYTHON_UNUSED Py_ssize_t __pyx_nargs; jpayne@69: #endif jpayne@69: CYTHON_UNUSED PyObject *const *__pyx_kwvalues; jpayne@69: PyObject* values[1] = {0}; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: PyObject *__pyx_r = 0; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: __Pyx_RefNannySetupContext("set_encoding_error_handler (wrapper)", 0); jpayne@69: #if !CYTHON_METH_FASTCALL jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS jpayne@69: __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); jpayne@69: #else jpayne@69: __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; jpayne@69: #endif jpayne@69: #endif jpayne@69: __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); jpayne@69: { jpayne@69: PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; jpayne@69: if (__pyx_kwds) { jpayne@69: Py_ssize_t kw_args; jpayne@69: switch (__pyx_nargs) { jpayne@69: case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 0: break; jpayne@69: default: goto __pyx_L5_argtuple_error; jpayne@69: } jpayne@69: kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); jpayne@69: switch (__pyx_nargs) { jpayne@69: case 0: jpayne@69: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { jpayne@69: (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); jpayne@69: kw_args--; jpayne@69: } jpayne@69: else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L3_error) jpayne@69: else goto __pyx_L5_argtuple_error; jpayne@69: } jpayne@69: if (unlikely(kw_args > 0)) { jpayne@69: const Py_ssize_t kwd_pos_args = __pyx_nargs; jpayne@69: if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_encoding_error_handler") < 0)) __PYX_ERR(0, 101, __pyx_L3_error) jpayne@69: } jpayne@69: } else if (unlikely(__pyx_nargs != 1)) { jpayne@69: goto __pyx_L5_argtuple_error; jpayne@69: } else { jpayne@69: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); jpayne@69: } jpayne@69: __pyx_v_name = values[0]; jpayne@69: } jpayne@69: goto __pyx_L6_skip; jpayne@69: __pyx_L5_argtuple_error:; jpayne@69: __Pyx_RaiseArgtupleInvalid("set_encoding_error_handler", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 101, __pyx_L3_error) jpayne@69: __pyx_L6_skip:; jpayne@69: goto __pyx_L4_argument_unpacking_done; jpayne@69: __pyx_L3_error:; jpayne@69: { jpayne@69: Py_ssize_t __pyx_temp; jpayne@69: for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { jpayne@69: __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); jpayne@69: } jpayne@69: } jpayne@69: __Pyx_AddTraceback("pysam.libcutils.set_encoding_error_handler", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return NULL; jpayne@69: __pyx_L4_argument_unpacking_done:; jpayne@69: __pyx_r = __pyx_pf_5pysam_9libcutils_10set_encoding_error_handler(__pyx_self, __pyx_v_name); jpayne@69: jpayne@69: /* function exit code */ jpayne@69: { jpayne@69: Py_ssize_t __pyx_temp; jpayne@69: for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { jpayne@69: __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); jpayne@69: } jpayne@69: } jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: static PyObject *__pyx_pf_5pysam_9libcutils_10set_encoding_error_handler(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) { jpayne@69: PyObject *__pyx_r = NULL; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: PyObject *__pyx_t_1 = NULL; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: __Pyx_RefNannySetupContext("set_encoding_error_handler", 1); jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __pyx_t_1 = __pyx_f_5pysam_9libcutils_set_encoding_error_handler(__pyx_v_name, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_1); jpayne@69: __pyx_r = __pyx_t_1; jpayne@69: __pyx_t_1 = 0; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_1); jpayne@69: __Pyx_AddTraceback("pysam.libcutils.set_encoding_error_handler", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __pyx_r = NULL; jpayne@69: __pyx_L0:; jpayne@69: __Pyx_XGIVEREF(__pyx_r); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":111 jpayne@69: * ######################################################################## jpayne@69: * jpayne@69: * cdef from_string_and_size(const char* s, size_t length): # <<<<<<<<<<<<<< jpayne@69: * return s[:length].decode('utf-8', ERROR_HANDLER) jpayne@69: * jpayne@69: */ jpayne@69: jpayne@69: static PyObject *__pyx_f_5pysam_9libcutils_from_string_and_size(char const *__pyx_v_s, size_t __pyx_v_length) { jpayne@69: PyObject *__pyx_r = NULL; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: PyObject *__pyx_t_1 = NULL; jpayne@69: PyObject *__pyx_t_2 = NULL; jpayne@69: PyObject *__pyx_t_3 = NULL; jpayne@69: unsigned int __pyx_t_4; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: __Pyx_RefNannySetupContext("from_string_and_size", 1); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":112 jpayne@69: * jpayne@69: * cdef from_string_and_size(const char* s, size_t length): jpayne@69: * return s[:length].decode('utf-8', ERROR_HANDLER) # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * # filename encoding (adapted from lxml.etree.pyx) jpayne@69: */ jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s + 0, __pyx_v_length - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_decode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 112, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: __pyx_t_2 = NULL; jpayne@69: __pyx_t_4 = 0; jpayne@69: #if CYTHON_UNPACK_METHODS jpayne@69: if (likely(PyMethod_Check(__pyx_t_3))) { jpayne@69: __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); jpayne@69: if (likely(__pyx_t_2)) { jpayne@69: PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); jpayne@69: __Pyx_INCREF(__pyx_t_2); jpayne@69: __Pyx_INCREF(function); jpayne@69: __Pyx_DECREF_SET(__pyx_t_3, function); jpayne@69: __pyx_t_4 = 1; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: { jpayne@69: PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_kp_u_utf_8, __pyx_v_5pysam_9libcutils_ERROR_HANDLER}; jpayne@69: __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); jpayne@69: __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_1); jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: } jpayne@69: __pyx_r = __pyx_t_1; jpayne@69: __pyx_t_1 = 0; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":111 jpayne@69: * ######################################################################## jpayne@69: * jpayne@69: * cdef from_string_and_size(const char* s, size_t length): # <<<<<<<<<<<<<< jpayne@69: * return s[:length].decode('utf-8', ERROR_HANDLER) jpayne@69: * jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_1); jpayne@69: __Pyx_XDECREF(__pyx_t_2); jpayne@69: __Pyx_XDECREF(__pyx_t_3); jpayne@69: __Pyx_AddTraceback("pysam.libcutils.from_string_and_size", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __pyx_r = 0; jpayne@69: __pyx_L0:; jpayne@69: __Pyx_XGIVEREF(__pyx_r); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":118 jpayne@69: * cdef str TEXT_ENCODING = 'utf-8' jpayne@69: * jpayne@69: * cdef bytes encode_filename(object filename): # <<<<<<<<<<<<<< jpayne@69: * """Make sure a filename is 8-bit encoded (or None).""" jpayne@69: * if filename is None: jpayne@69: */ jpayne@69: jpayne@69: static PyObject *__pyx_f_5pysam_9libcutils_encode_filename(PyObject *__pyx_v_filename) { jpayne@69: PyObject *__pyx_r = NULL; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: int __pyx_t_1; jpayne@69: PyObject *__pyx_t_2 = NULL; jpayne@69: PyObject *__pyx_t_3 = NULL; jpayne@69: PyObject *__pyx_t_4 = NULL; jpayne@69: unsigned int __pyx_t_5; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: __Pyx_RefNannySetupContext("encode_filename", 1); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":120 jpayne@69: * cdef bytes encode_filename(object filename): jpayne@69: * """Make sure a filename is 8-bit encoded (or None).""" jpayne@69: * if filename is None: # <<<<<<<<<<<<<< jpayne@69: * return None jpayne@69: * return os.fsencode(filename) jpayne@69: */ jpayne@69: __pyx_t_1 = (__pyx_v_filename == Py_None); jpayne@69: if (__pyx_t_1) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":121 jpayne@69: * """Make sure a filename is 8-bit encoded (or None).""" jpayne@69: * if filename is None: jpayne@69: * return None # <<<<<<<<<<<<<< jpayne@69: * return os.fsencode(filename) jpayne@69: * jpayne@69: */ jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":120 jpayne@69: * cdef bytes encode_filename(object filename): jpayne@69: * """Make sure a filename is 8-bit encoded (or None).""" jpayne@69: * if filename is None: # <<<<<<<<<<<<<< jpayne@69: * return None jpayne@69: * return os.fsencode(filename) jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":122 jpayne@69: * if filename is None: jpayne@69: * return None jpayne@69: * return os.fsencode(filename) # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * jpayne@69: */ jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fsencode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_4); jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: __pyx_t_3 = NULL; jpayne@69: __pyx_t_5 = 0; jpayne@69: #if CYTHON_UNPACK_METHODS jpayne@69: if (unlikely(PyMethod_Check(__pyx_t_4))) { jpayne@69: __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); jpayne@69: if (likely(__pyx_t_3)) { jpayne@69: PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); jpayne@69: __Pyx_INCREF(__pyx_t_3); jpayne@69: __Pyx_INCREF(function); jpayne@69: __Pyx_DECREF_SET(__pyx_t_4, function); jpayne@69: __pyx_t_5 = 1; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: { jpayne@69: PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_filename}; jpayne@69: __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); jpayne@69: __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; jpayne@69: } jpayne@69: if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_2))) __PYX_ERR(0, 122, __pyx_L1_error) jpayne@69: __pyx_r = ((PyObject*)__pyx_t_2); jpayne@69: __pyx_t_2 = 0; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":118 jpayne@69: * cdef str TEXT_ENCODING = 'utf-8' jpayne@69: * jpayne@69: * cdef bytes encode_filename(object filename): # <<<<<<<<<<<<<< jpayne@69: * """Make sure a filename is 8-bit encoded (or None).""" jpayne@69: * if filename is None: jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_2); jpayne@69: __Pyx_XDECREF(__pyx_t_3); jpayne@69: __Pyx_XDECREF(__pyx_t_4); jpayne@69: __Pyx_AddTraceback("pysam.libcutils.encode_filename", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __pyx_r = 0; jpayne@69: __pyx_L0:; jpayne@69: __Pyx_XGIVEREF(__pyx_r); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":125 jpayne@69: * jpayne@69: * jpayne@69: * cdef bytes force_bytes(object s, encoding=None, errors=None): # <<<<<<<<<<<<<< jpayne@69: * """convert string or unicode object to bytes, assuming jpayne@69: * utf8 encoding. jpayne@69: */ jpayne@69: jpayne@69: static PyObject *__pyx_f_5pysam_9libcutils_force_bytes(PyObject *__pyx_v_s, struct __pyx_opt_args_5pysam_9libcutils_force_bytes *__pyx_optional_args) { jpayne@69: PyObject *__pyx_v_encoding = ((PyObject *)Py_None); jpayne@69: PyObject *__pyx_v_errors = ((PyObject *)Py_None); jpayne@69: PyObject *__pyx_r = NULL; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: int __pyx_t_1; jpayne@69: PyObject *__pyx_t_2 = NULL; jpayne@69: PyObject *__pyx_t_3 = NULL; jpayne@69: PyObject *__pyx_t_4 = NULL; jpayne@69: PyObject *__pyx_t_5 = NULL; jpayne@69: PyObject *__pyx_t_6 = NULL; jpayne@69: unsigned int __pyx_t_7; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: __Pyx_RefNannySetupContext("force_bytes", 1); jpayne@69: if (__pyx_optional_args) { jpayne@69: if (__pyx_optional_args->__pyx_n > 0) { jpayne@69: __pyx_v_encoding = __pyx_optional_args->encoding; jpayne@69: if (__pyx_optional_args->__pyx_n > 1) { jpayne@69: __pyx_v_errors = __pyx_optional_args->errors; jpayne@69: } jpayne@69: } jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":129 jpayne@69: * utf8 encoding. jpayne@69: * """ jpayne@69: * if s is None: # <<<<<<<<<<<<<< jpayne@69: * return None jpayne@69: * elif PyBytes_Check(s): jpayne@69: */ jpayne@69: __pyx_t_1 = (__pyx_v_s == Py_None); jpayne@69: if (__pyx_t_1) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":130 jpayne@69: * """ jpayne@69: * if s is None: jpayne@69: * return None # <<<<<<<<<<<<<< jpayne@69: * elif PyBytes_Check(s): jpayne@69: * return s jpayne@69: */ jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":129 jpayne@69: * utf8 encoding. jpayne@69: * """ jpayne@69: * if s is None: # <<<<<<<<<<<<<< jpayne@69: * return None jpayne@69: * elif PyBytes_Check(s): jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":131 jpayne@69: * if s is None: jpayne@69: * return None jpayne@69: * elif PyBytes_Check(s): # <<<<<<<<<<<<<< jpayne@69: * return s jpayne@69: * elif PyUnicode_Check(s): jpayne@69: */ jpayne@69: __pyx_t_1 = PyBytes_Check(__pyx_v_s); jpayne@69: if (__pyx_t_1) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":132 jpayne@69: * return None jpayne@69: * elif PyBytes_Check(s): jpayne@69: * return s # <<<<<<<<<<<<<< jpayne@69: * elif PyUnicode_Check(s): jpayne@69: * return s.encode(encoding or TEXT_ENCODING, errors or ERROR_HANDLER) jpayne@69: */ jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: if (!(likely(PyBytes_CheckExact(__pyx_v_s))||((__pyx_v_s) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_v_s))) __PYX_ERR(0, 132, __pyx_L1_error) jpayne@69: __Pyx_INCREF(__pyx_v_s); jpayne@69: __pyx_r = ((PyObject*)__pyx_v_s); jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":131 jpayne@69: * if s is None: jpayne@69: * return None jpayne@69: * elif PyBytes_Check(s): # <<<<<<<<<<<<<< jpayne@69: * return s jpayne@69: * elif PyUnicode_Check(s): jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":133 jpayne@69: * elif PyBytes_Check(s): jpayne@69: * return s jpayne@69: * elif PyUnicode_Check(s): # <<<<<<<<<<<<<< jpayne@69: * return s.encode(encoding or TEXT_ENCODING, errors or ERROR_HANDLER) jpayne@69: * else: jpayne@69: */ jpayne@69: __pyx_t_1 = PyUnicode_Check(__pyx_v_s); jpayne@69: if (likely(__pyx_t_1)) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":134 jpayne@69: * return s jpayne@69: * elif PyUnicode_Check(s): jpayne@69: * return s.encode(encoding or TEXT_ENCODING, errors or ERROR_HANDLER) # <<<<<<<<<<<<<< jpayne@69: * else: jpayne@69: * raise TypeError("Argument must be string, bytes or unicode.") jpayne@69: */ jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_encoding); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 134, __pyx_L1_error) jpayne@69: if (!__pyx_t_1) { jpayne@69: } else { jpayne@69: __Pyx_INCREF(__pyx_v_encoding); jpayne@69: __pyx_t_4 = __pyx_v_encoding; jpayne@69: goto __pyx_L4_bool_binop_done; jpayne@69: } jpayne@69: __Pyx_INCREF(__pyx_v_5pysam_9libcutils_TEXT_ENCODING); jpayne@69: __pyx_t_4 = __pyx_v_5pysam_9libcutils_TEXT_ENCODING; jpayne@69: __pyx_L4_bool_binop_done:; jpayne@69: __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_errors); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 134, __pyx_L1_error) jpayne@69: if (!__pyx_t_1) { jpayne@69: } else { jpayne@69: __Pyx_INCREF(__pyx_v_errors); jpayne@69: __pyx_t_5 = __pyx_v_errors; jpayne@69: goto __pyx_L6_bool_binop_done; jpayne@69: } jpayne@69: __Pyx_INCREF(__pyx_v_5pysam_9libcutils_ERROR_HANDLER); jpayne@69: __pyx_t_5 = __pyx_v_5pysam_9libcutils_ERROR_HANDLER; jpayne@69: __pyx_L6_bool_binop_done:; jpayne@69: __pyx_t_6 = NULL; jpayne@69: __pyx_t_7 = 0; jpayne@69: #if CYTHON_UNPACK_METHODS jpayne@69: if (likely(PyMethod_Check(__pyx_t_3))) { jpayne@69: __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); jpayne@69: if (likely(__pyx_t_6)) { jpayne@69: PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); jpayne@69: __Pyx_INCREF(__pyx_t_6); jpayne@69: __Pyx_INCREF(function); jpayne@69: __Pyx_DECREF_SET(__pyx_t_3, function); jpayne@69: __pyx_t_7 = 1; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: { jpayne@69: PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5}; jpayne@69: __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); jpayne@69: __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; jpayne@69: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; jpayne@69: __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; jpayne@69: if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: } jpayne@69: if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_2))) __PYX_ERR(0, 134, __pyx_L1_error) jpayne@69: __pyx_r = ((PyObject*)__pyx_t_2); jpayne@69: __pyx_t_2 = 0; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":133 jpayne@69: * elif PyBytes_Check(s): jpayne@69: * return s jpayne@69: * elif PyUnicode_Check(s): # <<<<<<<<<<<<<< jpayne@69: * return s.encode(encoding or TEXT_ENCODING, errors or ERROR_HANDLER) jpayne@69: * else: jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":136 jpayne@69: * return s.encode(encoding or TEXT_ENCODING, errors or ERROR_HANDLER) jpayne@69: * else: jpayne@69: * raise TypeError("Argument must be string, bytes or unicode.") # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * jpayne@69: */ jpayne@69: /*else*/ { jpayne@69: __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __Pyx_Raise(__pyx_t_2, 0, 0, 0); jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: __PYX_ERR(0, 136, __pyx_L1_error) jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":125 jpayne@69: * jpayne@69: * jpayne@69: * cdef bytes force_bytes(object s, encoding=None, errors=None): # <<<<<<<<<<<<<< jpayne@69: * """convert string or unicode object to bytes, assuming jpayne@69: * utf8 encoding. jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_2); jpayne@69: __Pyx_XDECREF(__pyx_t_3); jpayne@69: __Pyx_XDECREF(__pyx_t_4); jpayne@69: __Pyx_XDECREF(__pyx_t_5); jpayne@69: __Pyx_XDECREF(__pyx_t_6); jpayne@69: __Pyx_AddTraceback("pysam.libcutils.force_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __pyx_r = 0; jpayne@69: __pyx_L0:; jpayne@69: __Pyx_XGIVEREF(__pyx_r); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":139 jpayne@69: * jpayne@69: * jpayne@69: * cdef charptr_to_str(const char* s, encoding=None, errors=None): # <<<<<<<<<<<<<< jpayne@69: * if s == NULL: jpayne@69: * return None jpayne@69: */ jpayne@69: jpayne@69: static PyObject *__pyx_f_5pysam_9libcutils_charptr_to_str(char const *__pyx_v_s, struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str *__pyx_optional_args) { jpayne@69: PyObject *__pyx_v_encoding = ((PyObject *)Py_None); jpayne@69: PyObject *__pyx_v_errors = ((PyObject *)Py_None); jpayne@69: PyObject *__pyx_r = NULL; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: int __pyx_t_1; jpayne@69: PyObject *__pyx_t_2 = NULL; jpayne@69: PyObject *__pyx_t_3 = NULL; jpayne@69: PyObject *__pyx_t_4 = NULL; jpayne@69: PyObject *__pyx_t_5 = NULL; jpayne@69: PyObject *__pyx_t_6 = NULL; jpayne@69: unsigned int __pyx_t_7; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: __Pyx_RefNannySetupContext("charptr_to_str", 1); jpayne@69: if (__pyx_optional_args) { jpayne@69: if (__pyx_optional_args->__pyx_n > 0) { jpayne@69: __pyx_v_encoding = __pyx_optional_args->encoding; jpayne@69: if (__pyx_optional_args->__pyx_n > 1) { jpayne@69: __pyx_v_errors = __pyx_optional_args->errors; jpayne@69: } jpayne@69: } jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":140 jpayne@69: * jpayne@69: * cdef charptr_to_str(const char* s, encoding=None, errors=None): jpayne@69: * if s == NULL: # <<<<<<<<<<<<<< jpayne@69: * return None jpayne@69: * return s.decode(encoding or TEXT_ENCODING, errors or ERROR_HANDLER) jpayne@69: */ jpayne@69: __pyx_t_1 = (__pyx_v_s == NULL); jpayne@69: if (__pyx_t_1) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":141 jpayne@69: * cdef charptr_to_str(const char* s, encoding=None, errors=None): jpayne@69: * if s == NULL: jpayne@69: * return None # <<<<<<<<<<<<<< jpayne@69: * return s.decode(encoding or TEXT_ENCODING, errors or ERROR_HANDLER) jpayne@69: * jpayne@69: */ jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __pyx_r = Py_None; __Pyx_INCREF(Py_None); jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":140 jpayne@69: * jpayne@69: * cdef charptr_to_str(const char* s, encoding=None, errors=None): jpayne@69: * if s == NULL: # <<<<<<<<<<<<<< jpayne@69: * return None jpayne@69: * return s.decode(encoding or TEXT_ENCODING, errors or ERROR_HANDLER) jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":142 jpayne@69: * if s == NULL: jpayne@69: * return None jpayne@69: * return s.decode(encoding or TEXT_ENCODING, errors or ERROR_HANDLER) # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * jpayne@69: */ jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_s); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_4); jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_encoding); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 142, __pyx_L1_error) jpayne@69: if (!__pyx_t_1) { jpayne@69: } else { jpayne@69: __Pyx_INCREF(__pyx_v_encoding); jpayne@69: __pyx_t_3 = __pyx_v_encoding; jpayne@69: goto __pyx_L4_bool_binop_done; jpayne@69: } jpayne@69: __Pyx_INCREF(__pyx_v_5pysam_9libcutils_TEXT_ENCODING); jpayne@69: __pyx_t_3 = __pyx_v_5pysam_9libcutils_TEXT_ENCODING; jpayne@69: __pyx_L4_bool_binop_done:; jpayne@69: __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_errors); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 142, __pyx_L1_error) jpayne@69: if (!__pyx_t_1) { jpayne@69: } else { jpayne@69: __Pyx_INCREF(__pyx_v_errors); jpayne@69: __pyx_t_5 = __pyx_v_errors; jpayne@69: goto __pyx_L6_bool_binop_done; jpayne@69: } jpayne@69: __Pyx_INCREF(__pyx_v_5pysam_9libcutils_ERROR_HANDLER); jpayne@69: __pyx_t_5 = __pyx_v_5pysam_9libcutils_ERROR_HANDLER; jpayne@69: __pyx_L6_bool_binop_done:; jpayne@69: __pyx_t_6 = NULL; jpayne@69: __pyx_t_7 = 0; jpayne@69: #if CYTHON_UNPACK_METHODS jpayne@69: if (likely(PyMethod_Check(__pyx_t_4))) { jpayne@69: __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); jpayne@69: if (likely(__pyx_t_6)) { jpayne@69: PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); jpayne@69: __Pyx_INCREF(__pyx_t_6); jpayne@69: __Pyx_INCREF(function); jpayne@69: __Pyx_DECREF_SET(__pyx_t_4, function); jpayne@69: __pyx_t_7 = 1; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: { jpayne@69: PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_5}; jpayne@69: __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); jpayne@69: __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; jpayne@69: if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; jpayne@69: } jpayne@69: __pyx_r = __pyx_t_2; jpayne@69: __pyx_t_2 = 0; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":139 jpayne@69: * jpayne@69: * jpayne@69: * cdef charptr_to_str(const char* s, encoding=None, errors=None): # <<<<<<<<<<<<<< jpayne@69: * if s == NULL: jpayne@69: * return None jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_2); jpayne@69: __Pyx_XDECREF(__pyx_t_3); jpayne@69: __Pyx_XDECREF(__pyx_t_4); jpayne@69: __Pyx_XDECREF(__pyx_t_5); jpayne@69: __Pyx_XDECREF(__pyx_t_6); jpayne@69: __Pyx_AddTraceback("pysam.libcutils.charptr_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __pyx_r = 0; jpayne@69: __pyx_L0:; jpayne@69: __Pyx_XGIVEREF(__pyx_r); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":145 jpayne@69: * jpayne@69: * jpayne@69: * cdef charptr_to_str_w_len(const char* s, size_t n, encoding=None, errors=None): # <<<<<<<<<<<<<< jpayne@69: * if s == NULL: jpayne@69: * return None jpayne@69: */ jpayne@69: jpayne@69: static PyObject *__pyx_f_5pysam_9libcutils_charptr_to_str_w_len(char const *__pyx_v_s, size_t __pyx_v_n, struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str_w_len *__pyx_optional_args) { jpayne@69: PyObject *__pyx_v_encoding = ((PyObject *)Py_None); jpayne@69: PyObject *__pyx_v_errors = ((PyObject *)Py_None); jpayne@69: PyObject *__pyx_r = NULL; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: int __pyx_t_1; jpayne@69: PyObject *__pyx_t_2 = NULL; jpayne@69: PyObject *__pyx_t_3 = NULL; jpayne@69: PyObject *__pyx_t_4 = NULL; jpayne@69: PyObject *__pyx_t_5 = NULL; jpayne@69: PyObject *__pyx_t_6 = NULL; jpayne@69: unsigned int __pyx_t_7; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: __Pyx_RefNannySetupContext("charptr_to_str_w_len", 1); jpayne@69: if (__pyx_optional_args) { jpayne@69: if (__pyx_optional_args->__pyx_n > 0) { jpayne@69: __pyx_v_encoding = __pyx_optional_args->encoding; jpayne@69: if (__pyx_optional_args->__pyx_n > 1) { jpayne@69: __pyx_v_errors = __pyx_optional_args->errors; jpayne@69: } jpayne@69: } jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":146 jpayne@69: * jpayne@69: * cdef charptr_to_str_w_len(const char* s, size_t n, encoding=None, errors=None): jpayne@69: * if s == NULL: # <<<<<<<<<<<<<< jpayne@69: * return None jpayne@69: * return s[:n].decode(encoding or TEXT_ENCODING, errors or ERROR_HANDLER) jpayne@69: */ jpayne@69: __pyx_t_1 = (__pyx_v_s == NULL); jpayne@69: if (__pyx_t_1) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":147 jpayne@69: * cdef charptr_to_str_w_len(const char* s, size_t n, encoding=None, errors=None): jpayne@69: * if s == NULL: jpayne@69: * return None # <<<<<<<<<<<<<< jpayne@69: * return s[:n].decode(encoding or TEXT_ENCODING, errors or ERROR_HANDLER) jpayne@69: * jpayne@69: */ jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __pyx_r = Py_None; __Pyx_INCREF(Py_None); jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":146 jpayne@69: * jpayne@69: * cdef charptr_to_str_w_len(const char* s, size_t n, encoding=None, errors=None): jpayne@69: * if s == NULL: # <<<<<<<<<<<<<< jpayne@69: * return None jpayne@69: * return s[:n].decode(encoding or TEXT_ENCODING, errors or ERROR_HANDLER) jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":148 jpayne@69: * if s == NULL: jpayne@69: * return None jpayne@69: * return s[:n].decode(encoding or TEXT_ENCODING, errors or ERROR_HANDLER) # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * jpayne@69: */ jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __pyx_t_3 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s + 0, __pyx_v_n - 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_4); jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_encoding); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 148, __pyx_L1_error) jpayne@69: if (!__pyx_t_1) { jpayne@69: } else { jpayne@69: __Pyx_INCREF(__pyx_v_encoding); jpayne@69: __pyx_t_3 = __pyx_v_encoding; jpayne@69: goto __pyx_L4_bool_binop_done; jpayne@69: } jpayne@69: __Pyx_INCREF(__pyx_v_5pysam_9libcutils_TEXT_ENCODING); jpayne@69: __pyx_t_3 = __pyx_v_5pysam_9libcutils_TEXT_ENCODING; jpayne@69: __pyx_L4_bool_binop_done:; jpayne@69: __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_errors); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 148, __pyx_L1_error) jpayne@69: if (!__pyx_t_1) { jpayne@69: } else { jpayne@69: __Pyx_INCREF(__pyx_v_errors); jpayne@69: __pyx_t_5 = __pyx_v_errors; jpayne@69: goto __pyx_L6_bool_binop_done; jpayne@69: } jpayne@69: __Pyx_INCREF(__pyx_v_5pysam_9libcutils_ERROR_HANDLER); jpayne@69: __pyx_t_5 = __pyx_v_5pysam_9libcutils_ERROR_HANDLER; jpayne@69: __pyx_L6_bool_binop_done:; jpayne@69: __pyx_t_6 = NULL; jpayne@69: __pyx_t_7 = 0; jpayne@69: #if CYTHON_UNPACK_METHODS jpayne@69: if (likely(PyMethod_Check(__pyx_t_4))) { jpayne@69: __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); jpayne@69: if (likely(__pyx_t_6)) { jpayne@69: PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); jpayne@69: __Pyx_INCREF(__pyx_t_6); jpayne@69: __Pyx_INCREF(function); jpayne@69: __Pyx_DECREF_SET(__pyx_t_4, function); jpayne@69: __pyx_t_7 = 1; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: { jpayne@69: PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_5}; jpayne@69: __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); jpayne@69: __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; jpayne@69: if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; jpayne@69: } jpayne@69: __pyx_r = __pyx_t_2; jpayne@69: __pyx_t_2 = 0; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":145 jpayne@69: * jpayne@69: * jpayne@69: * cdef charptr_to_str_w_len(const char* s, size_t n, encoding=None, errors=None): # <<<<<<<<<<<<<< jpayne@69: * if s == NULL: jpayne@69: * return None jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_2); jpayne@69: __Pyx_XDECREF(__pyx_t_3); jpayne@69: __Pyx_XDECREF(__pyx_t_4); jpayne@69: __Pyx_XDECREF(__pyx_t_5); jpayne@69: __Pyx_XDECREF(__pyx_t_6); jpayne@69: __Pyx_AddTraceback("pysam.libcutils.charptr_to_str_w_len", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __pyx_r = 0; jpayne@69: __pyx_L0:; jpayne@69: __Pyx_XGIVEREF(__pyx_r); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":151 jpayne@69: * jpayne@69: * jpayne@69: * cdef bytes charptr_to_bytes(const char* s, encoding=None, errors=None): # <<<<<<<<<<<<<< jpayne@69: * if s == NULL: jpayne@69: * return None jpayne@69: */ jpayne@69: jpayne@69: static PyObject *__pyx_f_5pysam_9libcutils_charptr_to_bytes(char const *__pyx_v_s, struct __pyx_opt_args_5pysam_9libcutils_charptr_to_bytes *__pyx_optional_args) { jpayne@69: PyObject *__pyx_r = NULL; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: int __pyx_t_1; jpayne@69: PyObject *__pyx_t_2 = NULL; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: __Pyx_RefNannySetupContext("charptr_to_bytes", 1); jpayne@69: if (__pyx_optional_args) { jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":152 jpayne@69: * jpayne@69: * cdef bytes charptr_to_bytes(const char* s, encoding=None, errors=None): jpayne@69: * if s == NULL: # <<<<<<<<<<<<<< jpayne@69: * return None jpayne@69: * else: jpayne@69: */ jpayne@69: __pyx_t_1 = (__pyx_v_s == NULL); jpayne@69: if (__pyx_t_1) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":153 jpayne@69: * cdef bytes charptr_to_bytes(const char* s, encoding=None, errors=None): jpayne@69: * if s == NULL: jpayne@69: * return None # <<<<<<<<<<<<<< jpayne@69: * else: jpayne@69: * return s jpayne@69: */ jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":152 jpayne@69: * jpayne@69: * cdef bytes charptr_to_bytes(const char* s, encoding=None, errors=None): jpayne@69: * if s == NULL: # <<<<<<<<<<<<<< jpayne@69: * return None jpayne@69: * else: jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":155 jpayne@69: * return None jpayne@69: * else: jpayne@69: * return s # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * jpayne@69: */ jpayne@69: /*else*/ { jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __pyx_r = ((PyObject*)__pyx_t_2); jpayne@69: __pyx_t_2 = 0; jpayne@69: goto __pyx_L0; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":151 jpayne@69: * jpayne@69: * jpayne@69: * cdef bytes charptr_to_bytes(const char* s, encoding=None, errors=None): # <<<<<<<<<<<<<< jpayne@69: * if s == NULL: jpayne@69: * return None jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_2); jpayne@69: __Pyx_AddTraceback("pysam.libcutils.charptr_to_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __pyx_r = 0; jpayne@69: __pyx_L0:; jpayne@69: __Pyx_XGIVEREF(__pyx_r); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":158 jpayne@69: * jpayne@69: * jpayne@69: * cdef force_str(object s, encoding=None, errors=None): # <<<<<<<<<<<<<< jpayne@69: * """Return s converted to str type of current Python jpayne@69: * (bytes in Py2, unicode in Py3)""" jpayne@69: */ jpayne@69: jpayne@69: static PyObject *__pyx_f_5pysam_9libcutils_force_str(PyObject *__pyx_v_s, struct __pyx_opt_args_5pysam_9libcutils_force_str *__pyx_optional_args) { jpayne@69: PyObject *__pyx_v_encoding = ((PyObject *)Py_None); jpayne@69: PyObject *__pyx_v_errors = ((PyObject *)Py_None); jpayne@69: PyObject *__pyx_r = NULL; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: int __pyx_t_1; jpayne@69: PyObject *__pyx_t_2 = NULL; jpayne@69: PyObject *__pyx_t_3 = NULL; jpayne@69: PyObject *__pyx_t_4 = NULL; jpayne@69: PyObject *__pyx_t_5 = NULL; jpayne@69: PyObject *__pyx_t_6 = NULL; jpayne@69: unsigned int __pyx_t_7; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: __Pyx_RefNannySetupContext("force_str", 1); jpayne@69: if (__pyx_optional_args) { jpayne@69: if (__pyx_optional_args->__pyx_n > 0) { jpayne@69: __pyx_v_encoding = __pyx_optional_args->encoding; jpayne@69: if (__pyx_optional_args->__pyx_n > 1) { jpayne@69: __pyx_v_errors = __pyx_optional_args->errors; jpayne@69: } jpayne@69: } jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":161 jpayne@69: * """Return s converted to str type of current Python jpayne@69: * (bytes in Py2, unicode in Py3)""" jpayne@69: * if s is None: # <<<<<<<<<<<<<< jpayne@69: * return None jpayne@69: * if PyBytes_Check(s): jpayne@69: */ jpayne@69: __pyx_t_1 = (__pyx_v_s == Py_None); jpayne@69: if (__pyx_t_1) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":162 jpayne@69: * (bytes in Py2, unicode in Py3)""" jpayne@69: * if s is None: jpayne@69: * return None # <<<<<<<<<<<<<< jpayne@69: * if PyBytes_Check(s): jpayne@69: * return s.decode(encoding or TEXT_ENCODING, errors or ERROR_HANDLER) jpayne@69: */ jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __pyx_r = Py_None; __Pyx_INCREF(Py_None); jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":161 jpayne@69: * """Return s converted to str type of current Python jpayne@69: * (bytes in Py2, unicode in Py3)""" jpayne@69: * if s is None: # <<<<<<<<<<<<<< jpayne@69: * return None jpayne@69: * if PyBytes_Check(s): jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":163 jpayne@69: * if s is None: jpayne@69: * return None jpayne@69: * if PyBytes_Check(s): # <<<<<<<<<<<<<< jpayne@69: * return s.decode(encoding or TEXT_ENCODING, errors or ERROR_HANDLER) jpayne@69: * # assume unicode jpayne@69: */ jpayne@69: __pyx_t_1 = PyBytes_Check(__pyx_v_s); jpayne@69: if (__pyx_t_1) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":164 jpayne@69: * return None jpayne@69: * if PyBytes_Check(s): jpayne@69: * return s.decode(encoding or TEXT_ENCODING, errors or ERROR_HANDLER) # <<<<<<<<<<<<<< jpayne@69: * # assume unicode jpayne@69: * return s jpayne@69: */ jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_decode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_encoding); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 164, __pyx_L1_error) jpayne@69: if (!__pyx_t_1) { jpayne@69: } else { jpayne@69: __Pyx_INCREF(__pyx_v_encoding); jpayne@69: __pyx_t_4 = __pyx_v_encoding; jpayne@69: goto __pyx_L5_bool_binop_done; jpayne@69: } jpayne@69: __Pyx_INCREF(__pyx_v_5pysam_9libcutils_TEXT_ENCODING); jpayne@69: __pyx_t_4 = __pyx_v_5pysam_9libcutils_TEXT_ENCODING; jpayne@69: __pyx_L5_bool_binop_done:; jpayne@69: __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_errors); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 164, __pyx_L1_error) jpayne@69: if (!__pyx_t_1) { jpayne@69: } else { jpayne@69: __Pyx_INCREF(__pyx_v_errors); jpayne@69: __pyx_t_5 = __pyx_v_errors; jpayne@69: goto __pyx_L7_bool_binop_done; jpayne@69: } jpayne@69: __Pyx_INCREF(__pyx_v_5pysam_9libcutils_ERROR_HANDLER); jpayne@69: __pyx_t_5 = __pyx_v_5pysam_9libcutils_ERROR_HANDLER; jpayne@69: __pyx_L7_bool_binop_done:; jpayne@69: __pyx_t_6 = NULL; jpayne@69: __pyx_t_7 = 0; jpayne@69: #if CYTHON_UNPACK_METHODS jpayne@69: if (likely(PyMethod_Check(__pyx_t_3))) { jpayne@69: __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); jpayne@69: if (likely(__pyx_t_6)) { jpayne@69: PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); jpayne@69: __Pyx_INCREF(__pyx_t_6); jpayne@69: __Pyx_INCREF(function); jpayne@69: __Pyx_DECREF_SET(__pyx_t_3, function); jpayne@69: __pyx_t_7 = 1; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: { jpayne@69: PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5}; jpayne@69: __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); jpayne@69: __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; jpayne@69: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; jpayne@69: __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; jpayne@69: if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: } jpayne@69: __pyx_r = __pyx_t_2; jpayne@69: __pyx_t_2 = 0; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":163 jpayne@69: * if s is None: jpayne@69: * return None jpayne@69: * if PyBytes_Check(s): # <<<<<<<<<<<<<< jpayne@69: * return s.decode(encoding or TEXT_ENCODING, errors or ERROR_HANDLER) jpayne@69: * # assume unicode jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":166 jpayne@69: * return s.decode(encoding or TEXT_ENCODING, errors or ERROR_HANDLER) jpayne@69: * # assume unicode jpayne@69: * return s # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * jpayne@69: */ jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __Pyx_INCREF(__pyx_v_s); jpayne@69: __pyx_r = __pyx_v_s; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":158 jpayne@69: * jpayne@69: * jpayne@69: * cdef force_str(object s, encoding=None, errors=None): # <<<<<<<<<<<<<< jpayne@69: * """Return s converted to str type of current Python jpayne@69: * (bytes in Py2, unicode in Py3)""" jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_2); jpayne@69: __Pyx_XDECREF(__pyx_t_3); jpayne@69: __Pyx_XDECREF(__pyx_t_4); jpayne@69: __Pyx_XDECREF(__pyx_t_5); jpayne@69: __Pyx_XDECREF(__pyx_t_6); jpayne@69: __Pyx_AddTraceback("pysam.libcutils.force_str", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __pyx_r = 0; jpayne@69: __pyx_L0:; jpayne@69: __Pyx_XGIVEREF(__pyx_r); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":169 jpayne@69: * jpayne@69: * jpayne@69: * cdef decode_bytes(bytes s, encoding=None, errors=None): # <<<<<<<<<<<<<< jpayne@69: * """Return s converted to current Python's str type, jpayne@69: * always decoding even in Python 2""" jpayne@69: */ jpayne@69: jpayne@69: static PyObject *__pyx_f_5pysam_9libcutils_decode_bytes(PyObject *__pyx_v_s, struct __pyx_opt_args_5pysam_9libcutils_decode_bytes *__pyx_optional_args) { jpayne@69: PyObject *__pyx_v_encoding = ((PyObject *)Py_None); jpayne@69: PyObject *__pyx_v_errors = ((PyObject *)Py_None); jpayne@69: PyObject *__pyx_r = NULL; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: int __pyx_t_1; jpayne@69: PyObject *__pyx_t_2 = NULL; jpayne@69: PyObject *__pyx_t_3 = NULL; jpayne@69: PyObject *__pyx_t_4 = NULL; jpayne@69: PyObject *__pyx_t_5 = NULL; jpayne@69: PyObject *__pyx_t_6 = NULL; jpayne@69: unsigned int __pyx_t_7; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: __Pyx_RefNannySetupContext("decode_bytes", 1); jpayne@69: if (__pyx_optional_args) { jpayne@69: if (__pyx_optional_args->__pyx_n > 0) { jpayne@69: __pyx_v_encoding = __pyx_optional_args->encoding; jpayne@69: if (__pyx_optional_args->__pyx_n > 1) { jpayne@69: __pyx_v_errors = __pyx_optional_args->errors; jpayne@69: } jpayne@69: } jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":172 jpayne@69: * """Return s converted to current Python's str type, jpayne@69: * always decoding even in Python 2""" jpayne@69: * if s is None: # <<<<<<<<<<<<<< jpayne@69: * return None jpayne@69: * else: jpayne@69: */ jpayne@69: __pyx_t_1 = (__pyx_v_s == ((PyObject*)Py_None)); jpayne@69: if (__pyx_t_1) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":173 jpayne@69: * always decoding even in Python 2""" jpayne@69: * if s is None: jpayne@69: * return None # <<<<<<<<<<<<<< jpayne@69: * else: jpayne@69: * return s.decode(encoding or TEXT_ENCODING, errors or ERROR_HANDLER) jpayne@69: */ jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __pyx_r = Py_None; __Pyx_INCREF(Py_None); jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":172 jpayne@69: * """Return s converted to current Python's str type, jpayne@69: * always decoding even in Python 2""" jpayne@69: * if s is None: # <<<<<<<<<<<<<< jpayne@69: * return None jpayne@69: * else: jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":175 jpayne@69: * return None jpayne@69: * else: jpayne@69: * return s.decode(encoding or TEXT_ENCODING, errors or ERROR_HANDLER) # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * jpayne@69: */ jpayne@69: /*else*/ { jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_decode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_encoding); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 175, __pyx_L1_error) jpayne@69: if (!__pyx_t_1) { jpayne@69: } else { jpayne@69: __Pyx_INCREF(__pyx_v_encoding); jpayne@69: __pyx_t_4 = __pyx_v_encoding; jpayne@69: goto __pyx_L4_bool_binop_done; jpayne@69: } jpayne@69: __Pyx_INCREF(__pyx_v_5pysam_9libcutils_TEXT_ENCODING); jpayne@69: __pyx_t_4 = __pyx_v_5pysam_9libcutils_TEXT_ENCODING; jpayne@69: __pyx_L4_bool_binop_done:; jpayne@69: __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_errors); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 175, __pyx_L1_error) jpayne@69: if (!__pyx_t_1) { jpayne@69: } else { jpayne@69: __Pyx_INCREF(__pyx_v_errors); jpayne@69: __pyx_t_5 = __pyx_v_errors; jpayne@69: goto __pyx_L6_bool_binop_done; jpayne@69: } jpayne@69: __Pyx_INCREF(__pyx_v_5pysam_9libcutils_ERROR_HANDLER); jpayne@69: __pyx_t_5 = __pyx_v_5pysam_9libcutils_ERROR_HANDLER; jpayne@69: __pyx_L6_bool_binop_done:; jpayne@69: __pyx_t_6 = NULL; jpayne@69: __pyx_t_7 = 0; jpayne@69: #if CYTHON_UNPACK_METHODS jpayne@69: if (likely(PyMethod_Check(__pyx_t_3))) { jpayne@69: __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); jpayne@69: if (likely(__pyx_t_6)) { jpayne@69: PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); jpayne@69: __Pyx_INCREF(__pyx_t_6); jpayne@69: __Pyx_INCREF(function); jpayne@69: __Pyx_DECREF_SET(__pyx_t_3, function); jpayne@69: __pyx_t_7 = 1; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: { jpayne@69: PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5}; jpayne@69: __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); jpayne@69: __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; jpayne@69: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; jpayne@69: __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; jpayne@69: if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: } jpayne@69: __pyx_r = __pyx_t_2; jpayne@69: __pyx_t_2 = 0; jpayne@69: goto __pyx_L0; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":169 jpayne@69: * jpayne@69: * jpayne@69: * cdef decode_bytes(bytes s, encoding=None, errors=None): # <<<<<<<<<<<<<< jpayne@69: * """Return s converted to current Python's str type, jpayne@69: * always decoding even in Python 2""" jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_2); jpayne@69: __Pyx_XDECREF(__pyx_t_3); jpayne@69: __Pyx_XDECREF(__pyx_t_4); jpayne@69: __Pyx_XDECREF(__pyx_t_5); jpayne@69: __Pyx_XDECREF(__pyx_t_6); jpayne@69: __Pyx_AddTraceback("pysam.libcutils.decode_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __pyx_r = 0; jpayne@69: __pyx_L0:; jpayne@69: __Pyx_XGIVEREF(__pyx_r); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":178 jpayne@69: * jpayne@69: * jpayne@69: * cpdef parse_region(contig=None, # <<<<<<<<<<<<<< jpayne@69: * start=None, jpayne@69: * stop=None, jpayne@69: */ jpayne@69: jpayne@69: static PyObject *__pyx_pw_5pysam_9libcutils_13parse_region(PyObject *__pyx_self, jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds jpayne@69: #else jpayne@69: PyObject *__pyx_args, PyObject *__pyx_kwds jpayne@69: #endif jpayne@69: ); /*proto*/ jpayne@69: static PyObject *__pyx_f_5pysam_9libcutils_parse_region(CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_9libcutils_parse_region *__pyx_optional_args) { jpayne@69: PyObject *__pyx_v_contig = ((PyObject *)Py_None); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":179 jpayne@69: * jpayne@69: * cpdef parse_region(contig=None, jpayne@69: * start=None, # <<<<<<<<<<<<<< jpayne@69: * stop=None, jpayne@69: * region=None, jpayne@69: */ jpayne@69: PyObject *__pyx_v_start = ((PyObject *)Py_None); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":180 jpayne@69: * cpdef parse_region(contig=None, jpayne@69: * start=None, jpayne@69: * stop=None, # <<<<<<<<<<<<<< jpayne@69: * region=None, jpayne@69: * reference=None, jpayne@69: */ jpayne@69: PyObject *__pyx_v_stop = ((PyObject *)Py_None); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":181 jpayne@69: * start=None, jpayne@69: * stop=None, jpayne@69: * region=None, # <<<<<<<<<<<<<< jpayne@69: * reference=None, jpayne@69: * end=None): jpayne@69: */ jpayne@69: PyObject *__pyx_v_region = ((PyObject *)Py_None); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":182 jpayne@69: * stop=None, jpayne@69: * region=None, jpayne@69: * reference=None, # <<<<<<<<<<<<<< jpayne@69: * end=None): jpayne@69: * """parse alternative ways to specify a genomic region. A region can jpayne@69: */ jpayne@69: PyObject *__pyx_v_reference = ((PyObject *)Py_None); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":183 jpayne@69: * region=None, jpayne@69: * reference=None, jpayne@69: * end=None): # <<<<<<<<<<<<<< jpayne@69: * """parse alternative ways to specify a genomic region. A region can jpayne@69: * either be specified by :term:`reference`, `start` and jpayne@69: */ jpayne@69: PyObject *__pyx_v_end = ((PyObject *)Py_None); jpayne@69: int32_t __pyx_v_rstart; jpayne@69: int32_t __pyx_v_rstop; jpayne@69: PyObject *__pyx_v_coord = NULL; jpayne@69: PyObject *__pyx_v_parts = NULL; jpayne@69: PyObject *__pyx_r = NULL; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: int __pyx_t_1; jpayne@69: PyObject *__pyx_t_2 = NULL; jpayne@69: int __pyx_t_3; jpayne@69: PyObject *__pyx_t_4 = NULL; jpayne@69: PyObject *__pyx_t_5 = NULL; jpayne@69: PyObject *__pyx_t_6 = NULL; jpayne@69: int32_t __pyx_t_7; jpayne@69: int __pyx_t_8; jpayne@69: PyObject *__pyx_t_9 = NULL; jpayne@69: PyObject *__pyx_t_10 = NULL; jpayne@69: PyObject *__pyx_t_11 = NULL; jpayne@69: PyObject *__pyx_t_12 = NULL; jpayne@69: unsigned int __pyx_t_13; jpayne@69: PyObject *(*__pyx_t_14)(PyObject *); jpayne@69: Py_ssize_t __pyx_t_15; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: __Pyx_RefNannySetupContext("parse_region", 0); jpayne@69: if (__pyx_optional_args) { jpayne@69: if (__pyx_optional_args->__pyx_n > 0) { jpayne@69: __pyx_v_contig = __pyx_optional_args->contig; jpayne@69: if (__pyx_optional_args->__pyx_n > 1) { jpayne@69: __pyx_v_start = __pyx_optional_args->start; jpayne@69: if (__pyx_optional_args->__pyx_n > 2) { jpayne@69: __pyx_v_stop = __pyx_optional_args->stop; jpayne@69: if (__pyx_optional_args->__pyx_n > 3) { jpayne@69: __pyx_v_region = __pyx_optional_args->region; jpayne@69: if (__pyx_optional_args->__pyx_n > 4) { jpayne@69: __pyx_v_reference = __pyx_optional_args->reference; jpayne@69: if (__pyx_optional_args->__pyx_n > 5) { jpayne@69: __pyx_v_end = __pyx_optional_args->end; jpayne@69: } jpayne@69: } jpayne@69: } jpayne@69: } jpayne@69: } jpayne@69: } jpayne@69: } jpayne@69: __Pyx_INCREF(__pyx_v_contig); jpayne@69: __Pyx_INCREF(__pyx_v_stop); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":216 jpayne@69: * jpayne@69: * jpayne@69: * if reference is not None: # <<<<<<<<<<<<<< jpayne@69: * if contig is not None: jpayne@69: * raise ValueError('contig and reference should not both be specified') jpayne@69: */ jpayne@69: __pyx_t_1 = (__pyx_v_reference != Py_None); jpayne@69: if (__pyx_t_1) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":217 jpayne@69: * jpayne@69: * if reference is not None: jpayne@69: * if contig is not None: # <<<<<<<<<<<<<< jpayne@69: * raise ValueError('contig and reference should not both be specified') jpayne@69: * contig = reference jpayne@69: */ jpayne@69: __pyx_t_1 = (__pyx_v_contig != Py_None); jpayne@69: if (unlikely(__pyx_t_1)) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":218 jpayne@69: * if reference is not None: jpayne@69: * if contig is not None: jpayne@69: * raise ValueError('contig and reference should not both be specified') # <<<<<<<<<<<<<< jpayne@69: * contig = reference jpayne@69: * jpayne@69: */ jpayne@69: __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __Pyx_Raise(__pyx_t_2, 0, 0, 0); jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: __PYX_ERR(0, 218, __pyx_L1_error) jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":217 jpayne@69: * jpayne@69: * if reference is not None: jpayne@69: * if contig is not None: # <<<<<<<<<<<<<< jpayne@69: * raise ValueError('contig and reference should not both be specified') jpayne@69: * contig = reference jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":219 jpayne@69: * if contig is not None: jpayne@69: * raise ValueError('contig and reference should not both be specified') jpayne@69: * contig = reference # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * if contig is not None and region is not None: jpayne@69: */ jpayne@69: __Pyx_INCREF(__pyx_v_reference); jpayne@69: __Pyx_DECREF_SET(__pyx_v_contig, __pyx_v_reference); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":216 jpayne@69: * jpayne@69: * jpayne@69: * if reference is not None: # <<<<<<<<<<<<<< jpayne@69: * if contig is not None: jpayne@69: * raise ValueError('contig and reference should not both be specified') jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":221 jpayne@69: * contig = reference jpayne@69: * jpayne@69: * if contig is not None and region is not None: # <<<<<<<<<<<<<< jpayne@69: * raise ValueError('contig/reference and region should not both be specified') jpayne@69: * jpayne@69: */ jpayne@69: __pyx_t_3 = (__pyx_v_contig != Py_None); jpayne@69: if (__pyx_t_3) { jpayne@69: } else { jpayne@69: __pyx_t_1 = __pyx_t_3; jpayne@69: goto __pyx_L6_bool_binop_done; jpayne@69: } jpayne@69: __pyx_t_3 = (__pyx_v_region != Py_None); jpayne@69: __pyx_t_1 = __pyx_t_3; jpayne@69: __pyx_L6_bool_binop_done:; jpayne@69: if (unlikely(__pyx_t_1)) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":222 jpayne@69: * jpayne@69: * if contig is not None and region is not None: jpayne@69: * raise ValueError('contig/reference and region should not both be specified') # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * if end is not None: jpayne@69: */ jpayne@69: __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __Pyx_Raise(__pyx_t_2, 0, 0, 0); jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: __PYX_ERR(0, 222, __pyx_L1_error) jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":221 jpayne@69: * contig = reference jpayne@69: * jpayne@69: * if contig is not None and region is not None: # <<<<<<<<<<<<<< jpayne@69: * raise ValueError('contig/reference and region should not both be specified') jpayne@69: * jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":224 jpayne@69: * raise ValueError('contig/reference and region should not both be specified') jpayne@69: * jpayne@69: * if end is not None: # <<<<<<<<<<<<<< jpayne@69: * if stop is not None: jpayne@69: * raise ValueError('stop and end should not both be specified') jpayne@69: */ jpayne@69: __pyx_t_1 = (__pyx_v_end != Py_None); jpayne@69: if (__pyx_t_1) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":225 jpayne@69: * jpayne@69: * if end is not None: jpayne@69: * if stop is not None: # <<<<<<<<<<<<<< jpayne@69: * raise ValueError('stop and end should not both be specified') jpayne@69: * stop = end jpayne@69: */ jpayne@69: __pyx_t_1 = (__pyx_v_stop != Py_None); jpayne@69: if (unlikely(__pyx_t_1)) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":226 jpayne@69: * if end is not None: jpayne@69: * if stop is not None: jpayne@69: * raise ValueError('stop and end should not both be specified') # <<<<<<<<<<<<<< jpayne@69: * stop = end jpayne@69: * jpayne@69: */ jpayne@69: __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __Pyx_Raise(__pyx_t_2, 0, 0, 0); jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: __PYX_ERR(0, 226, __pyx_L1_error) jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":225 jpayne@69: * jpayne@69: * if end is not None: jpayne@69: * if stop is not None: # <<<<<<<<<<<<<< jpayne@69: * raise ValueError('stop and end should not both be specified') jpayne@69: * stop = end jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":227 jpayne@69: * if stop is not None: jpayne@69: * raise ValueError('stop and end should not both be specified') jpayne@69: * stop = end # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * if contig is None and region is None: jpayne@69: */ jpayne@69: __Pyx_INCREF(__pyx_v_end); jpayne@69: __Pyx_DECREF_SET(__pyx_v_stop, __pyx_v_end); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":224 jpayne@69: * raise ValueError('contig/reference and region should not both be specified') jpayne@69: * jpayne@69: * if end is not None: # <<<<<<<<<<<<<< jpayne@69: * if stop is not None: jpayne@69: * raise ValueError('stop and end should not both be specified') jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":229 jpayne@69: * stop = end jpayne@69: * jpayne@69: * if contig is None and region is None: # <<<<<<<<<<<<<< jpayne@69: * raise ValueError("neither contig nor region are given") jpayne@69: * jpayne@69: */ jpayne@69: __pyx_t_3 = (__pyx_v_contig == Py_None); jpayne@69: if (__pyx_t_3) { jpayne@69: } else { jpayne@69: __pyx_t_1 = __pyx_t_3; jpayne@69: goto __pyx_L11_bool_binop_done; jpayne@69: } jpayne@69: __pyx_t_3 = (__pyx_v_region == Py_None); jpayne@69: __pyx_t_1 = __pyx_t_3; jpayne@69: __pyx_L11_bool_binop_done:; jpayne@69: if (unlikely(__pyx_t_1)) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":230 jpayne@69: * jpayne@69: * if contig is None and region is None: jpayne@69: * raise ValueError("neither contig nor region are given") # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * rstart = 0 jpayne@69: */ jpayne@69: __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __Pyx_Raise(__pyx_t_2, 0, 0, 0); jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: __PYX_ERR(0, 230, __pyx_L1_error) jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":229 jpayne@69: * stop = end jpayne@69: * jpayne@69: * if contig is None and region is None: # <<<<<<<<<<<<<< jpayne@69: * raise ValueError("neither contig nor region are given") jpayne@69: * jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":232 jpayne@69: * raise ValueError("neither contig nor region are given") jpayne@69: * jpayne@69: * rstart = 0 # <<<<<<<<<<<<<< jpayne@69: * rstop = MAX_POS jpayne@69: * if start is not None: jpayne@69: */ jpayne@69: __pyx_v_rstart = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":233 jpayne@69: * jpayne@69: * rstart = 0 jpayne@69: * rstop = MAX_POS # <<<<<<<<<<<<<< jpayne@69: * if start is not None: jpayne@69: * try: jpayne@69: */ jpayne@69: __pyx_v_rstop = __pyx_v_5pysam_9libcutils_MAX_POS; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":234 jpayne@69: * rstart = 0 jpayne@69: * rstop = MAX_POS jpayne@69: * if start is not None: # <<<<<<<<<<<<<< jpayne@69: * try: jpayne@69: * rstart = start jpayne@69: */ jpayne@69: __pyx_t_1 = (__pyx_v_start != Py_None); jpayne@69: if (__pyx_t_1) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":235 jpayne@69: * rstop = MAX_POS jpayne@69: * if start is not None: jpayne@69: * try: # <<<<<<<<<<<<<< jpayne@69: * rstart = start jpayne@69: * except OverflowError: jpayne@69: */ jpayne@69: { jpayne@69: __Pyx_PyThreadState_declare jpayne@69: __Pyx_PyThreadState_assign jpayne@69: __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); jpayne@69: __Pyx_XGOTREF(__pyx_t_4); jpayne@69: __Pyx_XGOTREF(__pyx_t_5); jpayne@69: __Pyx_XGOTREF(__pyx_t_6); jpayne@69: /*try:*/ { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":236 jpayne@69: * if start is not None: jpayne@69: * try: jpayne@69: * rstart = start # <<<<<<<<<<<<<< jpayne@69: * except OverflowError: jpayne@69: * raise ValueError('start out of range (%i)' % start) jpayne@69: */ jpayne@69: __pyx_t_7 = __Pyx_PyInt_As_int32_t(__pyx_v_start); if (unlikely((__pyx_t_7 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 236, __pyx_L14_error) jpayne@69: __pyx_v_rstart = __pyx_t_7; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":235 jpayne@69: * rstop = MAX_POS jpayne@69: * if start is not None: jpayne@69: * try: # <<<<<<<<<<<<<< jpayne@69: * rstart = start jpayne@69: * except OverflowError: jpayne@69: */ jpayne@69: } jpayne@69: __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; jpayne@69: goto __pyx_L19_try_end; jpayne@69: __pyx_L14_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":237 jpayne@69: * try: jpayne@69: * rstart = start jpayne@69: * except OverflowError: # <<<<<<<<<<<<<< jpayne@69: * raise ValueError('start out of range (%i)' % start) jpayne@69: * jpayne@69: */ jpayne@69: __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OverflowError); jpayne@69: if (__pyx_t_8) { jpayne@69: __Pyx_AddTraceback("pysam.libcutils.parse_region", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 237, __pyx_L16_except_error) jpayne@69: __Pyx_XGOTREF(__pyx_t_2); jpayne@69: __Pyx_XGOTREF(__pyx_t_9); jpayne@69: __Pyx_XGOTREF(__pyx_t_10); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":238 jpayne@69: * rstart = start jpayne@69: * except OverflowError: jpayne@69: * raise ValueError('start out of range (%i)' % start) # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * if stop is not None: jpayne@69: */ jpayne@69: __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_start_out_of_range_i, __pyx_v_start); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 238, __pyx_L16_except_error) jpayne@69: __Pyx_GOTREF(__pyx_t_11); jpayne@69: __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 238, __pyx_L16_except_error) jpayne@69: __Pyx_GOTREF(__pyx_t_12); jpayne@69: __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; jpayne@69: __Pyx_Raise(__pyx_t_12, 0, 0, 0); jpayne@69: __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; jpayne@69: __PYX_ERR(0, 238, __pyx_L16_except_error) jpayne@69: } jpayne@69: goto __pyx_L16_except_error; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":235 jpayne@69: * rstop = MAX_POS jpayne@69: * if start is not None: jpayne@69: * try: # <<<<<<<<<<<<<< jpayne@69: * rstart = start jpayne@69: * except OverflowError: jpayne@69: */ jpayne@69: __pyx_L16_except_error:; jpayne@69: __Pyx_XGIVEREF(__pyx_t_4); jpayne@69: __Pyx_XGIVEREF(__pyx_t_5); jpayne@69: __Pyx_XGIVEREF(__pyx_t_6); jpayne@69: __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); jpayne@69: goto __pyx_L1_error; jpayne@69: __pyx_L19_try_end:; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":234 jpayne@69: * rstart = 0 jpayne@69: * rstop = MAX_POS jpayne@69: * if start is not None: # <<<<<<<<<<<<<< jpayne@69: * try: jpayne@69: * rstart = start jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":240 jpayne@69: * raise ValueError('start out of range (%i)' % start) jpayne@69: * jpayne@69: * if stop is not None: # <<<<<<<<<<<<<< jpayne@69: * try: jpayne@69: * rstop = stop jpayne@69: */ jpayne@69: __pyx_t_1 = (__pyx_v_stop != Py_None); jpayne@69: if (__pyx_t_1) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":241 jpayne@69: * jpayne@69: * if stop is not None: jpayne@69: * try: # <<<<<<<<<<<<<< jpayne@69: * rstop = stop jpayne@69: * except OverflowError: jpayne@69: */ jpayne@69: { jpayne@69: __Pyx_PyThreadState_declare jpayne@69: __Pyx_PyThreadState_assign jpayne@69: __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); jpayne@69: __Pyx_XGOTREF(__pyx_t_6); jpayne@69: __Pyx_XGOTREF(__pyx_t_5); jpayne@69: __Pyx_XGOTREF(__pyx_t_4); jpayne@69: /*try:*/ { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":242 jpayne@69: * if stop is not None: jpayne@69: * try: jpayne@69: * rstop = stop # <<<<<<<<<<<<<< jpayne@69: * except OverflowError: jpayne@69: * raise ValueError('stop out of range (%i)' % stop) jpayne@69: */ jpayne@69: __pyx_t_7 = __Pyx_PyInt_As_int32_t(__pyx_v_stop); if (unlikely((__pyx_t_7 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L23_error) jpayne@69: __pyx_v_rstop = __pyx_t_7; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":241 jpayne@69: * jpayne@69: * if stop is not None: jpayne@69: * try: # <<<<<<<<<<<<<< jpayne@69: * rstop = stop jpayne@69: * except OverflowError: jpayne@69: */ jpayne@69: } jpayne@69: __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; jpayne@69: goto __pyx_L28_try_end; jpayne@69: __pyx_L23_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":243 jpayne@69: * try: jpayne@69: * rstop = stop jpayne@69: * except OverflowError: # <<<<<<<<<<<<<< jpayne@69: * raise ValueError('stop out of range (%i)' % stop) jpayne@69: * jpayne@69: */ jpayne@69: __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OverflowError); jpayne@69: if (__pyx_t_8) { jpayne@69: __Pyx_AddTraceback("pysam.libcutils.parse_region", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_9, &__pyx_t_2) < 0) __PYX_ERR(0, 243, __pyx_L25_except_error) jpayne@69: __Pyx_XGOTREF(__pyx_t_10); jpayne@69: __Pyx_XGOTREF(__pyx_t_9); jpayne@69: __Pyx_XGOTREF(__pyx_t_2); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":244 jpayne@69: * rstop = stop jpayne@69: * except OverflowError: jpayne@69: * raise ValueError('stop out of range (%i)' % stop) # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * if region: jpayne@69: */ jpayne@69: __pyx_t_12 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_stop_out_of_range_i, __pyx_v_stop); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 244, __pyx_L25_except_error) jpayne@69: __Pyx_GOTREF(__pyx_t_12); jpayne@69: __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 244, __pyx_L25_except_error) jpayne@69: __Pyx_GOTREF(__pyx_t_11); jpayne@69: __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; jpayne@69: __Pyx_Raise(__pyx_t_11, 0, 0, 0); jpayne@69: __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; jpayne@69: __PYX_ERR(0, 244, __pyx_L25_except_error) jpayne@69: } jpayne@69: goto __pyx_L25_except_error; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":241 jpayne@69: * jpayne@69: * if stop is not None: jpayne@69: * try: # <<<<<<<<<<<<<< jpayne@69: * rstop = stop jpayne@69: * except OverflowError: jpayne@69: */ jpayne@69: __pyx_L25_except_error:; jpayne@69: __Pyx_XGIVEREF(__pyx_t_6); jpayne@69: __Pyx_XGIVEREF(__pyx_t_5); jpayne@69: __Pyx_XGIVEREF(__pyx_t_4); jpayne@69: __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4); jpayne@69: goto __pyx_L1_error; jpayne@69: __pyx_L28_try_end:; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":240 jpayne@69: * raise ValueError('start out of range (%i)' % start) jpayne@69: * jpayne@69: * if stop is not None: # <<<<<<<<<<<<<< jpayne@69: * try: jpayne@69: * rstop = stop jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":246 jpayne@69: * raise ValueError('stop out of range (%i)' % stop) jpayne@69: * jpayne@69: * if region: # <<<<<<<<<<<<<< jpayne@69: * if ":" in region: jpayne@69: * contig, coord = region.split(":") jpayne@69: */ jpayne@69: __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_region); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 246, __pyx_L1_error) jpayne@69: if (__pyx_t_1) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":247 jpayne@69: * jpayne@69: * if region: jpayne@69: * if ":" in region: # <<<<<<<<<<<<<< jpayne@69: * contig, coord = region.split(":") jpayne@69: * parts = coord.split("-") jpayne@69: */ jpayne@69: __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__7, __pyx_v_region, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 247, __pyx_L1_error) jpayne@69: if (__pyx_t_1) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":248 jpayne@69: * if region: jpayne@69: * if ":" in region: jpayne@69: * contig, coord = region.split(":") # <<<<<<<<<<<<<< jpayne@69: * parts = coord.split("-") jpayne@69: * rstart = int(parts[0]) - 1 jpayne@69: */ jpayne@69: __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_region, __pyx_n_s_split); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 248, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_9); jpayne@69: __pyx_t_10 = NULL; jpayne@69: __pyx_t_13 = 0; jpayne@69: #if CYTHON_UNPACK_METHODS jpayne@69: if (likely(PyMethod_Check(__pyx_t_9))) { jpayne@69: __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); jpayne@69: if (likely(__pyx_t_10)) { jpayne@69: PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); jpayne@69: __Pyx_INCREF(__pyx_t_10); jpayne@69: __Pyx_INCREF(function); jpayne@69: __Pyx_DECREF_SET(__pyx_t_9, function); jpayne@69: __pyx_t_13 = 1; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: { jpayne@69: PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_kp_u__7}; jpayne@69: __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13); jpayne@69: __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; jpayne@69: if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; jpayne@69: } jpayne@69: if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { jpayne@69: PyObject* sequence = __pyx_t_2; jpayne@69: Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); jpayne@69: if (unlikely(size != 2)) { jpayne@69: if (size > 2) __Pyx_RaiseTooManyValuesError(2); jpayne@69: else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); jpayne@69: __PYX_ERR(0, 248, __pyx_L1_error) jpayne@69: } jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS jpayne@69: if (likely(PyTuple_CheckExact(sequence))) { jpayne@69: __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); jpayne@69: __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); jpayne@69: } else { jpayne@69: __pyx_t_9 = PyList_GET_ITEM(sequence, 0); jpayne@69: __pyx_t_10 = PyList_GET_ITEM(sequence, 1); jpayne@69: } jpayne@69: __Pyx_INCREF(__pyx_t_9); jpayne@69: __Pyx_INCREF(__pyx_t_10); jpayne@69: #else jpayne@69: __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 248, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_9); jpayne@69: __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 248, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_10); jpayne@69: #endif jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: } else { jpayne@69: Py_ssize_t index = -1; jpayne@69: __pyx_t_11 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 248, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_11); jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); jpayne@69: index = 0; __pyx_t_9 = __pyx_t_14(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L33_unpacking_failed; jpayne@69: __Pyx_GOTREF(__pyx_t_9); jpayne@69: index = 1; __pyx_t_10 = __pyx_t_14(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L33_unpacking_failed; jpayne@69: __Pyx_GOTREF(__pyx_t_10); jpayne@69: if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_11), 2) < 0) __PYX_ERR(0, 248, __pyx_L1_error) jpayne@69: __pyx_t_14 = NULL; jpayne@69: __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; jpayne@69: goto __pyx_L34_unpacking_done; jpayne@69: __pyx_L33_unpacking_failed:; jpayne@69: __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; jpayne@69: __pyx_t_14 = NULL; jpayne@69: if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); jpayne@69: __PYX_ERR(0, 248, __pyx_L1_error) jpayne@69: __pyx_L34_unpacking_done:; jpayne@69: } jpayne@69: __Pyx_DECREF_SET(__pyx_v_contig, __pyx_t_9); jpayne@69: __pyx_t_9 = 0; jpayne@69: __pyx_v_coord = __pyx_t_10; jpayne@69: __pyx_t_10 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":249 jpayne@69: * if ":" in region: jpayne@69: * contig, coord = region.split(":") jpayne@69: * parts = coord.split("-") # <<<<<<<<<<<<<< jpayne@69: * rstart = int(parts[0]) - 1 jpayne@69: * if len(parts) >= 1: jpayne@69: */ jpayne@69: __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_coord, __pyx_n_s_split); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 249, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_10); jpayne@69: __pyx_t_9 = NULL; jpayne@69: __pyx_t_13 = 0; jpayne@69: #if CYTHON_UNPACK_METHODS jpayne@69: if (likely(PyMethod_Check(__pyx_t_10))) { jpayne@69: __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10); jpayne@69: if (likely(__pyx_t_9)) { jpayne@69: PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); jpayne@69: __Pyx_INCREF(__pyx_t_9); jpayne@69: __Pyx_INCREF(function); jpayne@69: __Pyx_DECREF_SET(__pyx_t_10, function); jpayne@69: __pyx_t_13 = 1; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: { jpayne@69: PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_kp_u__8}; jpayne@69: __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13); jpayne@69: __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; jpayne@69: if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; jpayne@69: } jpayne@69: __pyx_v_parts = __pyx_t_2; jpayne@69: __pyx_t_2 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":250 jpayne@69: * contig, coord = region.split(":") jpayne@69: * parts = coord.split("-") jpayne@69: * rstart = int(parts[0]) - 1 # <<<<<<<<<<<<<< jpayne@69: * if len(parts) >= 1: jpayne@69: * rstop = int(parts[1]) jpayne@69: */ jpayne@69: __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_parts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __pyx_t_10 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 250, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_10); jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_10, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; jpayne@69: __pyx_t_7 = __Pyx_PyInt_As_int32_t(__pyx_t_2); if (unlikely((__pyx_t_7 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 250, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: __pyx_v_rstart = __pyx_t_7; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":251 jpayne@69: * parts = coord.split("-") jpayne@69: * rstart = int(parts[0]) - 1 jpayne@69: * if len(parts) >= 1: # <<<<<<<<<<<<<< jpayne@69: * rstop = int(parts[1]) jpayne@69: * else: jpayne@69: */ jpayne@69: __pyx_t_15 = PyObject_Length(__pyx_v_parts); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 251, __pyx_L1_error) jpayne@69: __pyx_t_1 = (__pyx_t_15 >= 1); jpayne@69: if (__pyx_t_1) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":252 jpayne@69: * rstart = int(parts[0]) - 1 jpayne@69: * if len(parts) >= 1: jpayne@69: * rstop = int(parts[1]) # <<<<<<<<<<<<<< jpayne@69: * else: jpayne@69: * contig = region jpayne@69: */ jpayne@69: __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_parts, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __pyx_t_10 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 252, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_10); jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: __pyx_t_7 = __Pyx_PyInt_As_int32_t(__pyx_t_10); if (unlikely((__pyx_t_7 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 252, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; jpayne@69: __pyx_v_rstop = __pyx_t_7; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":251 jpayne@69: * parts = coord.split("-") jpayne@69: * rstart = int(parts[0]) - 1 jpayne@69: * if len(parts) >= 1: # <<<<<<<<<<<<<< jpayne@69: * rstop = int(parts[1]) jpayne@69: * else: jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":247 jpayne@69: * jpayne@69: * if region: jpayne@69: * if ":" in region: # <<<<<<<<<<<<<< jpayne@69: * contig, coord = region.split(":") jpayne@69: * parts = coord.split("-") jpayne@69: */ jpayne@69: goto __pyx_L32; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":254 jpayne@69: * rstop = int(parts[1]) jpayne@69: * else: jpayne@69: * contig = region # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * if rstart > rstop: jpayne@69: */ jpayne@69: /*else*/ { jpayne@69: __Pyx_INCREF(__pyx_v_region); jpayne@69: __Pyx_DECREF_SET(__pyx_v_contig, __pyx_v_region); jpayne@69: } jpayne@69: __pyx_L32:; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":246 jpayne@69: * raise ValueError('stop out of range (%i)' % stop) jpayne@69: * jpayne@69: * if region: # <<<<<<<<<<<<<< jpayne@69: * if ":" in region: jpayne@69: * contig, coord = region.split(":") jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":256 jpayne@69: * contig = region jpayne@69: * jpayne@69: * if rstart > rstop: # <<<<<<<<<<<<<< jpayne@69: * raise ValueError('invalid coordinates: start (%i) > stop (%i)' % (rstart, rstop)) jpayne@69: * if not 0 <= rstart < MAX_POS: jpayne@69: */ jpayne@69: __pyx_t_1 = (__pyx_v_rstart > __pyx_v_rstop); jpayne@69: if (unlikely(__pyx_t_1)) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":257 jpayne@69: * jpayne@69: * if rstart > rstop: jpayne@69: * raise ValueError('invalid coordinates: start (%i) > stop (%i)' % (rstart, rstop)) # <<<<<<<<<<<<<< jpayne@69: * if not 0 <= rstart < MAX_POS: jpayne@69: * raise ValueError('start out of range (%i)' % rstart) jpayne@69: */ jpayne@69: __pyx_t_10 = __Pyx_PyInt_From_int32_t(__pyx_v_rstart); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 257, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_10); jpayne@69: __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_rstop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 257, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_9); jpayne@69: __Pyx_GIVEREF(__pyx_t_10); jpayne@69: if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10)) __PYX_ERR(0, 257, __pyx_L1_error); jpayne@69: __Pyx_GIVEREF(__pyx_t_2); jpayne@69: if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error); jpayne@69: __pyx_t_10 = 0; jpayne@69: __pyx_t_2 = 0; jpayne@69: __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_invalid_coordinates_start_i_stop, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; jpayne@69: __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 257, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_9); jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: __Pyx_Raise(__pyx_t_9, 0, 0, 0); jpayne@69: __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; jpayne@69: __PYX_ERR(0, 257, __pyx_L1_error) jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":256 jpayne@69: * contig = region jpayne@69: * jpayne@69: * if rstart > rstop: # <<<<<<<<<<<<<< jpayne@69: * raise ValueError('invalid coordinates: start (%i) > stop (%i)' % (rstart, rstop)) jpayne@69: * if not 0 <= rstart < MAX_POS: jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":258 jpayne@69: * if rstart > rstop: jpayne@69: * raise ValueError('invalid coordinates: start (%i) > stop (%i)' % (rstart, rstop)) jpayne@69: * if not 0 <= rstart < MAX_POS: # <<<<<<<<<<<<<< jpayne@69: * raise ValueError('start out of range (%i)' % rstart) jpayne@69: * if not 0 <= rstop <= MAX_POS: jpayne@69: */ jpayne@69: __pyx_t_1 = (0 <= __pyx_v_rstart); jpayne@69: if (__pyx_t_1) { jpayne@69: __pyx_t_1 = (__pyx_v_rstart < __pyx_v_5pysam_9libcutils_MAX_POS); jpayne@69: } jpayne@69: __pyx_t_3 = (!__pyx_t_1); jpayne@69: if (unlikely(__pyx_t_3)) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":259 jpayne@69: * raise ValueError('invalid coordinates: start (%i) > stop (%i)' % (rstart, rstop)) jpayne@69: * if not 0 <= rstart < MAX_POS: jpayne@69: * raise ValueError('start out of range (%i)' % rstart) # <<<<<<<<<<<<<< jpayne@69: * if not 0 <= rstop <= MAX_POS: jpayne@69: * raise ValueError('stop out of range (%i)' % rstop) jpayne@69: */ jpayne@69: __pyx_t_9 = __Pyx_PyInt_From_int32_t(__pyx_v_rstart); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 259, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_9); jpayne@69: __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_start_out_of_range_i, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; jpayne@69: __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 259, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_9); jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: __Pyx_Raise(__pyx_t_9, 0, 0, 0); jpayne@69: __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; jpayne@69: __PYX_ERR(0, 259, __pyx_L1_error) jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":258 jpayne@69: * if rstart > rstop: jpayne@69: * raise ValueError('invalid coordinates: start (%i) > stop (%i)' % (rstart, rstop)) jpayne@69: * if not 0 <= rstart < MAX_POS: # <<<<<<<<<<<<<< jpayne@69: * raise ValueError('start out of range (%i)' % rstart) jpayne@69: * if not 0 <= rstop <= MAX_POS: jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":260 jpayne@69: * if not 0 <= rstart < MAX_POS: jpayne@69: * raise ValueError('start out of range (%i)' % rstart) jpayne@69: * if not 0 <= rstop <= MAX_POS: # <<<<<<<<<<<<<< jpayne@69: * raise ValueError('stop out of range (%i)' % rstop) jpayne@69: * jpayne@69: */ jpayne@69: __pyx_t_3 = (0 <= __pyx_v_rstop); jpayne@69: if (__pyx_t_3) { jpayne@69: __pyx_t_3 = (__pyx_v_rstop <= __pyx_v_5pysam_9libcutils_MAX_POS); jpayne@69: } jpayne@69: __pyx_t_1 = (!__pyx_t_3); jpayne@69: if (unlikely(__pyx_t_1)) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":261 jpayne@69: * raise ValueError('start out of range (%i)' % rstart) jpayne@69: * if not 0 <= rstop <= MAX_POS: jpayne@69: * raise ValueError('stop out of range (%i)' % rstop) # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * return contig, rstart, rstop jpayne@69: */ jpayne@69: __pyx_t_9 = __Pyx_PyInt_From_int32_t(__pyx_v_rstop); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 261, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_9); jpayne@69: __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_stop_out_of_range_i, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; jpayne@69: __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 261, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_9); jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: __Pyx_Raise(__pyx_t_9, 0, 0, 0); jpayne@69: __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; jpayne@69: __PYX_ERR(0, 261, __pyx_L1_error) jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":260 jpayne@69: * if not 0 <= rstart < MAX_POS: jpayne@69: * raise ValueError('start out of range (%i)' % rstart) jpayne@69: * if not 0 <= rstop <= MAX_POS: # <<<<<<<<<<<<<< jpayne@69: * raise ValueError('stop out of range (%i)' % rstop) jpayne@69: * jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":263 jpayne@69: * raise ValueError('stop out of range (%i)' % rstop) jpayne@69: * jpayne@69: * return contig, rstart, rstop # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * jpayne@69: */ jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __pyx_t_9 = __Pyx_PyInt_From_int32_t(__pyx_v_rstart); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 263, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_9); jpayne@69: __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_rstop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 263, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_10); jpayne@69: __Pyx_INCREF(__pyx_v_contig); jpayne@69: __Pyx_GIVEREF(__pyx_v_contig); jpayne@69: if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_contig)) __PYX_ERR(0, 263, __pyx_L1_error); jpayne@69: __Pyx_GIVEREF(__pyx_t_9); jpayne@69: if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9)) __PYX_ERR(0, 263, __pyx_L1_error); jpayne@69: __Pyx_GIVEREF(__pyx_t_2); jpayne@69: if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error); jpayne@69: __pyx_t_9 = 0; jpayne@69: __pyx_t_2 = 0; jpayne@69: __pyx_r = __pyx_t_10; jpayne@69: __pyx_t_10 = 0; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":178 jpayne@69: * jpayne@69: * jpayne@69: * cpdef parse_region(contig=None, # <<<<<<<<<<<<<< jpayne@69: * start=None, jpayne@69: * stop=None, jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_2); jpayne@69: __Pyx_XDECREF(__pyx_t_9); jpayne@69: __Pyx_XDECREF(__pyx_t_10); jpayne@69: __Pyx_XDECREF(__pyx_t_11); jpayne@69: __Pyx_XDECREF(__pyx_t_12); jpayne@69: __Pyx_AddTraceback("pysam.libcutils.parse_region", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __pyx_r = 0; jpayne@69: __pyx_L0:; jpayne@69: __Pyx_XDECREF(__pyx_v_coord); jpayne@69: __Pyx_XDECREF(__pyx_v_parts); jpayne@69: __Pyx_XDECREF(__pyx_v_contig); jpayne@69: __Pyx_XDECREF(__pyx_v_stop); jpayne@69: __Pyx_XGIVEREF(__pyx_r); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* Python wrapper */ jpayne@69: static PyObject *__pyx_pw_5pysam_9libcutils_13parse_region(PyObject *__pyx_self, jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds jpayne@69: #else jpayne@69: PyObject *__pyx_args, PyObject *__pyx_kwds jpayne@69: #endif jpayne@69: ); /*proto*/ jpayne@69: PyDoc_STRVAR(__pyx_doc_5pysam_9libcutils_12parse_region, "parse alternative ways to specify a genomic region. A region can\n either be specified by :term:`reference`, `start` and\n `end`. `start` and `end` denote 0-based, half-open intervals.\n \n :term:`reference` and `end` are also accepted for backward\n compatibility as synonyms for :term:`contig` and `stop`,\n respectively.\n\n Alternatively, a samtools :term:`region` string can be supplied.\n\n If any of the coordinates are missing they will be replaced by the\n minimum (`start`) or maximum (`end`) coordinate.\n\n Note that region strings are 1-based, while `start` and `end`\n denote an interval in python coordinates.\n\n Returns\n -------\n\n tuple : a tuple of `reference`, `start` and `end`.\n\n Raises\n ------\n\n ValueError\n for invalid or out of bounds regions.\n\n "); jpayne@69: static PyMethodDef __pyx_mdef_5pysam_9libcutils_13parse_region = {"parse_region", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcutils_13parse_region, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcutils_12parse_region}; jpayne@69: static PyObject *__pyx_pw_5pysam_9libcutils_13parse_region(PyObject *__pyx_self, jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds jpayne@69: #else jpayne@69: PyObject *__pyx_args, PyObject *__pyx_kwds jpayne@69: #endif jpayne@69: ) { jpayne@69: PyObject *__pyx_v_contig = 0; jpayne@69: PyObject *__pyx_v_start = 0; jpayne@69: PyObject *__pyx_v_stop = 0; jpayne@69: PyObject *__pyx_v_region = 0; jpayne@69: PyObject *__pyx_v_reference = 0; jpayne@69: PyObject *__pyx_v_end = 0; jpayne@69: #if !CYTHON_METH_FASTCALL jpayne@69: CYTHON_UNUSED Py_ssize_t __pyx_nargs; jpayne@69: #endif jpayne@69: CYTHON_UNUSED PyObject *const *__pyx_kwvalues; jpayne@69: PyObject* values[6] = {0,0,0,0,0,0}; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: PyObject *__pyx_r = 0; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: __Pyx_RefNannySetupContext("parse_region (wrapper)", 0); jpayne@69: #if !CYTHON_METH_FASTCALL jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS jpayne@69: __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); jpayne@69: #else jpayne@69: __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; jpayne@69: #endif jpayne@69: #endif jpayne@69: __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); jpayne@69: { jpayne@69: PyObject **__pyx_pyargnames[] = {&__pyx_n_s_contig,&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_region,&__pyx_n_s_reference,&__pyx_n_s_end,0}; jpayne@69: values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":179 jpayne@69: * jpayne@69: * cpdef parse_region(contig=None, jpayne@69: * start=None, # <<<<<<<<<<<<<< jpayne@69: * stop=None, jpayne@69: * region=None, jpayne@69: */ jpayne@69: values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":180 jpayne@69: * cpdef parse_region(contig=None, jpayne@69: * start=None, jpayne@69: * stop=None, # <<<<<<<<<<<<<< jpayne@69: * region=None, jpayne@69: * reference=None, jpayne@69: */ jpayne@69: values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":181 jpayne@69: * start=None, jpayne@69: * stop=None, jpayne@69: * region=None, # <<<<<<<<<<<<<< jpayne@69: * reference=None, jpayne@69: * end=None): jpayne@69: */ jpayne@69: values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":182 jpayne@69: * stop=None, jpayne@69: * region=None, jpayne@69: * reference=None, # <<<<<<<<<<<<<< jpayne@69: * end=None): jpayne@69: * """parse alternative ways to specify a genomic region. A region can jpayne@69: */ jpayne@69: values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":183 jpayne@69: * region=None, jpayne@69: * reference=None, jpayne@69: * end=None): # <<<<<<<<<<<<<< jpayne@69: * """parse alternative ways to specify a genomic region. A region can jpayne@69: * either be specified by :term:`reference`, `start` and jpayne@69: */ jpayne@69: values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); jpayne@69: if (__pyx_kwds) { jpayne@69: Py_ssize_t kw_args; jpayne@69: switch (__pyx_nargs) { jpayne@69: case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 0: break; jpayne@69: default: goto __pyx_L5_argtuple_error; jpayne@69: } jpayne@69: kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); jpayne@69: switch (__pyx_nargs) { jpayne@69: case 0: jpayne@69: if (kw_args > 0) { jpayne@69: PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_contig); jpayne@69: if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } jpayne@69: else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L3_error) jpayne@69: } jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 1: jpayne@69: if (kw_args > 0) { jpayne@69: PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_start); jpayne@69: if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } jpayne@69: else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L3_error) jpayne@69: } jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 2: jpayne@69: if (kw_args > 0) { jpayne@69: PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stop); jpayne@69: if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } jpayne@69: else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L3_error) jpayne@69: } jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 3: jpayne@69: if (kw_args > 0) { jpayne@69: PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_region); jpayne@69: if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } jpayne@69: else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L3_error) jpayne@69: } jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 4: jpayne@69: if (kw_args > 0) { jpayne@69: PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_reference); jpayne@69: if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } jpayne@69: else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L3_error) jpayne@69: } jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 5: jpayne@69: if (kw_args > 0) { jpayne@69: PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_end); jpayne@69: if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } jpayne@69: else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L3_error) jpayne@69: } jpayne@69: } jpayne@69: if (unlikely(kw_args > 0)) { jpayne@69: const Py_ssize_t kwd_pos_args = __pyx_nargs; jpayne@69: if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "parse_region") < 0)) __PYX_ERR(0, 178, __pyx_L3_error) jpayne@69: } jpayne@69: } else { jpayne@69: switch (__pyx_nargs) { jpayne@69: case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 0: break; jpayne@69: default: goto __pyx_L5_argtuple_error; jpayne@69: } jpayne@69: } jpayne@69: __pyx_v_contig = values[0]; jpayne@69: __pyx_v_start = values[1]; jpayne@69: __pyx_v_stop = values[2]; jpayne@69: __pyx_v_region = values[3]; jpayne@69: __pyx_v_reference = values[4]; jpayne@69: __pyx_v_end = values[5]; jpayne@69: } jpayne@69: goto __pyx_L6_skip; jpayne@69: __pyx_L5_argtuple_error:; jpayne@69: __Pyx_RaiseArgtupleInvalid("parse_region", 0, 0, 6, __pyx_nargs); __PYX_ERR(0, 178, __pyx_L3_error) jpayne@69: __pyx_L6_skip:; jpayne@69: goto __pyx_L4_argument_unpacking_done; jpayne@69: __pyx_L3_error:; jpayne@69: { jpayne@69: Py_ssize_t __pyx_temp; jpayne@69: for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { jpayne@69: __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); jpayne@69: } jpayne@69: } jpayne@69: __Pyx_AddTraceback("pysam.libcutils.parse_region", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return NULL; jpayne@69: __pyx_L4_argument_unpacking_done:; jpayne@69: __pyx_r = __pyx_pf_5pysam_9libcutils_12parse_region(__pyx_self, __pyx_v_contig, __pyx_v_start, __pyx_v_stop, __pyx_v_region, __pyx_v_reference, __pyx_v_end); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":178 jpayne@69: * jpayne@69: * jpayne@69: * cpdef parse_region(contig=None, # <<<<<<<<<<<<<< jpayne@69: * start=None, jpayne@69: * stop=None, jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: { jpayne@69: Py_ssize_t __pyx_temp; jpayne@69: for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { jpayne@69: __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); jpayne@69: } jpayne@69: } jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: static PyObject *__pyx_pf_5pysam_9libcutils_12parse_region(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_contig, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_region, PyObject *__pyx_v_reference, PyObject *__pyx_v_end) { jpayne@69: PyObject *__pyx_r = NULL; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: PyObject *__pyx_t_1 = NULL; jpayne@69: struct __pyx_opt_args_5pysam_9libcutils_parse_region __pyx_t_2; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: __Pyx_RefNannySetupContext("parse_region", 1); jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __pyx_t_2.__pyx_n = 6; jpayne@69: __pyx_t_2.contig = __pyx_v_contig; jpayne@69: __pyx_t_2.start = __pyx_v_start; jpayne@69: __pyx_t_2.stop = __pyx_v_stop; jpayne@69: __pyx_t_2.region = __pyx_v_region; jpayne@69: __pyx_t_2.reference = __pyx_v_reference; jpayne@69: __pyx_t_2.end = __pyx_v_end; jpayne@69: __pyx_t_1 = __pyx_f_5pysam_9libcutils_parse_region(0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_1); jpayne@69: __pyx_r = __pyx_t_1; jpayne@69: __pyx_t_1 = 0; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_1); jpayne@69: __Pyx_AddTraceback("pysam.libcutils.parse_region", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __pyx_r = NULL; jpayne@69: __pyx_L0:; jpayne@69: __Pyx_XGIVEREF(__pyx_r); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":266 jpayne@69: * jpayne@69: * jpayne@69: * cdef int libc_whence_from_io(int whence): # <<<<<<<<<<<<<< jpayne@69: * # io.SEEK_SET/_CUR/_END are by definition 0/1/2 but C/POSIX's equivalents jpayne@69: * # have unspecified values. So we must translate, but checking for 0/1/2 jpayne@69: */ jpayne@69: jpayne@69: static int __pyx_f_5pysam_9libcutils_libc_whence_from_io(int __pyx_v_whence) { jpayne@69: int __pyx_r; jpayne@69: int __pyx_t_1; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":270 jpayne@69: * # have unspecified values. So we must translate, but checking for 0/1/2 jpayne@69: * # rather than io.SEEK_SET/etc suffices. jpayne@69: * if whence == 0: return SEEK_SET # <<<<<<<<<<<<<< jpayne@69: * if whence == 1: return SEEK_CUR jpayne@69: * if whence == 2: return SEEK_END jpayne@69: */ jpayne@69: __pyx_t_1 = (__pyx_v_whence == 0); jpayne@69: if (__pyx_t_1) { jpayne@69: __pyx_r = SEEK_SET; jpayne@69: goto __pyx_L0; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":271 jpayne@69: * # rather than io.SEEK_SET/etc suffices. jpayne@69: * if whence == 0: return SEEK_SET jpayne@69: * if whence == 1: return SEEK_CUR # <<<<<<<<<<<<<< jpayne@69: * if whence == 2: return SEEK_END jpayne@69: * return whence # Otherwise likely invalid, but let HTSlib or OS report it jpayne@69: */ jpayne@69: __pyx_t_1 = (__pyx_v_whence == 1); jpayne@69: if (__pyx_t_1) { jpayne@69: __pyx_r = SEEK_CUR; jpayne@69: goto __pyx_L0; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":272 jpayne@69: * if whence == 0: return SEEK_SET jpayne@69: * if whence == 1: return SEEK_CUR jpayne@69: * if whence == 2: return SEEK_END # <<<<<<<<<<<<<< jpayne@69: * return whence # Otherwise likely invalid, but let HTSlib or OS report it jpayne@69: * jpayne@69: */ jpayne@69: __pyx_t_1 = (__pyx_v_whence == 2); jpayne@69: if (__pyx_t_1) { jpayne@69: __pyx_r = SEEK_END; jpayne@69: goto __pyx_L0; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":273 jpayne@69: * if whence == 1: return SEEK_CUR jpayne@69: * if whence == 2: return SEEK_END jpayne@69: * return whence # Otherwise likely invalid, but let HTSlib or OS report it # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * jpayne@69: */ jpayne@69: __pyx_r = __pyx_v_whence; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":266 jpayne@69: * jpayne@69: * jpayne@69: * cdef int libc_whence_from_io(int whence): # <<<<<<<<<<<<<< jpayne@69: * # io.SEEK_SET/_CUR/_END are by definition 0/1/2 but C/POSIX's equivalents jpayne@69: * # have unspecified values. So we must translate, but checking for 0/1/2 jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L0:; jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":276 jpayne@69: * jpayne@69: * jpayne@69: * def _pysam_dispatch(collection, # <<<<<<<<<<<<<< jpayne@69: * method, jpayne@69: * args=None, jpayne@69: */ jpayne@69: jpayne@69: /* Python wrapper */ jpayne@69: static PyObject *__pyx_pw_5pysam_9libcutils_15_pysam_dispatch(PyObject *__pyx_self, jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds jpayne@69: #else jpayne@69: PyObject *__pyx_args, PyObject *__pyx_kwds jpayne@69: #endif jpayne@69: ); /*proto*/ jpayne@69: PyDoc_STRVAR(__pyx_doc_5pysam_9libcutils_14_pysam_dispatch, "call ``method`` in samtools/bcftools providing arguments in args.\n \n By default, stdout is redirected to a temporary file using the patched\n C sources except for a few commands that have an explicit output option\n (typically: -o). In these commands (such as samtools view), this explicit\n option is used. If *is_usage* is True, then these explicit output options\n will not be used.\n\n Catching of stdout can be turned off by setting *catch_stdout* to\n False.\n "); jpayne@69: static PyMethodDef __pyx_mdef_5pysam_9libcutils_15_pysam_dispatch = {"_pysam_dispatch", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcutils_15_pysam_dispatch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcutils_14_pysam_dispatch}; jpayne@69: static PyObject *__pyx_pw_5pysam_9libcutils_15_pysam_dispatch(PyObject *__pyx_self, jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds jpayne@69: #else jpayne@69: PyObject *__pyx_args, PyObject *__pyx_kwds jpayne@69: #endif jpayne@69: ) { jpayne@69: PyObject *__pyx_v_collection = 0; jpayne@69: PyObject *__pyx_v_method = 0; jpayne@69: PyObject *__pyx_v_args = 0; jpayne@69: PyObject *__pyx_v_catch_stdout = 0; jpayne@69: PyObject *__pyx_v_is_usage = 0; jpayne@69: PyObject *__pyx_v_save_stdout = 0; jpayne@69: #if !CYTHON_METH_FASTCALL jpayne@69: CYTHON_UNUSED Py_ssize_t __pyx_nargs; jpayne@69: #endif jpayne@69: CYTHON_UNUSED PyObject *const *__pyx_kwvalues; jpayne@69: PyObject* values[6] = {0,0,0,0,0,0}; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: PyObject *__pyx_r = 0; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: __Pyx_RefNannySetupContext("_pysam_dispatch (wrapper)", 0); jpayne@69: #if !CYTHON_METH_FASTCALL jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS jpayne@69: __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); jpayne@69: #else jpayne@69: __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; jpayne@69: #endif jpayne@69: #endif jpayne@69: __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); jpayne@69: { jpayne@69: PyObject **__pyx_pyargnames[] = {&__pyx_n_s_collection,&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_catch_stdout,&__pyx_n_s_is_usage,&__pyx_n_s_save_stdout,0}; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":278 jpayne@69: * def _pysam_dispatch(collection, jpayne@69: * method, jpayne@69: * args=None, # <<<<<<<<<<<<<< jpayne@69: * catch_stdout=True, jpayne@69: * is_usage=False, jpayne@69: */ jpayne@69: values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":279 jpayne@69: * method, jpayne@69: * args=None, jpayne@69: * catch_stdout=True, # <<<<<<<<<<<<<< jpayne@69: * is_usage=False, jpayne@69: * save_stdout=None): jpayne@69: */ jpayne@69: values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":280 jpayne@69: * args=None, jpayne@69: * catch_stdout=True, jpayne@69: * is_usage=False, # <<<<<<<<<<<<<< jpayne@69: * save_stdout=None): jpayne@69: * '''call ``method`` in samtools/bcftools providing arguments in args. jpayne@69: */ jpayne@69: values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":281 jpayne@69: * catch_stdout=True, jpayne@69: * is_usage=False, jpayne@69: * save_stdout=None): # <<<<<<<<<<<<<< jpayne@69: * '''call ``method`` in samtools/bcftools providing arguments in args. jpayne@69: * jpayne@69: */ jpayne@69: values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); jpayne@69: if (__pyx_kwds) { jpayne@69: Py_ssize_t kw_args; jpayne@69: switch (__pyx_nargs) { jpayne@69: case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 0: break; jpayne@69: default: goto __pyx_L5_argtuple_error; jpayne@69: } jpayne@69: kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); jpayne@69: switch (__pyx_nargs) { jpayne@69: case 0: jpayne@69: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_collection)) != 0)) { jpayne@69: (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); jpayne@69: kw_args--; jpayne@69: } jpayne@69: else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 276, __pyx_L3_error) jpayne@69: else goto __pyx_L5_argtuple_error; jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 1: jpayne@69: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_method)) != 0)) { jpayne@69: (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); jpayne@69: kw_args--; jpayne@69: } jpayne@69: else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 276, __pyx_L3_error) jpayne@69: else { jpayne@69: __Pyx_RaiseArgtupleInvalid("_pysam_dispatch", 0, 2, 6, 1); __PYX_ERR(0, 276, __pyx_L3_error) jpayne@69: } jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 2: jpayne@69: if (kw_args > 0) { jpayne@69: PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args); jpayne@69: if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } jpayne@69: else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 276, __pyx_L3_error) jpayne@69: } jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 3: jpayne@69: if (kw_args > 0) { jpayne@69: PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_catch_stdout); jpayne@69: if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } jpayne@69: else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 276, __pyx_L3_error) jpayne@69: } jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 4: jpayne@69: if (kw_args > 0) { jpayne@69: PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_is_usage); jpayne@69: if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } jpayne@69: else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 276, __pyx_L3_error) jpayne@69: } jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 5: jpayne@69: if (kw_args > 0) { jpayne@69: PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_save_stdout); jpayne@69: if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } jpayne@69: else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 276, __pyx_L3_error) jpayne@69: } jpayne@69: } jpayne@69: if (unlikely(kw_args > 0)) { jpayne@69: const Py_ssize_t kwd_pos_args = __pyx_nargs; jpayne@69: if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_pysam_dispatch") < 0)) __PYX_ERR(0, 276, __pyx_L3_error) jpayne@69: } jpayne@69: } else { jpayne@69: switch (__pyx_nargs) { jpayne@69: case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); jpayne@69: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); jpayne@69: break; jpayne@69: default: goto __pyx_L5_argtuple_error; jpayne@69: } jpayne@69: } jpayne@69: __pyx_v_collection = values[0]; jpayne@69: __pyx_v_method = values[1]; jpayne@69: __pyx_v_args = values[2]; jpayne@69: __pyx_v_catch_stdout = values[3]; jpayne@69: __pyx_v_is_usage = values[4]; jpayne@69: __pyx_v_save_stdout = values[5]; jpayne@69: } jpayne@69: goto __pyx_L6_skip; jpayne@69: __pyx_L5_argtuple_error:; jpayne@69: __Pyx_RaiseArgtupleInvalid("_pysam_dispatch", 0, 2, 6, __pyx_nargs); __PYX_ERR(0, 276, __pyx_L3_error) jpayne@69: __pyx_L6_skip:; jpayne@69: goto __pyx_L4_argument_unpacking_done; jpayne@69: __pyx_L3_error:; jpayne@69: { jpayne@69: Py_ssize_t __pyx_temp; jpayne@69: for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { jpayne@69: __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); jpayne@69: } jpayne@69: } jpayne@69: __Pyx_AddTraceback("pysam.libcutils._pysam_dispatch", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return NULL; jpayne@69: __pyx_L4_argument_unpacking_done:; jpayne@69: __pyx_r = __pyx_pf_5pysam_9libcutils_14_pysam_dispatch(__pyx_self, __pyx_v_collection, __pyx_v_method, __pyx_v_args, __pyx_v_catch_stdout, __pyx_v_is_usage, __pyx_v_save_stdout); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":276 jpayne@69: * jpayne@69: * jpayne@69: * def _pysam_dispatch(collection, # <<<<<<<<<<<<<< jpayne@69: * method, jpayne@69: * args=None, jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: { jpayne@69: Py_ssize_t __pyx_temp; jpayne@69: for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { jpayne@69: __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); jpayne@69: } jpayne@69: } jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":413 jpayne@69: * jpayne@69: * # get error messages jpayne@69: * def _collect(fn): # <<<<<<<<<<<<<< jpayne@69: * out = [] jpayne@69: * try: jpayne@69: */ jpayne@69: jpayne@69: /* Python wrapper */ jpayne@69: static PyObject *__pyx_pw_5pysam_9libcutils_15_pysam_dispatch_1_collect(PyObject *__pyx_self, jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds jpayne@69: #else jpayne@69: PyObject *__pyx_args, PyObject *__pyx_kwds jpayne@69: #endif jpayne@69: ); /*proto*/ jpayne@69: static PyMethodDef __pyx_mdef_5pysam_9libcutils_15_pysam_dispatch_1_collect = {"_collect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcutils_15_pysam_dispatch_1_collect, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; jpayne@69: static PyObject *__pyx_pw_5pysam_9libcutils_15_pysam_dispatch_1_collect(PyObject *__pyx_self, jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds jpayne@69: #else jpayne@69: PyObject *__pyx_args, PyObject *__pyx_kwds jpayne@69: #endif jpayne@69: ) { jpayne@69: PyObject *__pyx_v_fn = 0; jpayne@69: #if !CYTHON_METH_FASTCALL jpayne@69: CYTHON_UNUSED Py_ssize_t __pyx_nargs; jpayne@69: #endif jpayne@69: CYTHON_UNUSED PyObject *const *__pyx_kwvalues; jpayne@69: PyObject* values[1] = {0}; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: PyObject *__pyx_r = 0; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: __Pyx_RefNannySetupContext("_collect (wrapper)", 0); jpayne@69: #if !CYTHON_METH_FASTCALL jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS jpayne@69: __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); jpayne@69: #else jpayne@69: __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; jpayne@69: #endif jpayne@69: #endif jpayne@69: __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); jpayne@69: { jpayne@69: PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fn,0}; jpayne@69: if (__pyx_kwds) { jpayne@69: Py_ssize_t kw_args; jpayne@69: switch (__pyx_nargs) { jpayne@69: case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 0: break; jpayne@69: default: goto __pyx_L5_argtuple_error; jpayne@69: } jpayne@69: kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); jpayne@69: switch (__pyx_nargs) { jpayne@69: case 0: jpayne@69: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fn)) != 0)) { jpayne@69: (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); jpayne@69: kw_args--; jpayne@69: } jpayne@69: else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 413, __pyx_L3_error) jpayne@69: else goto __pyx_L5_argtuple_error; jpayne@69: } jpayne@69: if (unlikely(kw_args > 0)) { jpayne@69: const Py_ssize_t kwd_pos_args = __pyx_nargs; jpayne@69: if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_collect") < 0)) __PYX_ERR(0, 413, __pyx_L3_error) jpayne@69: } jpayne@69: } else if (unlikely(__pyx_nargs != 1)) { jpayne@69: goto __pyx_L5_argtuple_error; jpayne@69: } else { jpayne@69: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); jpayne@69: } jpayne@69: __pyx_v_fn = values[0]; jpayne@69: } jpayne@69: goto __pyx_L6_skip; jpayne@69: __pyx_L5_argtuple_error:; jpayne@69: __Pyx_RaiseArgtupleInvalid("_collect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 413, __pyx_L3_error) jpayne@69: __pyx_L6_skip:; jpayne@69: goto __pyx_L4_argument_unpacking_done; jpayne@69: __pyx_L3_error:; jpayne@69: { jpayne@69: Py_ssize_t __pyx_temp; jpayne@69: for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { jpayne@69: __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); jpayne@69: } jpayne@69: } jpayne@69: __Pyx_AddTraceback("pysam.libcutils._pysam_dispatch._collect", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return NULL; jpayne@69: __pyx_L4_argument_unpacking_done:; jpayne@69: __pyx_r = __pyx_pf_5pysam_9libcutils_15_pysam_dispatch__collect(__pyx_self, __pyx_v_fn); jpayne@69: jpayne@69: /* function exit code */ jpayne@69: { jpayne@69: Py_ssize_t __pyx_temp; jpayne@69: for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { jpayne@69: __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); jpayne@69: } jpayne@69: } jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: static PyObject *__pyx_pf_5pysam_9libcutils_15_pysam_dispatch__collect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fn) { jpayne@69: PyObject *__pyx_v_out = NULL; jpayne@69: PyObject *__pyx_v_inf = NULL; jpayne@69: PyObject *__pyx_r = NULL; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: PyObject *__pyx_t_1 = NULL; jpayne@69: PyObject *__pyx_t_2 = NULL; jpayne@69: PyObject *__pyx_t_3 = NULL; jpayne@69: PyObject *__pyx_t_4 = NULL; jpayne@69: PyObject *__pyx_t_5 = NULL; jpayne@69: PyObject *__pyx_t_6 = NULL; jpayne@69: PyObject *__pyx_t_7 = NULL; jpayne@69: PyObject *__pyx_t_8 = NULL; jpayne@69: unsigned int __pyx_t_9; jpayne@69: PyObject *__pyx_t_10 = NULL; jpayne@69: PyObject *__pyx_t_11 = NULL; jpayne@69: PyObject *__pyx_t_12 = NULL; jpayne@69: PyObject *__pyx_t_13 = NULL; jpayne@69: int __pyx_t_14; jpayne@69: int __pyx_t_15; jpayne@69: int __pyx_t_16; jpayne@69: PyObject *__pyx_t_17 = NULL; jpayne@69: PyObject *__pyx_t_18 = NULL; jpayne@69: PyObject *__pyx_t_19 = NULL; jpayne@69: int __pyx_t_20; jpayne@69: char const *__pyx_t_21; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: __Pyx_RefNannySetupContext("_collect", 1); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":414 jpayne@69: * # get error messages jpayne@69: * def _collect(fn): jpayne@69: * out = [] # <<<<<<<<<<<<<< jpayne@69: * try: jpayne@69: * with open(fn, "r") as inf: jpayne@69: */ jpayne@69: __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 414, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_1); jpayne@69: __pyx_v_out = __pyx_t_1; jpayne@69: __pyx_t_1 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":415 jpayne@69: * def _collect(fn): jpayne@69: * out = [] jpayne@69: * try: # <<<<<<<<<<<<<< jpayne@69: * with open(fn, "r") as inf: jpayne@69: * out = inf.read() jpayne@69: */ jpayne@69: /*try:*/ { jpayne@69: { jpayne@69: __Pyx_PyThreadState_declare jpayne@69: __Pyx_PyThreadState_assign jpayne@69: __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); jpayne@69: __Pyx_XGOTREF(__pyx_t_2); jpayne@69: __Pyx_XGOTREF(__pyx_t_3); jpayne@69: __Pyx_XGOTREF(__pyx_t_4); jpayne@69: /*try:*/ { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":416 jpayne@69: * out = [] jpayne@69: * try: jpayne@69: * with open(fn, "r") as inf: # <<<<<<<<<<<<<< jpayne@69: * out = inf.read() jpayne@69: * except UnicodeDecodeError: jpayne@69: */ jpayne@69: /*with:*/ { jpayne@69: __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L6_error) jpayne@69: __Pyx_GOTREF(__pyx_t_1); jpayne@69: __Pyx_INCREF(__pyx_v_fn); jpayne@69: __Pyx_GIVEREF(__pyx_v_fn); jpayne@69: if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_fn)) __PYX_ERR(0, 416, __pyx_L6_error); jpayne@69: __Pyx_INCREF(__pyx_n_u_r); jpayne@69: __Pyx_GIVEREF(__pyx_n_u_r); jpayne@69: if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_r)) __PYX_ERR(0, 416, __pyx_L6_error); jpayne@69: __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 416, __pyx_L6_error) jpayne@69: __Pyx_GOTREF(__pyx_t_5); jpayne@69: __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; jpayne@69: __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_5, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 416, __pyx_L6_error) jpayne@69: __Pyx_GOTREF(__pyx_t_6); jpayne@69: __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_5, __pyx_n_s_enter); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 416, __pyx_L12_error) jpayne@69: __Pyx_GOTREF(__pyx_t_7); jpayne@69: __pyx_t_8 = NULL; jpayne@69: __pyx_t_9 = 0; jpayne@69: #if CYTHON_UNPACK_METHODS jpayne@69: if (likely(PyMethod_Check(__pyx_t_7))) { jpayne@69: __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); jpayne@69: if (likely(__pyx_t_8)) { jpayne@69: PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); jpayne@69: __Pyx_INCREF(__pyx_t_8); jpayne@69: __Pyx_INCREF(function); jpayne@69: __Pyx_DECREF_SET(__pyx_t_7, function); jpayne@69: __pyx_t_9 = 1; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: { jpayne@69: PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; jpayne@69: __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9); jpayne@69: __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; jpayne@69: if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L12_error) jpayne@69: __Pyx_GOTREF(__pyx_t_1); jpayne@69: __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; jpayne@69: } jpayne@69: __pyx_t_7 = __pyx_t_1; jpayne@69: __pyx_t_1 = 0; jpayne@69: __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; jpayne@69: /*try:*/ { jpayne@69: { jpayne@69: __Pyx_PyThreadState_declare jpayne@69: __Pyx_PyThreadState_assign jpayne@69: __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); jpayne@69: __Pyx_XGOTREF(__pyx_t_10); jpayne@69: __Pyx_XGOTREF(__pyx_t_11); jpayne@69: __Pyx_XGOTREF(__pyx_t_12); jpayne@69: /*try:*/ { jpayne@69: __pyx_v_inf = __pyx_t_7; jpayne@69: __pyx_t_7 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":417 jpayne@69: * try: jpayne@69: * with open(fn, "r") as inf: jpayne@69: * out = inf.read() # <<<<<<<<<<<<<< jpayne@69: * except UnicodeDecodeError: jpayne@69: * with open(fn, "rb") as inf: jpayne@69: */ jpayne@69: __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_inf, __pyx_n_s_read); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 417, __pyx_L16_error) jpayne@69: __Pyx_GOTREF(__pyx_t_5); jpayne@69: __pyx_t_1 = NULL; jpayne@69: __pyx_t_9 = 0; jpayne@69: #if CYTHON_UNPACK_METHODS jpayne@69: if (likely(PyMethod_Check(__pyx_t_5))) { jpayne@69: __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); jpayne@69: if (likely(__pyx_t_1)) { jpayne@69: PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); jpayne@69: __Pyx_INCREF(__pyx_t_1); jpayne@69: __Pyx_INCREF(function); jpayne@69: __Pyx_DECREF_SET(__pyx_t_5, function); jpayne@69: __pyx_t_9 = 1; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: { jpayne@69: PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; jpayne@69: __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9); jpayne@69: __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; jpayne@69: if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 417, __pyx_L16_error) jpayne@69: __Pyx_GOTREF(__pyx_t_7); jpayne@69: __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; jpayne@69: } jpayne@69: __Pyx_DECREF_SET(__pyx_v_out, __pyx_t_7); jpayne@69: __pyx_t_7 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":416 jpayne@69: * out = [] jpayne@69: * try: jpayne@69: * with open(fn, "r") as inf: # <<<<<<<<<<<<<< jpayne@69: * out = inf.read() jpayne@69: * except UnicodeDecodeError: jpayne@69: */ jpayne@69: } jpayne@69: __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; jpayne@69: goto __pyx_L21_try_end; jpayne@69: __pyx_L16_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; jpayne@69: /*except:*/ { jpayne@69: __Pyx_AddTraceback("pysam.libcutils._pysam_dispatch._collect", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(0, 416, __pyx_L18_except_error) jpayne@69: __Pyx_XGOTREF(__pyx_t_7); jpayne@69: __Pyx_XGOTREF(__pyx_t_5); jpayne@69: __Pyx_XGOTREF(__pyx_t_1); jpayne@69: __pyx_t_8 = PyTuple_Pack(3, __pyx_t_7, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 416, __pyx_L18_except_error) jpayne@69: __Pyx_GOTREF(__pyx_t_8); jpayne@69: __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); jpayne@69: __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; jpayne@69: __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; jpayne@69: if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 416, __pyx_L18_except_error) jpayne@69: __Pyx_GOTREF(__pyx_t_13); jpayne@69: __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_13); jpayne@69: __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; jpayne@69: if (__pyx_t_14 < 0) __PYX_ERR(0, 416, __pyx_L18_except_error) jpayne@69: __pyx_t_15 = (!__pyx_t_14); jpayne@69: if (unlikely(__pyx_t_15)) { jpayne@69: __Pyx_GIVEREF(__pyx_t_7); jpayne@69: __Pyx_GIVEREF(__pyx_t_5); jpayne@69: __Pyx_XGIVEREF(__pyx_t_1); jpayne@69: __Pyx_ErrRestoreWithState(__pyx_t_7, __pyx_t_5, __pyx_t_1); jpayne@69: __pyx_t_7 = 0; __pyx_t_5 = 0; __pyx_t_1 = 0; jpayne@69: __PYX_ERR(0, 416, __pyx_L18_except_error) jpayne@69: } jpayne@69: __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; jpayne@69: goto __pyx_L17_exception_handled; jpayne@69: } jpayne@69: __pyx_L18_except_error:; jpayne@69: __Pyx_XGIVEREF(__pyx_t_10); jpayne@69: __Pyx_XGIVEREF(__pyx_t_11); jpayne@69: __Pyx_XGIVEREF(__pyx_t_12); jpayne@69: __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); jpayne@69: goto __pyx_L6_error; jpayne@69: __pyx_L17_exception_handled:; jpayne@69: __Pyx_XGIVEREF(__pyx_t_10); jpayne@69: __Pyx_XGIVEREF(__pyx_t_11); jpayne@69: __Pyx_XGIVEREF(__pyx_t_12); jpayne@69: __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); jpayne@69: __pyx_L21_try_end:; jpayne@69: } jpayne@69: } jpayne@69: /*finally:*/ { jpayne@69: /*normal exit:*/{ jpayne@69: if (__pyx_t_6) { jpayne@69: __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__9, NULL); jpayne@69: __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; jpayne@69: if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 416, __pyx_L6_error) jpayne@69: __Pyx_GOTREF(__pyx_t_12); jpayne@69: __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; jpayne@69: } jpayne@69: goto __pyx_L15; jpayne@69: } jpayne@69: __pyx_L15:; jpayne@69: } jpayne@69: goto __pyx_L25; jpayne@69: __pyx_L12_error:; jpayne@69: __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; jpayne@69: goto __pyx_L6_error; jpayne@69: __pyx_L25:; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":415 jpayne@69: * def _collect(fn): jpayne@69: * out = [] jpayne@69: * try: # <<<<<<<<<<<<<< jpayne@69: * with open(fn, "r") as inf: jpayne@69: * out = inf.read() jpayne@69: */ jpayne@69: } jpayne@69: __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; jpayne@69: goto __pyx_L11_try_end; jpayne@69: __pyx_L6_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":418 jpayne@69: * with open(fn, "r") as inf: jpayne@69: * out = inf.read() jpayne@69: * except UnicodeDecodeError: # <<<<<<<<<<<<<< jpayne@69: * with open(fn, "rb") as inf: jpayne@69: * # read binary output jpayne@69: */ jpayne@69: __pyx_t_16 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_UnicodeDecodeError); jpayne@69: if (__pyx_t_16) { jpayne@69: __Pyx_AddTraceback("pysam.libcutils._pysam_dispatch._collect", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_7) < 0) __PYX_ERR(0, 418, __pyx_L8_except_error) jpayne@69: __Pyx_XGOTREF(__pyx_t_1); jpayne@69: __Pyx_XGOTREF(__pyx_t_5); jpayne@69: __Pyx_XGOTREF(__pyx_t_7); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":419 jpayne@69: * out = inf.read() jpayne@69: * except UnicodeDecodeError: jpayne@69: * with open(fn, "rb") as inf: # <<<<<<<<<<<<<< jpayne@69: * # read binary output jpayne@69: * out = inf.read() jpayne@69: */ jpayne@69: /*with:*/ { jpayne@69: __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 419, __pyx_L8_except_error) jpayne@69: __Pyx_GOTREF(__pyx_t_8); jpayne@69: __Pyx_INCREF(__pyx_v_fn); jpayne@69: __Pyx_GIVEREF(__pyx_v_fn); jpayne@69: if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_fn)) __PYX_ERR(0, 419, __pyx_L8_except_error); jpayne@69: __Pyx_INCREF(__pyx_n_u_rb); jpayne@69: __Pyx_GIVEREF(__pyx_n_u_rb); jpayne@69: if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_n_u_rb)) __PYX_ERR(0, 419, __pyx_L8_except_error); jpayne@69: __pyx_t_17 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_8, NULL); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 419, __pyx_L8_except_error) jpayne@69: __Pyx_GOTREF(__pyx_t_17); jpayne@69: __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; jpayne@69: __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_17, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 419, __pyx_L8_except_error) jpayne@69: __Pyx_GOTREF(__pyx_t_6); jpayne@69: __pyx_t_18 = __Pyx_PyObject_LookupSpecial(__pyx_t_17, __pyx_n_s_enter); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 419, __pyx_L28_error) jpayne@69: __Pyx_GOTREF(__pyx_t_18); jpayne@69: __pyx_t_19 = NULL; jpayne@69: __pyx_t_9 = 0; jpayne@69: #if CYTHON_UNPACK_METHODS jpayne@69: if (likely(PyMethod_Check(__pyx_t_18))) { jpayne@69: __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_18); jpayne@69: if (likely(__pyx_t_19)) { jpayne@69: PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_18); jpayne@69: __Pyx_INCREF(__pyx_t_19); jpayne@69: __Pyx_INCREF(function); jpayne@69: __Pyx_DECREF_SET(__pyx_t_18, function); jpayne@69: __pyx_t_9 = 1; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: { jpayne@69: PyObject *__pyx_callargs[2] = {__pyx_t_19, NULL}; jpayne@69: __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_18, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9); jpayne@69: __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; jpayne@69: if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 419, __pyx_L28_error) jpayne@69: __Pyx_GOTREF(__pyx_t_8); jpayne@69: __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; jpayne@69: } jpayne@69: __pyx_t_18 = __pyx_t_8; jpayne@69: __pyx_t_8 = 0; jpayne@69: __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; jpayne@69: /*try:*/ { jpayne@69: { jpayne@69: __Pyx_PyThreadState_declare jpayne@69: __Pyx_PyThreadState_assign jpayne@69: __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); jpayne@69: __Pyx_XGOTREF(__pyx_t_12); jpayne@69: __Pyx_XGOTREF(__pyx_t_11); jpayne@69: __Pyx_XGOTREF(__pyx_t_10); jpayne@69: /*try:*/ { jpayne@69: __Pyx_XDECREF_SET(__pyx_v_inf, __pyx_t_18); jpayne@69: __pyx_t_18 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":421 jpayne@69: * with open(fn, "rb") as inf: jpayne@69: * # read binary output jpayne@69: * out = inf.read() # <<<<<<<<<<<<<< jpayne@69: * finally: jpayne@69: * os.remove(fn) jpayne@69: */ jpayne@69: __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_inf, __pyx_n_s_read); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 421, __pyx_L34_error) jpayne@69: __Pyx_GOTREF(__pyx_t_17); jpayne@69: __pyx_t_8 = NULL; jpayne@69: __pyx_t_9 = 0; jpayne@69: #if CYTHON_UNPACK_METHODS jpayne@69: if (likely(PyMethod_Check(__pyx_t_17))) { jpayne@69: __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_17); jpayne@69: if (likely(__pyx_t_8)) { jpayne@69: PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17); jpayne@69: __Pyx_INCREF(__pyx_t_8); jpayne@69: __Pyx_INCREF(function); jpayne@69: __Pyx_DECREF_SET(__pyx_t_17, function); jpayne@69: __pyx_t_9 = 1; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: { jpayne@69: PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; jpayne@69: __pyx_t_18 = __Pyx_PyObject_FastCall(__pyx_t_17, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9); jpayne@69: __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; jpayne@69: if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 421, __pyx_L34_error) jpayne@69: __Pyx_GOTREF(__pyx_t_18); jpayne@69: __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; jpayne@69: } jpayne@69: __Pyx_DECREF_SET(__pyx_v_out, __pyx_t_18); jpayne@69: __pyx_t_18 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":419 jpayne@69: * out = inf.read() jpayne@69: * except UnicodeDecodeError: jpayne@69: * with open(fn, "rb") as inf: # <<<<<<<<<<<<<< jpayne@69: * # read binary output jpayne@69: * out = inf.read() jpayne@69: */ jpayne@69: } jpayne@69: __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; jpayne@69: goto __pyx_L41_try_end; jpayne@69: __pyx_L34_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; jpayne@69: /*except:*/ { jpayne@69: __Pyx_AddTraceback("pysam.libcutils._pysam_dispatch._collect", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: if (__Pyx_GetException(&__pyx_t_18, &__pyx_t_17, &__pyx_t_8) < 0) __PYX_ERR(0, 419, __pyx_L36_except_error) jpayne@69: __Pyx_XGOTREF(__pyx_t_18); jpayne@69: __Pyx_XGOTREF(__pyx_t_17); jpayne@69: __Pyx_XGOTREF(__pyx_t_8); jpayne@69: __pyx_t_19 = PyTuple_Pack(3, __pyx_t_18, __pyx_t_17, __pyx_t_8); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 419, __pyx_L36_except_error) jpayne@69: __Pyx_GOTREF(__pyx_t_19); jpayne@69: __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_19, NULL); jpayne@69: __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; jpayne@69: __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; jpayne@69: if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 419, __pyx_L36_except_error) jpayne@69: __Pyx_GOTREF(__pyx_t_13); jpayne@69: __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_13); jpayne@69: __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; jpayne@69: if (__pyx_t_15 < 0) __PYX_ERR(0, 419, __pyx_L36_except_error) jpayne@69: __pyx_t_14 = (!__pyx_t_15); jpayne@69: if (unlikely(__pyx_t_14)) { jpayne@69: __Pyx_GIVEREF(__pyx_t_18); jpayne@69: __Pyx_GIVEREF(__pyx_t_17); jpayne@69: __Pyx_XGIVEREF(__pyx_t_8); jpayne@69: __Pyx_ErrRestoreWithState(__pyx_t_18, __pyx_t_17, __pyx_t_8); jpayne@69: __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_8 = 0; jpayne@69: __PYX_ERR(0, 419, __pyx_L36_except_error) jpayne@69: } jpayne@69: __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; jpayne@69: goto __pyx_L35_exception_handled; jpayne@69: } jpayne@69: __pyx_L36_except_error:; jpayne@69: __Pyx_XGIVEREF(__pyx_t_12); jpayne@69: __Pyx_XGIVEREF(__pyx_t_11); jpayne@69: __Pyx_XGIVEREF(__pyx_t_10); jpayne@69: __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_11, __pyx_t_10); jpayne@69: goto __pyx_L8_except_error; jpayne@69: __pyx_L35_exception_handled:; jpayne@69: __Pyx_XGIVEREF(__pyx_t_12); jpayne@69: __Pyx_XGIVEREF(__pyx_t_11); jpayne@69: __Pyx_XGIVEREF(__pyx_t_10); jpayne@69: __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_11, __pyx_t_10); jpayne@69: __pyx_L41_try_end:; jpayne@69: } jpayne@69: } jpayne@69: /*finally:*/ { jpayne@69: /*normal exit:*/{ jpayne@69: if (__pyx_t_6) { jpayne@69: __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__9, NULL); jpayne@69: __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; jpayne@69: if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 419, __pyx_L8_except_error) jpayne@69: __Pyx_GOTREF(__pyx_t_10); jpayne@69: __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; jpayne@69: } jpayne@69: goto __pyx_L33; jpayne@69: } jpayne@69: __pyx_L33:; jpayne@69: } jpayne@69: goto __pyx_L45; jpayne@69: __pyx_L28_error:; jpayne@69: __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; jpayne@69: goto __pyx_L8_except_error; jpayne@69: __pyx_L45:; jpayne@69: } jpayne@69: __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; jpayne@69: goto __pyx_L7_exception_handled; jpayne@69: } jpayne@69: goto __pyx_L8_except_error; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":415 jpayne@69: * def _collect(fn): jpayne@69: * out = [] jpayne@69: * try: # <<<<<<<<<<<<<< jpayne@69: * with open(fn, "r") as inf: jpayne@69: * out = inf.read() jpayne@69: */ jpayne@69: __pyx_L8_except_error:; jpayne@69: __Pyx_XGIVEREF(__pyx_t_2); jpayne@69: __Pyx_XGIVEREF(__pyx_t_3); jpayne@69: __Pyx_XGIVEREF(__pyx_t_4); jpayne@69: __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); jpayne@69: goto __pyx_L4_error; jpayne@69: __pyx_L7_exception_handled:; jpayne@69: __Pyx_XGIVEREF(__pyx_t_2); jpayne@69: __Pyx_XGIVEREF(__pyx_t_3); jpayne@69: __Pyx_XGIVEREF(__pyx_t_4); jpayne@69: __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); jpayne@69: __pyx_L11_try_end:; jpayne@69: } jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":423 jpayne@69: * out = inf.read() jpayne@69: * finally: jpayne@69: * os.remove(fn) # <<<<<<<<<<<<<< jpayne@69: * return out jpayne@69: * jpayne@69: */ jpayne@69: /*finally:*/ { jpayne@69: /*normal exit:*/{ jpayne@69: __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 423, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_5); jpayne@69: __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_remove); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_1); jpayne@69: __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; jpayne@69: __pyx_t_5 = NULL; jpayne@69: __pyx_t_9 = 0; jpayne@69: #if CYTHON_UNPACK_METHODS jpayne@69: if (unlikely(PyMethod_Check(__pyx_t_1))) { jpayne@69: __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); jpayne@69: if (likely(__pyx_t_5)) { jpayne@69: PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); jpayne@69: __Pyx_INCREF(__pyx_t_5); jpayne@69: __Pyx_INCREF(function); jpayne@69: __Pyx_DECREF_SET(__pyx_t_1, function); jpayne@69: __pyx_t_9 = 1; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: { jpayne@69: PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_fn}; jpayne@69: __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); jpayne@69: __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; jpayne@69: if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 423, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_7); jpayne@69: __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; jpayne@69: } jpayne@69: __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; jpayne@69: goto __pyx_L5; jpayne@69: } jpayne@69: __pyx_L4_error:; jpayne@69: /*exception exit:*/{ jpayne@69: __Pyx_PyThreadState_declare jpayne@69: __Pyx_PyThreadState_assign jpayne@69: __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_6 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; jpayne@69: if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_6, &__pyx_t_10, &__pyx_t_11); jpayne@69: if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2) < 0)) __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2); jpayne@69: __Pyx_XGOTREF(__pyx_t_4); jpayne@69: __Pyx_XGOTREF(__pyx_t_3); jpayne@69: __Pyx_XGOTREF(__pyx_t_2); jpayne@69: __Pyx_XGOTREF(__pyx_t_6); jpayne@69: __Pyx_XGOTREF(__pyx_t_10); jpayne@69: __Pyx_XGOTREF(__pyx_t_11); jpayne@69: __pyx_t_16 = __pyx_lineno; __pyx_t_20 = __pyx_clineno; __pyx_t_21 = __pyx_filename; jpayne@69: { jpayne@69: __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L47_error) jpayne@69: __Pyx_GOTREF(__pyx_t_1); jpayne@69: __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_remove); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 423, __pyx_L47_error) jpayne@69: __Pyx_GOTREF(__pyx_t_5); jpayne@69: __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; jpayne@69: __pyx_t_1 = NULL; jpayne@69: __pyx_t_9 = 0; jpayne@69: #if CYTHON_UNPACK_METHODS jpayne@69: if (unlikely(PyMethod_Check(__pyx_t_5))) { jpayne@69: __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); jpayne@69: if (likely(__pyx_t_1)) { jpayne@69: PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); jpayne@69: __Pyx_INCREF(__pyx_t_1); jpayne@69: __Pyx_INCREF(function); jpayne@69: __Pyx_DECREF_SET(__pyx_t_5, function); jpayne@69: __pyx_t_9 = 1; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: { jpayne@69: PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_fn}; jpayne@69: __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); jpayne@69: __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; jpayne@69: if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 423, __pyx_L47_error) jpayne@69: __Pyx_GOTREF(__pyx_t_7); jpayne@69: __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; jpayne@69: } jpayne@69: __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; jpayne@69: } jpayne@69: if (PY_MAJOR_VERSION >= 3) { jpayne@69: __Pyx_XGIVEREF(__pyx_t_6); jpayne@69: __Pyx_XGIVEREF(__pyx_t_10); jpayne@69: __Pyx_XGIVEREF(__pyx_t_11); jpayne@69: __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_10, __pyx_t_11); jpayne@69: } jpayne@69: __Pyx_XGIVEREF(__pyx_t_4); jpayne@69: __Pyx_XGIVEREF(__pyx_t_3); jpayne@69: __Pyx_XGIVEREF(__pyx_t_2); jpayne@69: __Pyx_ErrRestore(__pyx_t_4, __pyx_t_3, __pyx_t_2); jpayne@69: __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_6 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; jpayne@69: __pyx_lineno = __pyx_t_16; __pyx_clineno = __pyx_t_20; __pyx_filename = __pyx_t_21; jpayne@69: goto __pyx_L1_error; jpayne@69: __pyx_L47_error:; jpayne@69: if (PY_MAJOR_VERSION >= 3) { jpayne@69: __Pyx_XGIVEREF(__pyx_t_6); jpayne@69: __Pyx_XGIVEREF(__pyx_t_10); jpayne@69: __Pyx_XGIVEREF(__pyx_t_11); jpayne@69: __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_10, __pyx_t_11); jpayne@69: } jpayne@69: __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: __pyx_t_6 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; jpayne@69: goto __pyx_L1_error; jpayne@69: } jpayne@69: __pyx_L5:; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":424 jpayne@69: * finally: jpayne@69: * os.remove(fn) jpayne@69: * return out # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * out_stderr = _collect(stderr_f) jpayne@69: */ jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __Pyx_INCREF(__pyx_v_out); jpayne@69: __pyx_r = __pyx_v_out; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":413 jpayne@69: * jpayne@69: * # get error messages jpayne@69: * def _collect(fn): # <<<<<<<<<<<<<< jpayne@69: * out = [] jpayne@69: * try: jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_1); jpayne@69: __Pyx_XDECREF(__pyx_t_5); jpayne@69: __Pyx_XDECREF(__pyx_t_7); jpayne@69: __Pyx_XDECREF(__pyx_t_8); jpayne@69: __Pyx_XDECREF(__pyx_t_17); jpayne@69: __Pyx_XDECREF(__pyx_t_18); jpayne@69: __Pyx_XDECREF(__pyx_t_19); jpayne@69: __Pyx_AddTraceback("pysam.libcutils._pysam_dispatch._collect", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __pyx_r = NULL; jpayne@69: __pyx_L0:; jpayne@69: __Pyx_XDECREF(__pyx_v_out); jpayne@69: __Pyx_XDECREF(__pyx_v_inf); jpayne@69: __Pyx_XGIVEREF(__pyx_r); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":276 jpayne@69: * jpayne@69: * jpayne@69: * def _pysam_dispatch(collection, # <<<<<<<<<<<<<< jpayne@69: * method, jpayne@69: * args=None, jpayne@69: */ jpayne@69: jpayne@69: static PyObject *__pyx_pf_5pysam_9libcutils_14_pysam_dispatch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_collection, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_catch_stdout, PyObject *__pyx_v_is_usage, PyObject *__pyx_v_save_stdout) { jpayne@69: PyObject *__pyx_v_ARGUMENTS = NULL; jpayne@69: int __pyx_v_skip_next; jpayne@69: PyObject *__pyx_v_arg = NULL; jpayne@69: PyObject *__pyx_v_stderr_h = NULL; jpayne@69: PyObject *__pyx_v_stderr_f = NULL; jpayne@69: PyObject *__pyx_v_stdout_f = NULL; jpayne@69: PyObject *__pyx_v_stdout_h = NULL; jpayne@69: PyObject *__pyx_v_MAP_STDOUT_OPTIONS = NULL; jpayne@69: PyObject *__pyx_v_stdout_option = NULL; jpayne@69: char **__pyx_v_cargs; jpayne@69: int __pyx_v_i; jpayne@69: int __pyx_v_n; jpayne@69: int __pyx_v_retval; jpayne@69: int __pyx_v_l; jpayne@69: int __pyx_v_extra_args; jpayne@69: PyObject *__pyx_v__collect = 0; jpayne@69: PyObject *__pyx_v_out_stderr = NULL; jpayne@69: PyObject *__pyx_v_out_stdout = NULL; jpayne@69: PyObject *__pyx_8genexpr2__pyx_v_a = NULL; jpayne@69: PyObject *__pyx_r = NULL; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: int __pyx_t_1; jpayne@69: int __pyx_t_2; jpayne@69: PyObject *__pyx_t_3 = NULL; jpayne@69: Py_ssize_t __pyx_t_4; jpayne@69: PyObject *(*__pyx_t_5)(PyObject *); jpayne@69: PyObject *__pyx_t_6 = NULL; jpayne@69: PyObject *__pyx_t_7 = NULL; jpayne@69: PyObject *__pyx_t_8 = NULL; jpayne@69: unsigned int __pyx_t_9; jpayne@69: PyObject *(*__pyx_t_10)(PyObject *); jpayne@69: char const *__pyx_t_11; jpayne@69: char const *__pyx_t_12; jpayne@69: char const *__pyx_t_13; jpayne@69: int __pyx_t_14; jpayne@69: PyObject *__pyx_t_15 = NULL; jpayne@69: PyObject *__pyx_t_16 = NULL; jpayne@69: char *__pyx_t_17; jpayne@69: int __pyx_t_18; jpayne@69: char const *__pyx_t_19; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: __Pyx_RefNannySetupContext("_pysam_dispatch", 0); jpayne@69: __Pyx_INCREF(__pyx_v_collection); jpayne@69: __Pyx_INCREF(__pyx_v_method); jpayne@69: __Pyx_INCREF(__pyx_v_args); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":294 jpayne@69: * ''' jpayne@69: * jpayne@69: * if method == "index" and args: # <<<<<<<<<<<<<< jpayne@69: * # We make sure that at least the first specified input file exists, jpayne@69: * # and if it doesn't we raise an IOError. jpayne@69: */ jpayne@69: __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_method, __pyx_n_u_index, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 294, __pyx_L1_error) jpayne@69: if (__pyx_t_2) { jpayne@69: } else { jpayne@69: __pyx_t_1 = __pyx_t_2; jpayne@69: goto __pyx_L4_bool_binop_done; jpayne@69: } jpayne@69: __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_args); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 294, __pyx_L1_error) jpayne@69: __pyx_t_1 = __pyx_t_2; jpayne@69: __pyx_L4_bool_binop_done:; jpayne@69: if (__pyx_t_1) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":297 jpayne@69: * # We make sure that at least the first specified input file exists, jpayne@69: * # and if it doesn't we raise an IOError. jpayne@69: * ARGUMENTS = ['-m', '--min-shift', '-o', '--output', '--output-file', '-@', '--threads'] # <<<<<<<<<<<<<< jpayne@69: * skip_next = False jpayne@69: * for arg in args: jpayne@69: */ jpayne@69: __pyx_t_3 = PyList_New(7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __Pyx_INCREF(__pyx_kp_u_m); jpayne@69: __Pyx_GIVEREF(__pyx_kp_u_m); jpayne@69: if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_m)) __PYX_ERR(0, 297, __pyx_L1_error); jpayne@69: __Pyx_INCREF(__pyx_kp_u_min_shift); jpayne@69: __Pyx_GIVEREF(__pyx_kp_u_min_shift); jpayne@69: if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u_min_shift)) __PYX_ERR(0, 297, __pyx_L1_error); jpayne@69: __Pyx_INCREF(__pyx_kp_u_o); jpayne@69: __Pyx_GIVEREF(__pyx_kp_u_o); jpayne@69: if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_o)) __PYX_ERR(0, 297, __pyx_L1_error); jpayne@69: __Pyx_INCREF(__pyx_kp_u_output); jpayne@69: __Pyx_GIVEREF(__pyx_kp_u_output); jpayne@69: if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_kp_u_output)) __PYX_ERR(0, 297, __pyx_L1_error); jpayne@69: __Pyx_INCREF(__pyx_kp_u_output_file); jpayne@69: __Pyx_GIVEREF(__pyx_kp_u_output_file); jpayne@69: if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u_output_file)) __PYX_ERR(0, 297, __pyx_L1_error); jpayne@69: __Pyx_INCREF(__pyx_kp_u__10); jpayne@69: __Pyx_GIVEREF(__pyx_kp_u__10); jpayne@69: if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 5, __pyx_kp_u__10)) __PYX_ERR(0, 297, __pyx_L1_error); jpayne@69: __Pyx_INCREF(__pyx_kp_u_threads); jpayne@69: __Pyx_GIVEREF(__pyx_kp_u_threads); jpayne@69: if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 6, __pyx_kp_u_threads)) __PYX_ERR(0, 297, __pyx_L1_error); jpayne@69: __pyx_v_ARGUMENTS = ((PyObject*)__pyx_t_3); jpayne@69: __pyx_t_3 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":298 jpayne@69: * # and if it doesn't we raise an IOError. jpayne@69: * ARGUMENTS = ['-m', '--min-shift', '-o', '--output', '--output-file', '-@', '--threads'] jpayne@69: * skip_next = False # <<<<<<<<<<<<<< jpayne@69: * for arg in args: jpayne@69: * if skip_next: jpayne@69: */ jpayne@69: __pyx_v_skip_next = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":299 jpayne@69: * ARGUMENTS = ['-m', '--min-shift', '-o', '--output', '--output-file', '-@', '--threads'] jpayne@69: * skip_next = False jpayne@69: * for arg in args: # <<<<<<<<<<<<<< jpayne@69: * if skip_next: jpayne@69: * skip_next = False jpayne@69: */ jpayne@69: if (likely(PyList_CheckExact(__pyx_v_args)) || PyTuple_CheckExact(__pyx_v_args)) { jpayne@69: __pyx_t_3 = __pyx_v_args; __Pyx_INCREF(__pyx_t_3); jpayne@69: __pyx_t_4 = 0; jpayne@69: __pyx_t_5 = NULL; jpayne@69: } else { jpayne@69: __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 299, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 299, __pyx_L1_error) jpayne@69: } jpayne@69: for (;;) { jpayne@69: if (likely(!__pyx_t_5)) { jpayne@69: if (likely(PyList_CheckExact(__pyx_t_3))) { jpayne@69: { jpayne@69: Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); jpayne@69: #if !CYTHON_ASSUME_SAFE_MACROS jpayne@69: if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 299, __pyx_L1_error) jpayne@69: #endif jpayne@69: if (__pyx_t_4 >= __pyx_temp) break; jpayne@69: } jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS jpayne@69: __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 299, __pyx_L1_error) jpayne@69: #else jpayne@69: __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 299, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_6); jpayne@69: #endif jpayne@69: } else { jpayne@69: { jpayne@69: Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); jpayne@69: #if !CYTHON_ASSUME_SAFE_MACROS jpayne@69: if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 299, __pyx_L1_error) jpayne@69: #endif jpayne@69: if (__pyx_t_4 >= __pyx_temp) break; jpayne@69: } jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS jpayne@69: __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 299, __pyx_L1_error) jpayne@69: #else jpayne@69: __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 299, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_6); jpayne@69: #endif jpayne@69: } jpayne@69: } else { jpayne@69: __pyx_t_6 = __pyx_t_5(__pyx_t_3); jpayne@69: if (unlikely(!__pyx_t_6)) { jpayne@69: PyObject* exc_type = PyErr_Occurred(); jpayne@69: if (exc_type) { jpayne@69: if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); jpayne@69: else __PYX_ERR(0, 299, __pyx_L1_error) jpayne@69: } jpayne@69: break; jpayne@69: } jpayne@69: __Pyx_GOTREF(__pyx_t_6); jpayne@69: } jpayne@69: __Pyx_XDECREF_SET(__pyx_v_arg, __pyx_t_6); jpayne@69: __pyx_t_6 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":300 jpayne@69: * skip_next = False jpayne@69: * for arg in args: jpayne@69: * if skip_next: # <<<<<<<<<<<<<< jpayne@69: * skip_next = False jpayne@69: * continue jpayne@69: */ jpayne@69: if (__pyx_v_skip_next) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":301 jpayne@69: * for arg in args: jpayne@69: * if skip_next: jpayne@69: * skip_next = False # <<<<<<<<<<<<<< jpayne@69: * continue jpayne@69: * if arg.startswith('-'): jpayne@69: */ jpayne@69: __pyx_v_skip_next = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":302 jpayne@69: * if skip_next: jpayne@69: * skip_next = False jpayne@69: * continue # <<<<<<<<<<<<<< jpayne@69: * if arg.startswith('-'): jpayne@69: * # Skip next argument for e.g. '--min-shift' '12' or '-m' '12' but not '-m12' jpayne@69: */ jpayne@69: goto __pyx_L6_continue; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":300 jpayne@69: * skip_next = False jpayne@69: * for arg in args: jpayne@69: * if skip_next: # <<<<<<<<<<<<<< jpayne@69: * skip_next = False jpayne@69: * continue jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":303 jpayne@69: * skip_next = False jpayne@69: * continue jpayne@69: * if arg.startswith('-'): # <<<<<<<<<<<<<< jpayne@69: * # Skip next argument for e.g. '--min-shift' '12' or '-m' '12' but not '-m12' jpayne@69: * if arg in ARGUMENTS: jpayne@69: */ jpayne@69: __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_startswith); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 303, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_7); jpayne@69: __pyx_t_8 = NULL; jpayne@69: __pyx_t_9 = 0; jpayne@69: #if CYTHON_UNPACK_METHODS jpayne@69: if (likely(PyMethod_Check(__pyx_t_7))) { jpayne@69: __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); jpayne@69: if (likely(__pyx_t_8)) { jpayne@69: PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); jpayne@69: __Pyx_INCREF(__pyx_t_8); jpayne@69: __Pyx_INCREF(function); jpayne@69: __Pyx_DECREF_SET(__pyx_t_7, function); jpayne@69: __pyx_t_9 = 1; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: { jpayne@69: PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_kp_u__8}; jpayne@69: __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); jpayne@69: __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; jpayne@69: if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 303, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_6); jpayne@69: __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; jpayne@69: } jpayne@69: __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 303, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; jpayne@69: if (__pyx_t_1) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":305 jpayne@69: * if arg.startswith('-'): jpayne@69: * # Skip next argument for e.g. '--min-shift' '12' or '-m' '12' but not '-m12' jpayne@69: * if arg in ARGUMENTS: # <<<<<<<<<<<<<< jpayne@69: * skip_next = True jpayne@69: * continue jpayne@69: */ jpayne@69: __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_arg, __pyx_v_ARGUMENTS, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 305, __pyx_L1_error) jpayne@69: if (__pyx_t_1) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":306 jpayne@69: * # Skip next argument for e.g. '--min-shift' '12' or '-m' '12' but not '-m12' jpayne@69: * if arg in ARGUMENTS: jpayne@69: * skip_next = True # <<<<<<<<<<<<<< jpayne@69: * continue jpayne@69: * if not os.path.exists(arg): jpayne@69: */ jpayne@69: __pyx_v_skip_next = 1; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":305 jpayne@69: * if arg.startswith('-'): jpayne@69: * # Skip next argument for e.g. '--min-shift' '12' or '-m' '12' but not '-m12' jpayne@69: * if arg in ARGUMENTS: # <<<<<<<<<<<<<< jpayne@69: * skip_next = True jpayne@69: * continue jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":307 jpayne@69: * if arg in ARGUMENTS: jpayne@69: * skip_next = True jpayne@69: * continue # <<<<<<<<<<<<<< jpayne@69: * if not os.path.exists(arg): jpayne@69: * raise IOError("No such file or directory: '%s'" % arg) jpayne@69: */ jpayne@69: goto __pyx_L6_continue; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":303 jpayne@69: * skip_next = False jpayne@69: * continue jpayne@69: * if arg.startswith('-'): # <<<<<<<<<<<<<< jpayne@69: * # Skip next argument for e.g. '--min-shift' '12' or '-m' '12' but not '-m12' jpayne@69: * if arg in ARGUMENTS: jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":308 jpayne@69: * skip_next = True jpayne@69: * continue jpayne@69: * if not os.path.exists(arg): # <<<<<<<<<<<<<< jpayne@69: * raise IOError("No such file or directory: '%s'" % arg) jpayne@69: * else: jpayne@69: */ jpayne@69: __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 308, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_7); jpayne@69: __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_path); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 308, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_8); jpayne@69: __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; jpayne@69: __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_exists); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 308, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_7); jpayne@69: __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; jpayne@69: __pyx_t_8 = NULL; jpayne@69: __pyx_t_9 = 0; jpayne@69: #if CYTHON_UNPACK_METHODS jpayne@69: if (likely(PyMethod_Check(__pyx_t_7))) { jpayne@69: __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); jpayne@69: if (likely(__pyx_t_8)) { jpayne@69: PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); jpayne@69: __Pyx_INCREF(__pyx_t_8); jpayne@69: __Pyx_INCREF(function); jpayne@69: __Pyx_DECREF_SET(__pyx_t_7, function); jpayne@69: __pyx_t_9 = 1; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: { jpayne@69: PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_arg}; jpayne@69: __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); jpayne@69: __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; jpayne@69: if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 308, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_6); jpayne@69: __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; jpayne@69: } jpayne@69: __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 308, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; jpayne@69: __pyx_t_2 = (!__pyx_t_1); jpayne@69: if (unlikely(__pyx_t_2)) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":309 jpayne@69: * continue jpayne@69: * if not os.path.exists(arg): jpayne@69: * raise IOError("No such file or directory: '%s'" % arg) # <<<<<<<<<<<<<< jpayne@69: * else: jpayne@69: * break jpayne@69: */ jpayne@69: __pyx_t_6 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_No_such_file_or_directory_s, __pyx_v_arg); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_6); jpayne@69: __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 309, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_7); jpayne@69: __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; jpayne@69: __Pyx_Raise(__pyx_t_7, 0, 0, 0); jpayne@69: __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; jpayne@69: __PYX_ERR(0, 309, __pyx_L1_error) jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":308 jpayne@69: * skip_next = True jpayne@69: * continue jpayne@69: * if not os.path.exists(arg): # <<<<<<<<<<<<<< jpayne@69: * raise IOError("No such file or directory: '%s'" % arg) jpayne@69: * else: jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":311 jpayne@69: * raise IOError("No such file or directory: '%s'" % arg) jpayne@69: * else: jpayne@69: * break # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * if args is None: jpayne@69: */ jpayne@69: /*else*/ { jpayne@69: goto __pyx_L7_break; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":299 jpayne@69: * ARGUMENTS = ['-m', '--min-shift', '-o', '--output', '--output-file', '-@', '--threads'] jpayne@69: * skip_next = False jpayne@69: * for arg in args: # <<<<<<<<<<<<<< jpayne@69: * if skip_next: jpayne@69: * skip_next = False jpayne@69: */ jpayne@69: __pyx_L6_continue:; jpayne@69: } jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: goto __pyx_L12_for_end; jpayne@69: __pyx_L7_break:; jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: goto __pyx_L12_for_end; jpayne@69: __pyx_L12_for_end:; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":294 jpayne@69: * ''' jpayne@69: * jpayne@69: * if method == "index" and args: # <<<<<<<<<<<<<< jpayne@69: * # We make sure that at least the first specified input file exists, jpayne@69: * # and if it doesn't we raise an IOError. jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":313 jpayne@69: * break jpayne@69: * jpayne@69: * if args is None: # <<<<<<<<<<<<<< jpayne@69: * args = [] jpayne@69: * else: jpayne@69: */ jpayne@69: __pyx_t_2 = (__pyx_v_args == Py_None); jpayne@69: if (__pyx_t_2) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":314 jpayne@69: * jpayne@69: * if args is None: jpayne@69: * args = [] # <<<<<<<<<<<<<< jpayne@69: * else: jpayne@69: * args = list(args) jpayne@69: */ jpayne@69: __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __Pyx_DECREF_SET(__pyx_v_args, __pyx_t_3); jpayne@69: __pyx_t_3 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":313 jpayne@69: * break jpayne@69: * jpayne@69: * if args is None: # <<<<<<<<<<<<<< jpayne@69: * args = [] jpayne@69: * else: jpayne@69: */ jpayne@69: goto __pyx_L13; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":316 jpayne@69: * args = [] jpayne@69: * else: jpayne@69: * args = list(args) # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * # redirect stderr to file jpayne@69: */ jpayne@69: /*else*/ { jpayne@69: __pyx_t_3 = PySequence_List(__pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 316, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __Pyx_DECREF_SET(__pyx_v_args, __pyx_t_3); jpayne@69: __pyx_t_3 = 0; jpayne@69: } jpayne@69: __pyx_L13:; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":319 jpayne@69: * jpayne@69: * # redirect stderr to file jpayne@69: * stderr_h, stderr_f = tempfile.mkstemp() # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * # redirect stdout to file jpayne@69: */ jpayne@69: __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_tempfile); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 319, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_7); jpayne@69: __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_mkstemp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 319, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_6); jpayne@69: __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; jpayne@69: __pyx_t_7 = NULL; jpayne@69: __pyx_t_9 = 0; jpayne@69: #if CYTHON_UNPACK_METHODS jpayne@69: if (unlikely(PyMethod_Check(__pyx_t_6))) { jpayne@69: __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); jpayne@69: if (likely(__pyx_t_7)) { jpayne@69: PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); jpayne@69: __Pyx_INCREF(__pyx_t_7); jpayne@69: __Pyx_INCREF(function); jpayne@69: __Pyx_DECREF_SET(__pyx_t_6, function); jpayne@69: __pyx_t_9 = 1; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: { jpayne@69: PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; jpayne@69: __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9); jpayne@69: __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; jpayne@69: if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; jpayne@69: } jpayne@69: if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { jpayne@69: PyObject* sequence = __pyx_t_3; jpayne@69: Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); jpayne@69: if (unlikely(size != 2)) { jpayne@69: if (size > 2) __Pyx_RaiseTooManyValuesError(2); jpayne@69: else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); jpayne@69: __PYX_ERR(0, 319, __pyx_L1_error) jpayne@69: } jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS jpayne@69: if (likely(PyTuple_CheckExact(sequence))) { jpayne@69: __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); jpayne@69: __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); jpayne@69: } else { jpayne@69: __pyx_t_6 = PyList_GET_ITEM(sequence, 0); jpayne@69: __pyx_t_7 = PyList_GET_ITEM(sequence, 1); jpayne@69: } jpayne@69: __Pyx_INCREF(__pyx_t_6); jpayne@69: __Pyx_INCREF(__pyx_t_7); jpayne@69: #else jpayne@69: __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 319, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_6); jpayne@69: __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 319, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_7); jpayne@69: #endif jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: } else { jpayne@69: Py_ssize_t index = -1; jpayne@69: __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 319, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_8); jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); jpayne@69: index = 0; __pyx_t_6 = __pyx_t_10(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L14_unpacking_failed; jpayne@69: __Pyx_GOTREF(__pyx_t_6); jpayne@69: index = 1; __pyx_t_7 = __pyx_t_10(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L14_unpacking_failed; jpayne@69: __Pyx_GOTREF(__pyx_t_7); jpayne@69: if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_8), 2) < 0) __PYX_ERR(0, 319, __pyx_L1_error) jpayne@69: __pyx_t_10 = NULL; jpayne@69: __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; jpayne@69: goto __pyx_L15_unpacking_done; jpayne@69: __pyx_L14_unpacking_failed:; jpayne@69: __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; jpayne@69: __pyx_t_10 = NULL; jpayne@69: if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); jpayne@69: __PYX_ERR(0, 319, __pyx_L1_error) jpayne@69: __pyx_L15_unpacking_done:; jpayne@69: } jpayne@69: __pyx_v_stderr_h = __pyx_t_6; jpayne@69: __pyx_t_6 = 0; jpayne@69: __pyx_v_stderr_f = __pyx_t_7; jpayne@69: __pyx_t_7 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":322 jpayne@69: * jpayne@69: * # redirect stdout to file jpayne@69: * if save_stdout: # <<<<<<<<<<<<<< jpayne@69: * stdout_f = save_stdout jpayne@69: * stdout_h = c_open(force_bytes(stdout_f), jpayne@69: */ jpayne@69: __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_save_stdout); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 322, __pyx_L1_error) jpayne@69: if (__pyx_t_2) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":323 jpayne@69: * # redirect stdout to file jpayne@69: * if save_stdout: jpayne@69: * stdout_f = save_stdout # <<<<<<<<<<<<<< jpayne@69: * stdout_h = c_open(force_bytes(stdout_f), jpayne@69: * O_WRONLY|O_CREAT|O_TRUNC, 0666) jpayne@69: */ jpayne@69: __Pyx_INCREF(__pyx_v_save_stdout); jpayne@69: __pyx_v_stdout_f = __pyx_v_save_stdout; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":324 jpayne@69: * if save_stdout: jpayne@69: * stdout_f = save_stdout jpayne@69: * stdout_h = c_open(force_bytes(stdout_f), # <<<<<<<<<<<<<< jpayne@69: * O_WRONLY|O_CREAT|O_TRUNC, 0666) jpayne@69: * if stdout_h == -1: jpayne@69: */ jpayne@69: __pyx_t_3 = __pyx_f_5pysam_9libcutils_force_bytes(__pyx_v_stdout_f, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: if (unlikely(__pyx_t_3 == Py_None)) { jpayne@69: PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); jpayne@69: __PYX_ERR(0, 324, __pyx_L1_error) jpayne@69: } jpayne@69: __pyx_t_11 = __Pyx_PyBytes_AsString(__pyx_t_3); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(0, 324, __pyx_L1_error) jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":325 jpayne@69: * stdout_f = save_stdout jpayne@69: * stdout_h = c_open(force_bytes(stdout_f), jpayne@69: * O_WRONLY|O_CREAT|O_TRUNC, 0666) # <<<<<<<<<<<<<< jpayne@69: * if stdout_h == -1: jpayne@69: * raise OSError(errno, "error while opening file for writing", stdout_f) jpayne@69: */ jpayne@69: __pyx_t_7 = __Pyx_PyInt_From_int(open(__pyx_t_11, ((O_WRONLY | O_CREAT) | O_TRUNC), 0666)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 324, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_7); jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: __pyx_v_stdout_h = __pyx_t_7; jpayne@69: __pyx_t_7 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":326 jpayne@69: * stdout_h = c_open(force_bytes(stdout_f), jpayne@69: * O_WRONLY|O_CREAT|O_TRUNC, 0666) jpayne@69: * if stdout_h == -1: # <<<<<<<<<<<<<< jpayne@69: * raise OSError(errno, "error while opening file for writing", stdout_f) jpayne@69: * jpayne@69: */ jpayne@69: __pyx_t_2 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_stdout_h, __pyx_int_neg_1, -1L, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 326, __pyx_L1_error) jpayne@69: if (unlikely(__pyx_t_2)) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":327 jpayne@69: * O_WRONLY|O_CREAT|O_TRUNC, 0666) jpayne@69: * if stdout_h == -1: jpayne@69: * raise OSError(errno, "error while opening file for writing", stdout_f) # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * samtools_set_stdout_fn(force_bytes(stdout_f)) jpayne@69: */ jpayne@69: __pyx_t_7 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 327, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_7); jpayne@69: __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 327, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __Pyx_GIVEREF(__pyx_t_7); jpayne@69: if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7)) __PYX_ERR(0, 327, __pyx_L1_error); jpayne@69: __Pyx_INCREF(__pyx_kp_u_error_while_opening_file_for_wri); jpayne@69: __Pyx_GIVEREF(__pyx_kp_u_error_while_opening_file_for_wri); jpayne@69: if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u_error_while_opening_file_for_wri)) __PYX_ERR(0, 327, __pyx_L1_error); jpayne@69: __Pyx_INCREF(__pyx_v_stdout_f); jpayne@69: __Pyx_GIVEREF(__pyx_v_stdout_f); jpayne@69: if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_stdout_f)) __PYX_ERR(0, 327, __pyx_L1_error); jpayne@69: __pyx_t_7 = 0; jpayne@69: __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 327, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_7); jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: __Pyx_Raise(__pyx_t_7, 0, 0, 0); jpayne@69: __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; jpayne@69: __PYX_ERR(0, 327, __pyx_L1_error) jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":326 jpayne@69: * stdout_h = c_open(force_bytes(stdout_f), jpayne@69: * O_WRONLY|O_CREAT|O_TRUNC, 0666) jpayne@69: * if stdout_h == -1: # <<<<<<<<<<<<<< jpayne@69: * raise OSError(errno, "error while opening file for writing", stdout_f) jpayne@69: * jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":329 jpayne@69: * raise OSError(errno, "error while opening file for writing", stdout_f) jpayne@69: * jpayne@69: * samtools_set_stdout_fn(force_bytes(stdout_f)) # <<<<<<<<<<<<<< jpayne@69: * bcftools_set_stdout_fn(force_bytes(stdout_f)) jpayne@69: * jpayne@69: */ jpayne@69: __pyx_t_7 = __pyx_f_5pysam_9libcutils_force_bytes(__pyx_v_stdout_f, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 329, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_7); jpayne@69: if (unlikely(__pyx_t_7 == Py_None)) { jpayne@69: PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); jpayne@69: __PYX_ERR(0, 329, __pyx_L1_error) jpayne@69: } jpayne@69: __pyx_t_12 = __Pyx_PyBytes_AsString(__pyx_t_7); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(0, 329, __pyx_L1_error) jpayne@69: samtools_set_stdout_fn(__pyx_t_12); jpayne@69: __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":330 jpayne@69: * jpayne@69: * samtools_set_stdout_fn(force_bytes(stdout_f)) jpayne@69: * bcftools_set_stdout_fn(force_bytes(stdout_f)) # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * elif catch_stdout: jpayne@69: */ jpayne@69: __pyx_t_7 = __pyx_f_5pysam_9libcutils_force_bytes(__pyx_v_stdout_f, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 330, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_7); jpayne@69: if (unlikely(__pyx_t_7 == Py_None)) { jpayne@69: PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); jpayne@69: __PYX_ERR(0, 330, __pyx_L1_error) jpayne@69: } jpayne@69: __pyx_t_13 = __Pyx_PyBytes_AsString(__pyx_t_7); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 330, __pyx_L1_error) jpayne@69: bcftools_set_stdout_fn(__pyx_t_13); jpayne@69: __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":322 jpayne@69: * jpayne@69: * # redirect stdout to file jpayne@69: * if save_stdout: # <<<<<<<<<<<<<< jpayne@69: * stdout_f = save_stdout jpayne@69: * stdout_h = c_open(force_bytes(stdout_f), jpayne@69: */ jpayne@69: goto __pyx_L16; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":332 jpayne@69: * bcftools_set_stdout_fn(force_bytes(stdout_f)) jpayne@69: * jpayne@69: * elif catch_stdout: # <<<<<<<<<<<<<< jpayne@69: * stdout_h, stdout_f = tempfile.mkstemp() jpayne@69: * MAP_STDOUT_OPTIONS = { jpayne@69: */ jpayne@69: __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_catch_stdout); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 332, __pyx_L1_error) jpayne@69: if (__pyx_t_2) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":333 jpayne@69: * jpayne@69: * elif catch_stdout: jpayne@69: * stdout_h, stdout_f = tempfile.mkstemp() # <<<<<<<<<<<<<< jpayne@69: * MAP_STDOUT_OPTIONS = { jpayne@69: * "samtools": { jpayne@69: */ jpayne@69: __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_tempfile); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_mkstemp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_6); jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: __pyx_t_3 = NULL; jpayne@69: __pyx_t_9 = 0; jpayne@69: #if CYTHON_UNPACK_METHODS jpayne@69: if (unlikely(PyMethod_Check(__pyx_t_6))) { jpayne@69: __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); jpayne@69: if (likely(__pyx_t_3)) { jpayne@69: PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); jpayne@69: __Pyx_INCREF(__pyx_t_3); jpayne@69: __Pyx_INCREF(function); jpayne@69: __Pyx_DECREF_SET(__pyx_t_6, function); jpayne@69: __pyx_t_9 = 1; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: { jpayne@69: PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; jpayne@69: __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9); jpayne@69: __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 333, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_7); jpayne@69: __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; jpayne@69: } jpayne@69: if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) { jpayne@69: PyObject* sequence = __pyx_t_7; jpayne@69: Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); jpayne@69: if (unlikely(size != 2)) { jpayne@69: if (size > 2) __Pyx_RaiseTooManyValuesError(2); jpayne@69: else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); jpayne@69: __PYX_ERR(0, 333, __pyx_L1_error) jpayne@69: } jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS jpayne@69: if (likely(PyTuple_CheckExact(sequence))) { jpayne@69: __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); jpayne@69: __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); jpayne@69: } else { jpayne@69: __pyx_t_6 = PyList_GET_ITEM(sequence, 0); jpayne@69: __pyx_t_3 = PyList_GET_ITEM(sequence, 1); jpayne@69: } jpayne@69: __Pyx_INCREF(__pyx_t_6); jpayne@69: __Pyx_INCREF(__pyx_t_3); jpayne@69: #else jpayne@69: __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_6); jpayne@69: __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: #endif jpayne@69: __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; jpayne@69: } else { jpayne@69: Py_ssize_t index = -1; jpayne@69: __pyx_t_8 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 333, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_8); jpayne@69: __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; jpayne@69: __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); jpayne@69: index = 0; __pyx_t_6 = __pyx_t_10(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L18_unpacking_failed; jpayne@69: __Pyx_GOTREF(__pyx_t_6); jpayne@69: index = 1; __pyx_t_3 = __pyx_t_10(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L18_unpacking_failed; jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_8), 2) < 0) __PYX_ERR(0, 333, __pyx_L1_error) jpayne@69: __pyx_t_10 = NULL; jpayne@69: __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; jpayne@69: goto __pyx_L19_unpacking_done; jpayne@69: __pyx_L18_unpacking_failed:; jpayne@69: __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; jpayne@69: __pyx_t_10 = NULL; jpayne@69: if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); jpayne@69: __PYX_ERR(0, 333, __pyx_L1_error) jpayne@69: __pyx_L19_unpacking_done:; jpayne@69: } jpayne@69: __pyx_v_stdout_h = __pyx_t_6; jpayne@69: __pyx_t_6 = 0; jpayne@69: __pyx_v_stdout_f = __pyx_t_3; jpayne@69: __pyx_t_3 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":335 jpayne@69: * stdout_h, stdout_f = tempfile.mkstemp() jpayne@69: * MAP_STDOUT_OPTIONS = { jpayne@69: * "samtools": { # <<<<<<<<<<<<<< jpayne@69: * "view": "-o {}", jpayne@69: * "mpileup": "-o {}", jpayne@69: */ jpayne@69: __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 335, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_7); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":336 jpayne@69: * MAP_STDOUT_OPTIONS = { jpayne@69: * "samtools": { jpayne@69: * "view": "-o {}", # <<<<<<<<<<<<<< jpayne@69: * "mpileup": "-o {}", jpayne@69: * "depad": "-o {}", jpayne@69: */ jpayne@69: __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_view, __pyx_kp_u_o_2) < 0) __PYX_ERR(0, 336, __pyx_L1_error) jpayne@69: if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_mpileup, __pyx_kp_u_o_2) < 0) __PYX_ERR(0, 336, __pyx_L1_error) jpayne@69: if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_depad, __pyx_kp_u_o_2) < 0) __PYX_ERR(0, 336, __pyx_L1_error) jpayne@69: if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_calmd, __pyx_kp_u_) < 0) __PYX_ERR(0, 336, __pyx_L1_error) jpayne@69: if (PyDict_SetItem(__pyx_t_7, __pyx_n_u_samtools, __pyx_t_3) < 0) __PYX_ERR(0, 335, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":341 jpayne@69: * "calmd": "", # uses pysam_stdout_fn jpayne@69: * }, jpayne@69: * "bcftools": {} # <<<<<<<<<<<<<< jpayne@69: * } jpayne@69: * jpayne@69: */ jpayne@69: __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 341, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: if (PyDict_SetItem(__pyx_t_7, __pyx_n_u_bcftools, __pyx_t_3) < 0) __PYX_ERR(0, 335, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: __pyx_v_MAP_STDOUT_OPTIONS = ((PyObject*)__pyx_t_7); jpayne@69: __pyx_t_7 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":344 jpayne@69: * } jpayne@69: * jpayne@69: * stdout_option = None # <<<<<<<<<<<<<< jpayne@69: * if collection == "bcftools": jpayne@69: * # in bcftools, most methods accept -o, the exceptions jpayne@69: */ jpayne@69: __Pyx_INCREF(Py_None); jpayne@69: __pyx_v_stdout_option = Py_None; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":345 jpayne@69: * jpayne@69: * stdout_option = None jpayne@69: * if collection == "bcftools": # <<<<<<<<<<<<<< jpayne@69: * # in bcftools, most methods accept -o, the exceptions jpayne@69: * # are below: jpayne@69: */ jpayne@69: __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_collection, __pyx_n_u_bcftools, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 345, __pyx_L1_error) jpayne@69: if (__pyx_t_2) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":348 jpayne@69: * # in bcftools, most methods accept -o, the exceptions jpayne@69: * # are below: jpayne@69: * if method not in ("head", "index", "roh", "stats"): # <<<<<<<<<<<<<< jpayne@69: * stdout_option = "-o {}" jpayne@69: * elif method in MAP_STDOUT_OPTIONS[collection]: jpayne@69: */ jpayne@69: __Pyx_INCREF(__pyx_v_method); jpayne@69: __pyx_t_7 = __pyx_v_method; jpayne@69: __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_n_u_head, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 348, __pyx_L1_error) jpayne@69: if (__pyx_t_1) { jpayne@69: } else { jpayne@69: __pyx_t_2 = __pyx_t_1; jpayne@69: goto __pyx_L22_bool_binop_done; jpayne@69: } jpayne@69: __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_n_u_index, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 348, __pyx_L1_error) jpayne@69: if (__pyx_t_1) { jpayne@69: } else { jpayne@69: __pyx_t_2 = __pyx_t_1; jpayne@69: goto __pyx_L22_bool_binop_done; jpayne@69: } jpayne@69: __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_n_u_roh, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 348, __pyx_L1_error) jpayne@69: if (__pyx_t_1) { jpayne@69: } else { jpayne@69: __pyx_t_2 = __pyx_t_1; jpayne@69: goto __pyx_L22_bool_binop_done; jpayne@69: } jpayne@69: __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_n_u_stats, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 348, __pyx_L1_error) jpayne@69: __pyx_t_2 = __pyx_t_1; jpayne@69: __pyx_L22_bool_binop_done:; jpayne@69: __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; jpayne@69: __pyx_t_1 = __pyx_t_2; jpayne@69: if (__pyx_t_1) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":349 jpayne@69: * # are below: jpayne@69: * if method not in ("head", "index", "roh", "stats"): jpayne@69: * stdout_option = "-o {}" # <<<<<<<<<<<<<< jpayne@69: * elif method in MAP_STDOUT_OPTIONS[collection]: jpayne@69: * # special case - samtools view -c outputs on stdout jpayne@69: */ jpayne@69: __Pyx_INCREF(__pyx_kp_u_o_2); jpayne@69: __Pyx_DECREF_SET(__pyx_v_stdout_option, __pyx_kp_u_o_2); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":348 jpayne@69: * # in bcftools, most methods accept -o, the exceptions jpayne@69: * # are below: jpayne@69: * if method not in ("head", "index", "roh", "stats"): # <<<<<<<<<<<<<< jpayne@69: * stdout_option = "-o {}" jpayne@69: * elif method in MAP_STDOUT_OPTIONS[collection]: jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":345 jpayne@69: * jpayne@69: * stdout_option = None jpayne@69: * if collection == "bcftools": # <<<<<<<<<<<<<< jpayne@69: * # in bcftools, most methods accept -o, the exceptions jpayne@69: * # are below: jpayne@69: */ jpayne@69: goto __pyx_L20; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":350 jpayne@69: * if method not in ("head", "index", "roh", "stats"): jpayne@69: * stdout_option = "-o {}" jpayne@69: * elif method in MAP_STDOUT_OPTIONS[collection]: # <<<<<<<<<<<<<< jpayne@69: * # special case - samtools view -c outputs on stdout jpayne@69: * if not(method == "view" and "-c" in args): jpayne@69: */ jpayne@69: __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_MAP_STDOUT_OPTIONS, __pyx_v_collection); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 350, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_7); jpayne@69: __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_method, __pyx_t_7, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 350, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; jpayne@69: if (__pyx_t_1) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":352 jpayne@69: * elif method in MAP_STDOUT_OPTIONS[collection]: jpayne@69: * # special case - samtools view -c outputs on stdout jpayne@69: * if not(method == "view" and "-c" in args): # <<<<<<<<<<<<<< jpayne@69: * stdout_option = MAP_STDOUT_OPTIONS[collection][method] jpayne@69: * jpayne@69: */ jpayne@69: __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_method, __pyx_n_u_view, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 352, __pyx_L1_error) jpayne@69: if (__pyx_t_2) { jpayne@69: } else { jpayne@69: __pyx_t_1 = __pyx_t_2; jpayne@69: goto __pyx_L27_bool_binop_done; jpayne@69: } jpayne@69: __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u_c, __pyx_v_args, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 352, __pyx_L1_error) jpayne@69: __pyx_t_1 = __pyx_t_2; jpayne@69: __pyx_L27_bool_binop_done:; jpayne@69: __pyx_t_2 = (!__pyx_t_1); jpayne@69: if (__pyx_t_2) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":353 jpayne@69: * # special case - samtools view -c outputs on stdout jpayne@69: * if not(method == "view" and "-c" in args): jpayne@69: * stdout_option = MAP_STDOUT_OPTIONS[collection][method] # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * if stdout_option is not None and not is_usage: jpayne@69: */ jpayne@69: __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_MAP_STDOUT_OPTIONS, __pyx_v_collection); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 353, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_7); jpayne@69: __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_v_method); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 353, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; jpayne@69: __Pyx_DECREF_SET(__pyx_v_stdout_option, __pyx_t_3); jpayne@69: __pyx_t_3 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":352 jpayne@69: * elif method in MAP_STDOUT_OPTIONS[collection]: jpayne@69: * # special case - samtools view -c outputs on stdout jpayne@69: * if not(method == "view" and "-c" in args): # <<<<<<<<<<<<<< jpayne@69: * stdout_option = MAP_STDOUT_OPTIONS[collection][method] jpayne@69: * jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":350 jpayne@69: * if method not in ("head", "index", "roh", "stats"): jpayne@69: * stdout_option = "-o {}" jpayne@69: * elif method in MAP_STDOUT_OPTIONS[collection]: # <<<<<<<<<<<<<< jpayne@69: * # special case - samtools view -c outputs on stdout jpayne@69: * if not(method == "view" and "-c" in args): jpayne@69: */ jpayne@69: } jpayne@69: __pyx_L20:; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":355 jpayne@69: * stdout_option = MAP_STDOUT_OPTIONS[collection][method] jpayne@69: * jpayne@69: * if stdout_option is not None and not is_usage: # <<<<<<<<<<<<<< jpayne@69: * os.close(stdout_h) jpayne@69: * samtools_set_stdout_fn(force_bytes(stdout_f)) jpayne@69: */ jpayne@69: __pyx_t_1 = (__pyx_v_stdout_option != Py_None); jpayne@69: if (__pyx_t_1) { jpayne@69: } else { jpayne@69: __pyx_t_2 = __pyx_t_1; jpayne@69: goto __pyx_L30_bool_binop_done; jpayne@69: } jpayne@69: __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_is_usage); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 355, __pyx_L1_error) jpayne@69: __pyx_t_14 = (!__pyx_t_1); jpayne@69: __pyx_t_2 = __pyx_t_14; jpayne@69: __pyx_L30_bool_binop_done:; jpayne@69: if (__pyx_t_2) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":356 jpayne@69: * jpayne@69: * if stdout_option is not None and not is_usage: jpayne@69: * os.close(stdout_h) # <<<<<<<<<<<<<< jpayne@69: * samtools_set_stdout_fn(force_bytes(stdout_f)) jpayne@69: * bcftools_set_stdout_fn(force_bytes(stdout_f)) jpayne@69: */ jpayne@69: __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 356, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_7); jpayne@69: __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_close); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 356, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_6); jpayne@69: __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; jpayne@69: __pyx_t_7 = NULL; jpayne@69: __pyx_t_9 = 0; jpayne@69: #if CYTHON_UNPACK_METHODS jpayne@69: if (unlikely(PyMethod_Check(__pyx_t_6))) { jpayne@69: __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); jpayne@69: if (likely(__pyx_t_7)) { jpayne@69: PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); jpayne@69: __Pyx_INCREF(__pyx_t_7); jpayne@69: __Pyx_INCREF(function); jpayne@69: __Pyx_DECREF_SET(__pyx_t_6, function); jpayne@69: __pyx_t_9 = 1; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: { jpayne@69: PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_stdout_h}; jpayne@69: __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); jpayne@69: __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; jpayne@69: if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 356, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; jpayne@69: } jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":357 jpayne@69: * if stdout_option is not None and not is_usage: jpayne@69: * os.close(stdout_h) jpayne@69: * samtools_set_stdout_fn(force_bytes(stdout_f)) # <<<<<<<<<<<<<< jpayne@69: * bcftools_set_stdout_fn(force_bytes(stdout_f)) jpayne@69: * args.extend(stdout_option.format(stdout_f).split(" ")) jpayne@69: */ jpayne@69: __pyx_t_3 = __pyx_f_5pysam_9libcutils_force_bytes(__pyx_v_stdout_f, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: if (unlikely(__pyx_t_3 == Py_None)) { jpayne@69: PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); jpayne@69: __PYX_ERR(0, 357, __pyx_L1_error) jpayne@69: } jpayne@69: __pyx_t_12 = __Pyx_PyBytes_AsString(__pyx_t_3); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(0, 357, __pyx_L1_error) jpayne@69: samtools_set_stdout_fn(__pyx_t_12); jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":358 jpayne@69: * os.close(stdout_h) jpayne@69: * samtools_set_stdout_fn(force_bytes(stdout_f)) jpayne@69: * bcftools_set_stdout_fn(force_bytes(stdout_f)) # <<<<<<<<<<<<<< jpayne@69: * args.extend(stdout_option.format(stdout_f).split(" ")) jpayne@69: * stdout_h = c_open(b"/dev/null", O_WRONLY) jpayne@69: */ jpayne@69: __pyx_t_3 = __pyx_f_5pysam_9libcutils_force_bytes(__pyx_v_stdout_f, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: if (unlikely(__pyx_t_3 == Py_None)) { jpayne@69: PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); jpayne@69: __PYX_ERR(0, 358, __pyx_L1_error) jpayne@69: } jpayne@69: __pyx_t_13 = __Pyx_PyBytes_AsString(__pyx_t_3); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 358, __pyx_L1_error) jpayne@69: bcftools_set_stdout_fn(__pyx_t_13); jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":359 jpayne@69: * samtools_set_stdout_fn(force_bytes(stdout_f)) jpayne@69: * bcftools_set_stdout_fn(force_bytes(stdout_f)) jpayne@69: * args.extend(stdout_option.format(stdout_f).split(" ")) # <<<<<<<<<<<<<< jpayne@69: * stdout_h = c_open(b"/dev/null", O_WRONLY) jpayne@69: * else: jpayne@69: */ jpayne@69: __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_args, __pyx_n_s_extend); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 359, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_6); jpayne@69: __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_stdout_option, __pyx_n_s_format); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 359, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_15); jpayne@69: __pyx_t_16 = NULL; jpayne@69: __pyx_t_9 = 0; jpayne@69: #if CYTHON_UNPACK_METHODS jpayne@69: if (likely(PyMethod_Check(__pyx_t_15))) { jpayne@69: __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_15); jpayne@69: if (likely(__pyx_t_16)) { jpayne@69: PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); jpayne@69: __Pyx_INCREF(__pyx_t_16); jpayne@69: __Pyx_INCREF(function); jpayne@69: __Pyx_DECREF_SET(__pyx_t_15, function); jpayne@69: __pyx_t_9 = 1; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: { jpayne@69: PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_v_stdout_f}; jpayne@69: __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); jpayne@69: __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; jpayne@69: if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 359, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_8); jpayne@69: __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; jpayne@69: } jpayne@69: __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_split); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 359, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_15); jpayne@69: __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; jpayne@69: __pyx_t_8 = NULL; jpayne@69: __pyx_t_9 = 0; jpayne@69: #if CYTHON_UNPACK_METHODS jpayne@69: if (likely(PyMethod_Check(__pyx_t_15))) { jpayne@69: __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_15); jpayne@69: if (likely(__pyx_t_8)) { jpayne@69: PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); jpayne@69: __Pyx_INCREF(__pyx_t_8); jpayne@69: __Pyx_INCREF(function); jpayne@69: __Pyx_DECREF_SET(__pyx_t_15, function); jpayne@69: __pyx_t_9 = 1; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: { jpayne@69: PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_kp_u__11}; jpayne@69: __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); jpayne@69: __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; jpayne@69: if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 359, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_7); jpayne@69: __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; jpayne@69: } jpayne@69: __pyx_t_15 = NULL; jpayne@69: __pyx_t_9 = 0; jpayne@69: #if CYTHON_UNPACK_METHODS jpayne@69: if (likely(PyMethod_Check(__pyx_t_6))) { jpayne@69: __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_6); jpayne@69: if (likely(__pyx_t_15)) { jpayne@69: PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); jpayne@69: __Pyx_INCREF(__pyx_t_15); jpayne@69: __Pyx_INCREF(function); jpayne@69: __Pyx_DECREF_SET(__pyx_t_6, function); jpayne@69: __pyx_t_9 = 1; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: { jpayne@69: PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_7}; jpayne@69: __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); jpayne@69: __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; jpayne@69: __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; jpayne@69: if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 359, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; jpayne@69: } jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":360 jpayne@69: * bcftools_set_stdout_fn(force_bytes(stdout_f)) jpayne@69: * args.extend(stdout_option.format(stdout_f).split(" ")) jpayne@69: * stdout_h = c_open(b"/dev/null", O_WRONLY) # <<<<<<<<<<<<<< jpayne@69: * else: jpayne@69: * samtools_set_stdout_fn("-") jpayne@69: */ jpayne@69: __pyx_t_3 = __Pyx_PyInt_From_int(open(((char const *)"/dev/null"), O_WRONLY)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 360, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __Pyx_DECREF_SET(__pyx_v_stdout_h, __pyx_t_3); jpayne@69: __pyx_t_3 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":355 jpayne@69: * stdout_option = MAP_STDOUT_OPTIONS[collection][method] jpayne@69: * jpayne@69: * if stdout_option is not None and not is_usage: # <<<<<<<<<<<<<< jpayne@69: * os.close(stdout_h) jpayne@69: * samtools_set_stdout_fn(force_bytes(stdout_f)) jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":332 jpayne@69: * bcftools_set_stdout_fn(force_bytes(stdout_f)) jpayne@69: * jpayne@69: * elif catch_stdout: # <<<<<<<<<<<<<< jpayne@69: * stdout_h, stdout_f = tempfile.mkstemp() jpayne@69: * MAP_STDOUT_OPTIONS = { jpayne@69: */ jpayne@69: goto __pyx_L16; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":362 jpayne@69: * stdout_h = c_open(b"/dev/null", O_WRONLY) jpayne@69: * else: jpayne@69: * samtools_set_stdout_fn("-") # <<<<<<<<<<<<<< jpayne@69: * bcftools_set_stdout_fn("-") jpayne@69: * stdout_h = c_open(b"/dev/null", O_WRONLY) jpayne@69: */ jpayne@69: /*else*/ { jpayne@69: samtools_set_stdout_fn(((char const *)"-")); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":363 jpayne@69: * else: jpayne@69: * samtools_set_stdout_fn("-") jpayne@69: * bcftools_set_stdout_fn("-") # <<<<<<<<<<<<<< jpayne@69: * stdout_h = c_open(b"/dev/null", O_WRONLY) jpayne@69: * jpayne@69: */ jpayne@69: bcftools_set_stdout_fn(((char const *)"-")); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":364 jpayne@69: * samtools_set_stdout_fn("-") jpayne@69: * bcftools_set_stdout_fn("-") jpayne@69: * stdout_h = c_open(b"/dev/null", O_WRONLY) # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * # setup the function call to samtools/bcftools main jpayne@69: */ jpayne@69: __pyx_t_3 = __Pyx_PyInt_From_int(open(((char const *)"/dev/null"), O_WRONLY)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 364, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __pyx_v_stdout_h = __pyx_t_3; jpayne@69: __pyx_t_3 = 0; jpayne@69: } jpayne@69: __pyx_L16:; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":369 jpayne@69: * cdef char ** cargs jpayne@69: * cdef int i, n, retval, l jpayne@69: * n = len(args) # <<<<<<<<<<<<<< jpayne@69: * method = force_bytes(method) jpayne@69: * collection = force_bytes(collection) jpayne@69: */ jpayne@69: __pyx_t_4 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 369, __pyx_L1_error) jpayne@69: __pyx_v_n = __pyx_t_4; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":370 jpayne@69: * cdef int i, n, retval, l jpayne@69: * n = len(args) jpayne@69: * method = force_bytes(method) # <<<<<<<<<<<<<< jpayne@69: * collection = force_bytes(collection) jpayne@69: * args = [force_bytes(a) for a in args] jpayne@69: */ jpayne@69: __pyx_t_3 = __pyx_f_5pysam_9libcutils_force_bytes(__pyx_v_method, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 370, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __Pyx_DECREF_SET(__pyx_v_method, __pyx_t_3); jpayne@69: __pyx_t_3 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":371 jpayne@69: * n = len(args) jpayne@69: * method = force_bytes(method) jpayne@69: * collection = force_bytes(collection) # <<<<<<<<<<<<<< jpayne@69: * args = [force_bytes(a) for a in args] jpayne@69: * jpayne@69: */ jpayne@69: __pyx_t_3 = __pyx_f_5pysam_9libcutils_force_bytes(__pyx_v_collection, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 371, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __Pyx_DECREF_SET(__pyx_v_collection, __pyx_t_3); jpayne@69: __pyx_t_3 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":372 jpayne@69: * method = force_bytes(method) jpayne@69: * collection = force_bytes(collection) jpayne@69: * args = [force_bytes(a) for a in args] # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * # allocate two more for first (dummy) argument (contains command) jpayne@69: */ jpayne@69: { /* enter inner scope */ jpayne@69: __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L34_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: if (likely(PyList_CheckExact(__pyx_v_args)) || PyTuple_CheckExact(__pyx_v_args)) { jpayne@69: __pyx_t_6 = __pyx_v_args; __Pyx_INCREF(__pyx_t_6); jpayne@69: __pyx_t_4 = 0; jpayne@69: __pyx_t_5 = NULL; jpayne@69: } else { jpayne@69: __pyx_t_4 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 372, __pyx_L34_error) jpayne@69: __Pyx_GOTREF(__pyx_t_6); jpayne@69: __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 372, __pyx_L34_error) jpayne@69: } jpayne@69: for (;;) { jpayne@69: if (likely(!__pyx_t_5)) { jpayne@69: if (likely(PyList_CheckExact(__pyx_t_6))) { jpayne@69: { jpayne@69: Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); jpayne@69: #if !CYTHON_ASSUME_SAFE_MACROS jpayne@69: if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 372, __pyx_L34_error) jpayne@69: #endif jpayne@69: if (__pyx_t_4 >= __pyx_temp) break; jpayne@69: } jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS jpayne@69: __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 372, __pyx_L34_error) jpayne@69: #else jpayne@69: __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 372, __pyx_L34_error) jpayne@69: __Pyx_GOTREF(__pyx_t_7); jpayne@69: #endif jpayne@69: } else { jpayne@69: { jpayne@69: Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); jpayne@69: #if !CYTHON_ASSUME_SAFE_MACROS jpayne@69: if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 372, __pyx_L34_error) jpayne@69: #endif jpayne@69: if (__pyx_t_4 >= __pyx_temp) break; jpayne@69: } jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS jpayne@69: __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 372, __pyx_L34_error) jpayne@69: #else jpayne@69: __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 372, __pyx_L34_error) jpayne@69: __Pyx_GOTREF(__pyx_t_7); jpayne@69: #endif jpayne@69: } jpayne@69: } else { jpayne@69: __pyx_t_7 = __pyx_t_5(__pyx_t_6); jpayne@69: if (unlikely(!__pyx_t_7)) { jpayne@69: PyObject* exc_type = PyErr_Occurred(); jpayne@69: if (exc_type) { jpayne@69: if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); jpayne@69: else __PYX_ERR(0, 372, __pyx_L34_error) jpayne@69: } jpayne@69: break; jpayne@69: } jpayne@69: __Pyx_GOTREF(__pyx_t_7); jpayne@69: } jpayne@69: __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_a, __pyx_t_7); jpayne@69: __pyx_t_7 = 0; jpayne@69: __pyx_t_7 = __pyx_f_5pysam_9libcutils_force_bytes(__pyx_8genexpr2__pyx_v_a, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 372, __pyx_L34_error) jpayne@69: __Pyx_GOTREF(__pyx_t_7); jpayne@69: if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 372, __pyx_L34_error) jpayne@69: __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; jpayne@69: } jpayne@69: __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; jpayne@69: __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_a); __pyx_8genexpr2__pyx_v_a = 0; jpayne@69: goto __pyx_L38_exit_scope; jpayne@69: __pyx_L34_error:; jpayne@69: __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_a); __pyx_8genexpr2__pyx_v_a = 0; jpayne@69: goto __pyx_L1_error; jpayne@69: __pyx_L38_exit_scope:; jpayne@69: } /* exit inner scope */ jpayne@69: __Pyx_DECREF_SET(__pyx_v_args, __pyx_t_3); jpayne@69: __pyx_t_3 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":375 jpayne@69: * jpayne@69: * # allocate two more for first (dummy) argument (contains command) jpayne@69: * cdef int extra_args = 0 # <<<<<<<<<<<<<< jpayne@69: * if method == b"index": jpayne@69: * extra_args = 1 jpayne@69: */ jpayne@69: __pyx_v_extra_args = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":376 jpayne@69: * # allocate two more for first (dummy) argument (contains command) jpayne@69: * cdef int extra_args = 0 jpayne@69: * if method == b"index": # <<<<<<<<<<<<<< jpayne@69: * extra_args = 1 jpayne@69: * # add extra arguments for commands accepting optional arguments jpayne@69: */ jpayne@69: __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_v_method, __pyx_n_b_index, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 376, __pyx_L1_error) jpayne@69: if (__pyx_t_2) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":377 jpayne@69: * cdef int extra_args = 0 jpayne@69: * if method == b"index": jpayne@69: * extra_args = 1 # <<<<<<<<<<<<<< jpayne@69: * # add extra arguments for commands accepting optional arguments jpayne@69: * # such as 'samtools index x.bam [out.index]' jpayne@69: */ jpayne@69: __pyx_v_extra_args = 1; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":376 jpayne@69: * # allocate two more for first (dummy) argument (contains command) jpayne@69: * cdef int extra_args = 0 jpayne@69: * if method == b"index": # <<<<<<<<<<<<<< jpayne@69: * extra_args = 1 jpayne@69: * # add extra arguments for commands accepting optional arguments jpayne@69: */ jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":380 jpayne@69: * # add extra arguments for commands accepting optional arguments jpayne@69: * # such as 'samtools index x.bam [out.index]' jpayne@69: * cargs = calloc(n + 2 + extra_args, sizeof(char *)) # <<<<<<<<<<<<<< jpayne@69: * cargs[0] = collection jpayne@69: * cargs[1] = method jpayne@69: */ jpayne@69: __pyx_v_cargs = ((char **)calloc(((__pyx_v_n + 2) + __pyx_v_extra_args), (sizeof(char *)))); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":381 jpayne@69: * # such as 'samtools index x.bam [out.index]' jpayne@69: * cargs = calloc(n + 2 + extra_args, sizeof(char *)) jpayne@69: * cargs[0] = collection # <<<<<<<<<<<<<< jpayne@69: * cargs[1] = method jpayne@69: * jpayne@69: */ jpayne@69: __pyx_t_17 = __Pyx_PyObject_AsWritableString(__pyx_v_collection); if (unlikely((!__pyx_t_17) && PyErr_Occurred())) __PYX_ERR(0, 381, __pyx_L1_error) jpayne@69: (__pyx_v_cargs[0]) = __pyx_t_17; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":382 jpayne@69: * cargs = calloc(n + 2 + extra_args, sizeof(char *)) jpayne@69: * cargs[0] = collection jpayne@69: * cargs[1] = method # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * # create copies of strings - getopt for long options permutes jpayne@69: */ jpayne@69: __pyx_t_17 = __Pyx_PyObject_AsWritableString(__pyx_v_method); if (unlikely((!__pyx_t_17) && PyErr_Occurred())) __PYX_ERR(0, 382, __pyx_L1_error) jpayne@69: (__pyx_v_cargs[1]) = __pyx_t_17; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":386 jpayne@69: * # create copies of strings - getopt for long options permutes jpayne@69: * # arguments jpayne@69: * for i from 0 <= i < n: # <<<<<<<<<<<<<< jpayne@69: * l = len(args[i]) jpayne@69: * cargs[i + 2] = calloc(l + 1, sizeof(char)) jpayne@69: */ jpayne@69: __pyx_t_18 = __pyx_v_n; jpayne@69: for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_18; __pyx_v_i++) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":387 jpayne@69: * # arguments jpayne@69: * for i from 0 <= i < n: jpayne@69: * l = len(args[i]) # <<<<<<<<<<<<<< jpayne@69: * cargs[i + 2] = calloc(l + 1, sizeof(char)) jpayne@69: * strncpy(cargs[i + 2], args[i], l) jpayne@69: */ jpayne@69: __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_args, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 387, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: __pyx_v_l = __pyx_t_4; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":388 jpayne@69: * for i from 0 <= i < n: jpayne@69: * l = len(args[i]) jpayne@69: * cargs[i + 2] = calloc(l + 1, sizeof(char)) # <<<<<<<<<<<<<< jpayne@69: * strncpy(cargs[i + 2], args[i], l) jpayne@69: * jpayne@69: */ jpayne@69: (__pyx_v_cargs[(__pyx_v_i + 2)]) = ((char *)calloc((__pyx_v_l + 1), (sizeof(char)))); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":389 jpayne@69: * l = len(args[i]) jpayne@69: * cargs[i + 2] = calloc(l + 1, sizeof(char)) jpayne@69: * strncpy(cargs[i + 2], args[i], l) # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * # call samtools/bcftools jpayne@69: */ jpayne@69: __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_args, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 389, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __pyx_t_19 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_19) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L1_error) jpayne@69: (void)(strncpy((__pyx_v_cargs[(__pyx_v_i + 2)]), __pyx_t_19, __pyx_v_l)); jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":392 jpayne@69: * jpayne@69: * # call samtools/bcftools jpayne@69: * if collection == b"samtools": # <<<<<<<<<<<<<< jpayne@69: * samtools_set_stdout(stdout_h) jpayne@69: * samtools_set_stderr(stderr_h) jpayne@69: */ jpayne@69: __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_v_collection, __pyx_n_b_samtools, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 392, __pyx_L1_error) jpayne@69: if (__pyx_t_2) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":393 jpayne@69: * # call samtools/bcftools jpayne@69: * if collection == b"samtools": jpayne@69: * samtools_set_stdout(stdout_h) # <<<<<<<<<<<<<< jpayne@69: * samtools_set_stderr(stderr_h) jpayne@69: * retval = samtools_dispatch(n + 2, cargs) jpayne@69: */ jpayne@69: __pyx_t_18 = __Pyx_PyInt_As_int(__pyx_v_stdout_h); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 393, __pyx_L1_error) jpayne@69: samtools_set_stdout(__pyx_t_18); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":394 jpayne@69: * if collection == b"samtools": jpayne@69: * samtools_set_stdout(stdout_h) jpayne@69: * samtools_set_stderr(stderr_h) # <<<<<<<<<<<<<< jpayne@69: * retval = samtools_dispatch(n + 2, cargs) jpayne@69: * samtools_close_stdout() jpayne@69: */ jpayne@69: __pyx_t_18 = __Pyx_PyInt_As_int(__pyx_v_stderr_h); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 394, __pyx_L1_error) jpayne@69: samtools_set_stderr(__pyx_t_18); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":395 jpayne@69: * samtools_set_stdout(stdout_h) jpayne@69: * samtools_set_stderr(stderr_h) jpayne@69: * retval = samtools_dispatch(n + 2, cargs) # <<<<<<<<<<<<<< jpayne@69: * samtools_close_stdout() jpayne@69: * samtools_close_stderr() jpayne@69: */ jpayne@69: __pyx_v_retval = samtools_dispatch((__pyx_v_n + 2), __pyx_v_cargs); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":396 jpayne@69: * samtools_set_stderr(stderr_h) jpayne@69: * retval = samtools_dispatch(n + 2, cargs) jpayne@69: * samtools_close_stdout() # <<<<<<<<<<<<<< jpayne@69: * samtools_close_stderr() jpayne@69: * elif collection == b"bcftools": jpayne@69: */ jpayne@69: samtools_close_stdout(); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":397 jpayne@69: * retval = samtools_dispatch(n + 2, cargs) jpayne@69: * samtools_close_stdout() jpayne@69: * samtools_close_stderr() # <<<<<<<<<<<<<< jpayne@69: * elif collection == b"bcftools": jpayne@69: * bcftools_set_stdout(stdout_h) jpayne@69: */ jpayne@69: samtools_close_stderr(); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":392 jpayne@69: * jpayne@69: * # call samtools/bcftools jpayne@69: * if collection == b"samtools": # <<<<<<<<<<<<<< jpayne@69: * samtools_set_stdout(stdout_h) jpayne@69: * samtools_set_stderr(stderr_h) jpayne@69: */ jpayne@69: goto __pyx_L42; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":398 jpayne@69: * samtools_close_stdout() jpayne@69: * samtools_close_stderr() jpayne@69: * elif collection == b"bcftools": # <<<<<<<<<<<<<< jpayne@69: * bcftools_set_stdout(stdout_h) jpayne@69: * bcftools_set_stderr(stderr_h) jpayne@69: */ jpayne@69: __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_v_collection, __pyx_n_b_bcftools, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 398, __pyx_L1_error) jpayne@69: if (__pyx_t_2) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":399 jpayne@69: * samtools_close_stderr() jpayne@69: * elif collection == b"bcftools": jpayne@69: * bcftools_set_stdout(stdout_h) # <<<<<<<<<<<<<< jpayne@69: * bcftools_set_stderr(stderr_h) jpayne@69: * retval = bcftools_dispatch(n + 2, cargs) jpayne@69: */ jpayne@69: __pyx_t_18 = __Pyx_PyInt_As_int(__pyx_v_stdout_h); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 399, __pyx_L1_error) jpayne@69: bcftools_set_stdout(__pyx_t_18); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":400 jpayne@69: * elif collection == b"bcftools": jpayne@69: * bcftools_set_stdout(stdout_h) jpayne@69: * bcftools_set_stderr(stderr_h) # <<<<<<<<<<<<<< jpayne@69: * retval = bcftools_dispatch(n + 2, cargs) jpayne@69: * bcftools_close_stdout() jpayne@69: */ jpayne@69: __pyx_t_18 = __Pyx_PyInt_As_int(__pyx_v_stderr_h); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L1_error) jpayne@69: bcftools_set_stderr(__pyx_t_18); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":401 jpayne@69: * bcftools_set_stdout(stdout_h) jpayne@69: * bcftools_set_stderr(stderr_h) jpayne@69: * retval = bcftools_dispatch(n + 2, cargs) # <<<<<<<<<<<<<< jpayne@69: * bcftools_close_stdout() jpayne@69: * bcftools_close_stderr() jpayne@69: */ jpayne@69: __pyx_v_retval = bcftools_dispatch((__pyx_v_n + 2), __pyx_v_cargs); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":402 jpayne@69: * bcftools_set_stderr(stderr_h) jpayne@69: * retval = bcftools_dispatch(n + 2, cargs) jpayne@69: * bcftools_close_stdout() # <<<<<<<<<<<<<< jpayne@69: * bcftools_close_stderr() jpayne@69: * else: jpayne@69: */ jpayne@69: bcftools_close_stdout(); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":403 jpayne@69: * retval = bcftools_dispatch(n + 2, cargs) jpayne@69: * bcftools_close_stdout() jpayne@69: * bcftools_close_stderr() # <<<<<<<<<<<<<< jpayne@69: * else: jpayne@69: * # unknown -- just return a Unix shell's "command not found" exit status jpayne@69: */ jpayne@69: bcftools_close_stderr(); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":398 jpayne@69: * samtools_close_stdout() jpayne@69: * samtools_close_stderr() jpayne@69: * elif collection == b"bcftools": # <<<<<<<<<<<<<< jpayne@69: * bcftools_set_stdout(stdout_h) jpayne@69: * bcftools_set_stderr(stderr_h) jpayne@69: */ jpayne@69: goto __pyx_L42; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":406 jpayne@69: * else: jpayne@69: * # unknown -- just return a Unix shell's "command not found" exit status jpayne@69: * retval = 127 # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * for i from 0 <= i < n: jpayne@69: */ jpayne@69: /*else*/ { jpayne@69: __pyx_v_retval = 0x7F; jpayne@69: } jpayne@69: __pyx_L42:; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":408 jpayne@69: * retval = 127 jpayne@69: * jpayne@69: * for i from 0 <= i < n: # <<<<<<<<<<<<<< jpayne@69: * free(cargs[i + 2]) jpayne@69: * free(cargs) jpayne@69: */ jpayne@69: __pyx_t_18 = __pyx_v_n; jpayne@69: for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_18; __pyx_v_i++) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":409 jpayne@69: * jpayne@69: * for i from 0 <= i < n: jpayne@69: * free(cargs[i + 2]) # <<<<<<<<<<<<<< jpayne@69: * free(cargs) jpayne@69: * jpayne@69: */ jpayne@69: free((__pyx_v_cargs[(__pyx_v_i + 2)])); jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":410 jpayne@69: * for i from 0 <= i < n: jpayne@69: * free(cargs[i + 2]) jpayne@69: * free(cargs) # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * # get error messages jpayne@69: */ jpayne@69: free(__pyx_v_cargs); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":413 jpayne@69: * jpayne@69: * # get error messages jpayne@69: * def _collect(fn): # <<<<<<<<<<<<<< jpayne@69: * out = [] jpayne@69: * try: jpayne@69: */ jpayne@69: __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcutils_15_pysam_dispatch_1_collect, 0, __pyx_n_s_pysam_dispatch_locals__collect, NULL, __pyx_n_s_pysam_libcutils, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 413, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __pyx_v__collect = __pyx_t_3; jpayne@69: __pyx_t_3 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":426 jpayne@69: * return out jpayne@69: * jpayne@69: * out_stderr = _collect(stderr_f) # <<<<<<<<<<<<<< jpayne@69: * if save_stdout: jpayne@69: * out_stdout = None jpayne@69: */ jpayne@69: __pyx_t_3 = __pyx_pf_5pysam_9libcutils_15_pysam_dispatch__collect(__pyx_v__collect, __pyx_v_stderr_f); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 426, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __pyx_v_out_stderr = __pyx_t_3; jpayne@69: __pyx_t_3 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":427 jpayne@69: * jpayne@69: * out_stderr = _collect(stderr_f) jpayne@69: * if save_stdout: # <<<<<<<<<<<<<< jpayne@69: * out_stdout = None jpayne@69: * elif catch_stdout: jpayne@69: */ jpayne@69: __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_save_stdout); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 427, __pyx_L1_error) jpayne@69: if (__pyx_t_2) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":428 jpayne@69: * out_stderr = _collect(stderr_f) jpayne@69: * if save_stdout: jpayne@69: * out_stdout = None # <<<<<<<<<<<<<< jpayne@69: * elif catch_stdout: jpayne@69: * out_stdout = _collect(stdout_f) jpayne@69: */ jpayne@69: __Pyx_INCREF(Py_None); jpayne@69: __pyx_v_out_stdout = Py_None; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":427 jpayne@69: * jpayne@69: * out_stderr = _collect(stderr_f) jpayne@69: * if save_stdout: # <<<<<<<<<<<<<< jpayne@69: * out_stdout = None jpayne@69: * elif catch_stdout: jpayne@69: */ jpayne@69: goto __pyx_L45; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":429 jpayne@69: * if save_stdout: jpayne@69: * out_stdout = None jpayne@69: * elif catch_stdout: # <<<<<<<<<<<<<< jpayne@69: * out_stdout = _collect(stdout_f) jpayne@69: * else: jpayne@69: */ jpayne@69: __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_catch_stdout); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 429, __pyx_L1_error) jpayne@69: if (__pyx_t_2) { jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":430 jpayne@69: * out_stdout = None jpayne@69: * elif catch_stdout: jpayne@69: * out_stdout = _collect(stdout_f) # <<<<<<<<<<<<<< jpayne@69: * else: jpayne@69: * out_stdout = None jpayne@69: */ jpayne@69: if (unlikely(!__pyx_v_stdout_f)) { __Pyx_RaiseUnboundLocalError("stdout_f"); __PYX_ERR(0, 430, __pyx_L1_error) } jpayne@69: __pyx_t_3 = __pyx_pf_5pysam_9libcutils_15_pysam_dispatch__collect(__pyx_v__collect, __pyx_v_stdout_f); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __pyx_v_out_stdout = __pyx_t_3; jpayne@69: __pyx_t_3 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":429 jpayne@69: * if save_stdout: jpayne@69: * out_stdout = None jpayne@69: * elif catch_stdout: # <<<<<<<<<<<<<< jpayne@69: * out_stdout = _collect(stdout_f) jpayne@69: * else: jpayne@69: */ jpayne@69: goto __pyx_L45; jpayne@69: } jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":432 jpayne@69: * out_stdout = _collect(stdout_f) jpayne@69: * else: jpayne@69: * out_stdout = None # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * return retval, out_stderr, out_stdout jpayne@69: */ jpayne@69: /*else*/ { jpayne@69: __Pyx_INCREF(Py_None); jpayne@69: __pyx_v_out_stdout = Py_None; jpayne@69: } jpayne@69: __pyx_L45:; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":434 jpayne@69: * out_stdout = None jpayne@69: * jpayne@69: * return retval, out_stderr, out_stdout # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * jpayne@69: */ jpayne@69: __Pyx_XDECREF(__pyx_r); jpayne@69: __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_retval); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 434, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_6); jpayne@69: __Pyx_GIVEREF(__pyx_t_3); jpayne@69: if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error); jpayne@69: __Pyx_INCREF(__pyx_v_out_stderr); jpayne@69: __Pyx_GIVEREF(__pyx_v_out_stderr); jpayne@69: if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_out_stderr)) __PYX_ERR(0, 434, __pyx_L1_error); jpayne@69: __Pyx_INCREF(__pyx_v_out_stdout); jpayne@69: __Pyx_GIVEREF(__pyx_v_out_stdout); jpayne@69: if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_out_stdout)) __PYX_ERR(0, 434, __pyx_L1_error); jpayne@69: __pyx_t_3 = 0; jpayne@69: __pyx_r = __pyx_t_6; jpayne@69: __pyx_t_6 = 0; jpayne@69: goto __pyx_L0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":276 jpayne@69: * jpayne@69: * jpayne@69: * def _pysam_dispatch(collection, # <<<<<<<<<<<<<< jpayne@69: * method, jpayne@69: * args=None, jpayne@69: */ jpayne@69: jpayne@69: /* function exit code */ jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_3); jpayne@69: __Pyx_XDECREF(__pyx_t_6); jpayne@69: __Pyx_XDECREF(__pyx_t_7); jpayne@69: __Pyx_XDECREF(__pyx_t_8); jpayne@69: __Pyx_XDECREF(__pyx_t_15); jpayne@69: __Pyx_XDECREF(__pyx_t_16); jpayne@69: __Pyx_AddTraceback("pysam.libcutils._pysam_dispatch", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: __pyx_r = NULL; jpayne@69: __pyx_L0:; jpayne@69: __Pyx_XDECREF(__pyx_v_ARGUMENTS); jpayne@69: __Pyx_XDECREF(__pyx_v_arg); jpayne@69: __Pyx_XDECREF(__pyx_v_stderr_h); jpayne@69: __Pyx_XDECREF(__pyx_v_stderr_f); jpayne@69: __Pyx_XDECREF(__pyx_v_stdout_f); jpayne@69: __Pyx_XDECREF(__pyx_v_stdout_h); jpayne@69: __Pyx_XDECREF(__pyx_v_MAP_STDOUT_OPTIONS); jpayne@69: __Pyx_XDECREF(__pyx_v_stdout_option); jpayne@69: __Pyx_XDECREF(__pyx_v__collect); jpayne@69: __Pyx_XDECREF(__pyx_v_out_stderr); jpayne@69: __Pyx_XDECREF(__pyx_v_out_stdout); jpayne@69: __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_a); jpayne@69: __Pyx_XDECREF(__pyx_v_collection); jpayne@69: __Pyx_XDECREF(__pyx_v_method); jpayne@69: __Pyx_XDECREF(__pyx_v_args); jpayne@69: __Pyx_XGIVEREF(__pyx_r); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return __pyx_r; jpayne@69: } jpayne@69: jpayne@69: static PyMethodDef __pyx_methods[] = { jpayne@69: {0, 0, 0, 0} jpayne@69: }; jpayne@69: #ifndef CYTHON_SMALL_CODE jpayne@69: #if defined(__clang__) jpayne@69: #define CYTHON_SMALL_CODE jpayne@69: #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) jpayne@69: #define CYTHON_SMALL_CODE __attribute__((cold)) jpayne@69: #else jpayne@69: #define CYTHON_SMALL_CODE jpayne@69: #endif jpayne@69: #endif jpayne@69: /* #### Code section: pystring_table ### */ jpayne@69: jpayne@69: static int __Pyx_CreateStringTabAndInitStrings(void) { jpayne@69: __Pyx_StringTabEntry __pyx_string_tab[] = { jpayne@69: {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, jpayne@69: {&__pyx_n_s_ARGUMENTS, __pyx_k_ARGUMENTS, sizeof(__pyx_k_ARGUMENTS), 0, 0, 1, 1}, jpayne@69: {&__pyx_kp_u_Argument_must_be_string_bytes_or, __pyx_k_Argument_must_be_string_bytes_or, sizeof(__pyx_k_Argument_must_be_string_bytes_or), 0, 1, 0, 0}, jpayne@69: {&__pyx_n_u_B, __pyx_k_B, sizeof(__pyx_k_B), 0, 1, 0, 1}, jpayne@69: {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_MAP_STDOUT_OPTIONS, __pyx_k_MAP_STDOUT_OPTIONS, sizeof(__pyx_k_MAP_STDOUT_OPTIONS), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, jpayne@69: {&__pyx_kp_u_No_such_file_or_directory_s, __pyx_k_No_such_file_or_directory_s, sizeof(__pyx_k_No_such_file_or_directory_s), 0, 1, 0, 0}, jpayne@69: {&__pyx_n_s_OSError, __pyx_k_OSError, sizeof(__pyx_k_OSError), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_OverflowError, __pyx_k_OverflowError, sizeof(__pyx_k_OverflowError), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_UnicodeDecodeError, __pyx_k_UnicodeDecodeError, sizeof(__pyx_k_UnicodeDecodeError), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, jpayne@69: {&__pyx_kp_u__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0, 0}, jpayne@69: {&__pyx_kp_u__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0, 0}, jpayne@69: {&__pyx_n_s__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 0, 1, 1}, jpayne@69: {&__pyx_kp_u__15, __pyx_k__15, sizeof(__pyx_k__15), 0, 1, 0, 0}, jpayne@69: {&__pyx_n_s__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 0, 1, 1}, jpayne@69: {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0}, jpayne@69: {&__pyx_kp_u__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 1, 0, 0}, jpayne@69: {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_arg, __pyx_k_arg, sizeof(__pyx_k_arg), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_array_to_qualitystring, __pyx_k_array_to_qualitystring, sizeof(__pyx_k_array_to_qualitystring), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_u_array_to_qualitystring, __pyx_k_array_to_qualitystring, sizeof(__pyx_k_array_to_qualitystring), 0, 1, 0, 1}, jpayne@69: {&__pyx_n_u_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 1, 0, 1}, jpayne@69: {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_b_bcftools, __pyx_k_bcftools, sizeof(__pyx_k_bcftools), 0, 0, 0, 1}, jpayne@69: {&__pyx_n_u_bcftools, __pyx_k_bcftools, sizeof(__pyx_k_bcftools), 0, 1, 0, 1}, jpayne@69: {&__pyx_kp_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 0}, jpayne@69: {&__pyx_n_u_calmd, __pyx_k_calmd, sizeof(__pyx_k_calmd), 0, 1, 0, 1}, jpayne@69: {&__pyx_n_s_cargs, __pyx_k_cargs, sizeof(__pyx_k_cargs), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_catch_stdout, __pyx_k_catch_stdout, sizeof(__pyx_k_catch_stdout), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_chr, __pyx_k_chr, sizeof(__pyx_k_chr), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_codecs, __pyx_k_codecs, sizeof(__pyx_k_codecs), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_collect, __pyx_k_collect, sizeof(__pyx_k_collect), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_collection, __pyx_k_collection, sizeof(__pyx_k_collection), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_contextlib, __pyx_k_contextlib, sizeof(__pyx_k_contextlib), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_contextmanager, __pyx_k_contextmanager, sizeof(__pyx_k_contextmanager), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_contig, __pyx_k_contig, sizeof(__pyx_k_contig), 0, 0, 1, 1}, jpayne@69: {&__pyx_kp_u_contig_and_reference_should_not, __pyx_k_contig_and_reference_should_not, sizeof(__pyx_k_contig_and_reference_should_not), 0, 1, 0, 0}, jpayne@69: {&__pyx_kp_u_contig_reference_and_region_shou, __pyx_k_contig_reference_and_region_shou, sizeof(__pyx_k_contig_reference_and_region_shou), 0, 1, 0, 0}, jpayne@69: {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_u_depad, __pyx_k_depad, sizeof(__pyx_k_depad), 0, 1, 0, 1}, jpayne@69: {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, jpayne@69: {&__pyx_kp_u_error_while_opening_file_for_wri, __pyx_k_error_while_opening_file_for_wri, sizeof(__pyx_k_error_while_opening_file_for_wri), 0, 1, 0, 0}, jpayne@69: {&__pyx_n_s_exception, __pyx_k_exception, sizeof(__pyx_k_exception), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_exists, __pyx_k_exists, sizeof(__pyx_k_exists), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_extend, __pyx_k_extend, sizeof(__pyx_k_extend), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_extra_args, __pyx_k_extra_args, sizeof(__pyx_k_extra_args), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_fn, __pyx_k_fn, sizeof(__pyx_k_fn), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_fsencode, __pyx_k_fsencode, sizeof(__pyx_k_fsencode), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_get_encoding_error_handler, __pyx_k_get_encoding_error_handler, sizeof(__pyx_k_get_encoding_error_handler), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_u_get_encoding_error_handler, __pyx_k_get_encoding_error_handler, sizeof(__pyx_k_get_encoding_error_handler), 0, 1, 0, 1}, jpayne@69: {&__pyx_n_s_getdefaultencoding, __pyx_k_getdefaultencoding, sizeof(__pyx_k_getdefaultencoding), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_getfilesystemencoding, __pyx_k_getfilesystemencoding, sizeof(__pyx_k_getfilesystemencoding), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_u_head, __pyx_k_head, sizeof(__pyx_k_head), 0, 1, 0, 1}, jpayne@69: {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_b_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 0, 1}, jpayne@69: {&__pyx_n_u_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 1, 0, 1}, jpayne@69: {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_input_str, __pyx_k_input_str, sizeof(__pyx_k_input_str), 0, 0, 1, 1}, jpayne@69: {&__pyx_kp_u_invalid_coordinates_start_i_stop, __pyx_k_invalid_coordinates_start_i_stop, sizeof(__pyx_k_invalid_coordinates_start_i_stop), 0, 1, 0, 0}, jpayne@69: {&__pyx_n_s_io, __pyx_k_io, sizeof(__pyx_k_io), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_is_usage, __pyx_k_is_usage, sizeof(__pyx_k_is_usage), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_l, __pyx_k_l, sizeof(__pyx_k_l), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_latin1_replace, __pyx_k_latin1_replace, sizeof(__pyx_k_latin1_replace), 0, 0, 1, 1}, jpayne@69: {&__pyx_kp_u_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 1, 0, 0}, jpayne@69: {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_method, __pyx_k_method, sizeof(__pyx_k_method), 0, 0, 1, 1}, jpayne@69: {&__pyx_kp_u_min_shift, __pyx_k_min_shift, sizeof(__pyx_k_min_shift), 0, 1, 0, 0}, jpayne@69: {&__pyx_n_s_mkstemp, __pyx_k_mkstemp, sizeof(__pyx_k_mkstemp), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_u_mpileup, __pyx_k_mpileup, sizeof(__pyx_k_mpileup), 0, 1, 0, 1}, jpayne@69: {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, jpayne@69: {&__pyx_kp_u_neither_contig_nor_region_are_gi, __pyx_k_neither_contig_nor_region_are_gi, sizeof(__pyx_k_neither_contig_nor_region_are_gi), 0, 1, 0, 0}, jpayne@69: {&__pyx_kp_u_o, __pyx_k_o, sizeof(__pyx_k_o), 0, 1, 0, 0}, jpayne@69: {&__pyx_kp_u_o_2, __pyx_k_o_2, sizeof(__pyx_k_o_2), 0, 1, 0, 0}, jpayne@69: {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_out_stderr, __pyx_k_out_stderr, sizeof(__pyx_k_out_stderr), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_out_stdout, __pyx_k_out_stdout, sizeof(__pyx_k_out_stdout), 0, 0, 1, 1}, jpayne@69: {&__pyx_kp_u_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 1, 0, 0}, jpayne@69: {&__pyx_kp_u_output_file, __pyx_k_output_file, sizeof(__pyx_k_output_file), 0, 1, 0, 0}, jpayne@69: {&__pyx_n_s_parse_region, __pyx_k_parse_region, sizeof(__pyx_k_parse_region), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_pysam_dispatch, __pyx_k_pysam_dispatch, sizeof(__pyx_k_pysam_dispatch), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_pysam_dispatch_locals__collect, __pyx_k_pysam_dispatch_locals__collect, sizeof(__pyx_k_pysam_dispatch_locals__collect), 0, 0, 1, 1}, jpayne@69: {&__pyx_kp_u_pysam_latin1replace, __pyx_k_pysam_latin1replace, sizeof(__pyx_k_pysam_latin1replace), 0, 1, 0, 0}, jpayne@69: {&__pyx_n_s_pysam_libcutils, __pyx_k_pysam_libcutils, sizeof(__pyx_k_pysam_libcutils), 0, 0, 1, 1}, jpayne@69: {&__pyx_kp_s_pysam_libcutils_pyx, __pyx_k_pysam_libcutils_pyx, sizeof(__pyx_k_pysam_libcutils_pyx), 0, 0, 1, 0}, jpayne@69: {&__pyx_n_s_qualities, __pyx_k_qualities, sizeof(__pyx_k_qualities), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_qualities_to_qualitystring, __pyx_k_qualities_to_qualitystring, sizeof(__pyx_k_qualities_to_qualitystring), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_u_qualities_to_qualitystring, __pyx_k_qualities_to_qualitystring, sizeof(__pyx_k_qualities_to_qualitystring), 0, 1, 0, 1}, jpayne@69: {&__pyx_n_s_qualitystring_to_array, __pyx_k_qualitystring_to_array, sizeof(__pyx_k_qualitystring_to_array), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_u_qualitystring_to_array, __pyx_k_qualitystring_to_array, sizeof(__pyx_k_qualitystring_to_array), 0, 1, 0, 1}, jpayne@69: {&__pyx_n_u_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 1, 0, 1}, jpayne@69: {&__pyx_n_u_rb, __pyx_k_rb, sizeof(__pyx_k_rb), 0, 1, 0, 1}, jpayne@69: {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_reference, __pyx_k_reference, sizeof(__pyx_k_reference), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_region, __pyx_k_region, sizeof(__pyx_k_region), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_register_error, __pyx_k_register_error, sizeof(__pyx_k_register_error), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_retval, __pyx_k_retval, sizeof(__pyx_k_retval), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_u_roh, __pyx_k_roh, sizeof(__pyx_k_roh), 0, 1, 0, 1}, jpayne@69: {&__pyx_n_b_samtools, __pyx_k_samtools, sizeof(__pyx_k_samtools), 0, 0, 0, 1}, jpayne@69: {&__pyx_n_u_samtools, __pyx_k_samtools, sizeof(__pyx_k_samtools), 0, 1, 0, 1}, jpayne@69: {&__pyx_n_s_save_stdout, __pyx_k_save_stdout, sizeof(__pyx_k_save_stdout), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_set_encoding_error_handler, __pyx_k_set_encoding_error_handler, sizeof(__pyx_k_set_encoding_error_handler), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_u_set_encoding_error_handler, __pyx_k_set_encoding_error_handler, sizeof(__pyx_k_set_encoding_error_handler), 0, 1, 0, 1}, jpayne@69: {&__pyx_n_s_skip_next, __pyx_k_skip_next, sizeof(__pyx_k_skip_next), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, jpayne@69: {&__pyx_kp_u_start_out_of_range_i, __pyx_k_start_out_of_range_i, sizeof(__pyx_k_start_out_of_range_i), 0, 1, 0, 0}, jpayne@69: {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_u_stats, __pyx_k_stats, sizeof(__pyx_k_stats), 0, 1, 0, 1}, jpayne@69: {&__pyx_n_s_stderr_f, __pyx_k_stderr_f, sizeof(__pyx_k_stderr_f), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_stderr_h, __pyx_k_stderr_h, sizeof(__pyx_k_stderr_h), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_stdout_f, __pyx_k_stdout_f, sizeof(__pyx_k_stdout_f), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_stdout_h, __pyx_k_stdout_h, sizeof(__pyx_k_stdout_h), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_stdout_option, __pyx_k_stdout_option, sizeof(__pyx_k_stdout_option), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, jpayne@69: {&__pyx_kp_u_stop_and_end_should_not_both_be, __pyx_k_stop_and_end_should_not_both_be, sizeof(__pyx_k_stop_and_end_should_not_both_be), 0, 1, 0, 0}, jpayne@69: {&__pyx_kp_u_stop_out_of_range_i, __pyx_k_stop_out_of_range_i, sizeof(__pyx_k_stop_out_of_range_i), 0, 1, 0, 0}, jpayne@69: {&__pyx_n_u_strict, __pyx_k_strict, sizeof(__pyx_k_strict), 0, 1, 0, 1}, jpayne@69: {&__pyx_n_s_string, __pyx_k_string, sizeof(__pyx_k_string), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_tempfile, __pyx_k_tempfile, sizeof(__pyx_k_tempfile), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, jpayne@69: {&__pyx_kp_u_threads, __pyx_k_threads, sizeof(__pyx_k_threads), 0, 1, 0, 0}, jpayne@69: {&__pyx_n_s_tobytes, __pyx_k_tobytes, sizeof(__pyx_k_tobytes), 0, 0, 1, 1}, jpayne@69: {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1}, jpayne@69: {&__pyx_kp_u_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 1, 0, 0}, jpayne@69: {&__pyx_n_u_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 1, 0, 1}, jpayne@69: {0, 0, 0, 0, 0, 0, 0} jpayne@69: }; jpayne@69: return __Pyx_InitStrings(__pyx_string_tab); jpayne@69: } jpayne@69: /* #### Code section: cached_builtins ### */ jpayne@69: static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { jpayne@69: __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 82, __pyx_L1_error) jpayne@69: __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 136, __pyx_L1_error) jpayne@69: __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 218, __pyx_L1_error) jpayne@69: __pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) __PYX_ERR(0, 237, __pyx_L1_error) jpayne@69: __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 309, __pyx_L1_error) jpayne@69: __pyx_builtin_OSError = __Pyx_GetBuiltinName(__pyx_n_s_OSError); if (!__pyx_builtin_OSError) __PYX_ERR(0, 327, __pyx_L1_error) jpayne@69: __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(0, 416, __pyx_L1_error) jpayne@69: __pyx_builtin_UnicodeDecodeError = __Pyx_GetBuiltinName(__pyx_n_s_UnicodeDecodeError); if (!__pyx_builtin_UnicodeDecodeError) __PYX_ERR(0, 418, __pyx_L1_error) jpayne@69: __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 120, __pyx_L1_error) jpayne@69: return 0; jpayne@69: __pyx_L1_error:; jpayne@69: return -1; jpayne@69: } jpayne@69: /* #### Code section: cached_constants ### */ jpayne@69: jpayne@69: static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":136 jpayne@69: * return s.encode(encoding or TEXT_ENCODING, errors or ERROR_HANDLER) jpayne@69: * else: jpayne@69: * raise TypeError("Argument must be string, bytes or unicode.") # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * jpayne@69: */ jpayne@69: __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_Argument_must_be_string_bytes_or); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 136, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_tuple__2); jpayne@69: __Pyx_GIVEREF(__pyx_tuple__2); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":218 jpayne@69: * if reference is not None: jpayne@69: * if contig is not None: jpayne@69: * raise ValueError('contig and reference should not both be specified') # <<<<<<<<<<<<<< jpayne@69: * contig = reference jpayne@69: * jpayne@69: */ jpayne@69: __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_contig_and_reference_should_not); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 218, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_tuple__3); jpayne@69: __Pyx_GIVEREF(__pyx_tuple__3); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":222 jpayne@69: * jpayne@69: * if contig is not None and region is not None: jpayne@69: * raise ValueError('contig/reference and region should not both be specified') # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * if end is not None: jpayne@69: */ jpayne@69: __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_contig_reference_and_region_shou); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 222, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_tuple__4); jpayne@69: __Pyx_GIVEREF(__pyx_tuple__4); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":226 jpayne@69: * if end is not None: jpayne@69: * if stop is not None: jpayne@69: * raise ValueError('stop and end should not both be specified') # <<<<<<<<<<<<<< jpayne@69: * stop = end jpayne@69: * jpayne@69: */ jpayne@69: __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_stop_and_end_should_not_both_be); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 226, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_tuple__5); jpayne@69: __Pyx_GIVEREF(__pyx_tuple__5); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":230 jpayne@69: * jpayne@69: * if contig is None and region is None: jpayne@69: * raise ValueError("neither contig nor region are given") # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * rstart = 0 jpayne@69: */ jpayne@69: __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_neither_contig_nor_region_are_gi); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 230, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_tuple__6); jpayne@69: __Pyx_GIVEREF(__pyx_tuple__6); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":416 jpayne@69: * out = [] jpayne@69: * try: jpayne@69: * with open(fn, "r") as inf: # <<<<<<<<<<<<<< jpayne@69: * out = inf.read() jpayne@69: * except UnicodeDecodeError: jpayne@69: */ jpayne@69: __pyx_tuple__9 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 416, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_tuple__9); jpayne@69: __Pyx_GIVEREF(__pyx_tuple__9); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":413 jpayne@69: * jpayne@69: * # get error messages jpayne@69: * def _collect(fn): # <<<<<<<<<<<<<< jpayne@69: * out = [] jpayne@69: * try: jpayne@69: */ jpayne@69: __pyx_tuple__12 = PyTuple_Pack(3, __pyx_n_s_fn, __pyx_n_s_out, __pyx_n_s_inf); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 413, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_tuple__12); jpayne@69: __Pyx_GIVEREF(__pyx_tuple__12); jpayne@69: __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcutils_pyx, __pyx_n_s_collect, 413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 413, __pyx_L1_error) jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":36 jpayne@69: * ################################################################# jpayne@69: * # Utility functions for quality string conversions jpayne@69: * cpdef c_array.array qualitystring_to_array(input_str, int offset=33): # <<<<<<<<<<<<<< jpayne@69: * """convert a qualitystring to an array of quality values.""" jpayne@69: * if input_str is None: jpayne@69: */ jpayne@69: __pyx_tuple__16 = PyTuple_Pack(2, __pyx_n_s_input_str, __pyx_n_s_offset); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 36, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_tuple__16); jpayne@69: __Pyx_GIVEREF(__pyx_tuple__16); jpayne@69: __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcutils_pyx, __pyx_n_s_qualitystring_to_array, 36, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 36, __pyx_L1_error) jpayne@69: __pyx_tuple__18 = PyTuple_Pack(1, __pyx_int_33); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 36, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_tuple__18); jpayne@69: __Pyx_GIVEREF(__pyx_tuple__18); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":45 jpayne@69: * jpayne@69: * jpayne@69: * cpdef array_to_qualitystring(c_array.array qualities, int offset=33): # <<<<<<<<<<<<<< jpayne@69: * """convert an array of quality values to a string.""" jpayne@69: * if qualities is None: jpayne@69: */ jpayne@69: __pyx_tuple__19 = PyTuple_Pack(2, __pyx_n_s_qualities, __pyx_n_s_offset); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 45, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_tuple__19); jpayne@69: __Pyx_GIVEREF(__pyx_tuple__19); jpayne@69: __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcutils_pyx, __pyx_n_s_array_to_qualitystring, 45, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 45, __pyx_L1_error) jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":59 jpayne@69: * jpayne@69: * jpayne@69: * cpdef qualities_to_qualitystring(qualities, int offset=33): # <<<<<<<<<<<<<< jpayne@69: * """convert a list or array of quality scores to the string jpayne@69: * representation used in the SAM format. jpayne@69: */ jpayne@69: __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcutils_pyx, __pyx_n_s_qualities_to_qualitystring, 59, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 59, __pyx_L1_error) jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":90 jpayne@69: * jpayne@69: * # Codec error handler that just interprets each bad byte as ISO-8859-1. jpayne@69: * def latin1_replace(exception): # <<<<<<<<<<<<<< jpayne@69: * return (chr(exception.object[exception.start]), exception.end) jpayne@69: * jpayne@69: */ jpayne@69: __pyx_tuple__22 = PyTuple_Pack(1, __pyx_n_s_exception); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 90, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_tuple__22); jpayne@69: __Pyx_GIVEREF(__pyx_tuple__22); jpayne@69: __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcutils_pyx, __pyx_n_s_latin1_replace, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 90, __pyx_L1_error) jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":98 jpayne@69: * cdef str ERROR_HANDLER = 'strict' jpayne@69: * jpayne@69: * cpdef get_encoding_error_handler(): # <<<<<<<<<<<<<< jpayne@69: * return ERROR_HANDLER jpayne@69: * jpayne@69: */ jpayne@69: __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcutils_pyx, __pyx_n_s_get_encoding_error_handler, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 98, __pyx_L1_error) jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":101 jpayne@69: * return ERROR_HANDLER jpayne@69: * jpayne@69: * cpdef set_encoding_error_handler(name): # <<<<<<<<<<<<<< jpayne@69: * global ERROR_HANDLER jpayne@69: * previous = ERROR_HANDLER jpayne@69: */ jpayne@69: __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_name); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 101, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_tuple__25); jpayne@69: __Pyx_GIVEREF(__pyx_tuple__25); jpayne@69: __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcutils_pyx, __pyx_n_s_set_encoding_error_handler, 101, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 101, __pyx_L1_error) jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":178 jpayne@69: * jpayne@69: * jpayne@69: * cpdef parse_region(contig=None, # <<<<<<<<<<<<<< jpayne@69: * start=None, jpayne@69: * stop=None, jpayne@69: */ jpayne@69: __pyx_tuple__27 = PyTuple_Pack(6, __pyx_n_s_contig, __pyx_n_s_start, __pyx_n_s_stop, __pyx_n_s_region, __pyx_n_s_reference, __pyx_n_s_end); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 178, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_tuple__27); jpayne@69: __Pyx_GIVEREF(__pyx_tuple__27); jpayne@69: __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcutils_pyx, __pyx_n_s_parse_region, 178, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 178, __pyx_L1_error) jpayne@69: __pyx_tuple__29 = PyTuple_Pack(6, Py_None, Py_None, Py_None, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 178, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_tuple__29); jpayne@69: __Pyx_GIVEREF(__pyx_tuple__29); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":276 jpayne@69: * jpayne@69: * jpayne@69: * def _pysam_dispatch(collection, # <<<<<<<<<<<<<< jpayne@69: * method, jpayne@69: * args=None, jpayne@69: */ jpayne@69: __pyx_tuple__30 = PyTuple_Pack(26, __pyx_n_s_collection, __pyx_n_s_method, __pyx_n_s_args, __pyx_n_s_catch_stdout, __pyx_n_s_is_usage, __pyx_n_s_save_stdout, __pyx_n_s_ARGUMENTS, __pyx_n_s_skip_next, __pyx_n_s_arg, __pyx_n_s_stderr_h, __pyx_n_s_stderr_f, __pyx_n_s_stdout_f, __pyx_n_s_stdout_h, __pyx_n_s_MAP_STDOUT_OPTIONS, __pyx_n_s_stdout_option, __pyx_n_s_cargs, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_retval, __pyx_n_s_l, __pyx_n_s_extra_args, __pyx_n_s_collect, __pyx_n_s_collect, __pyx_n_s_out_stderr, __pyx_n_s_out_stdout, __pyx_n_s_a); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 276, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_tuple__30); jpayne@69: __Pyx_GIVEREF(__pyx_tuple__30); jpayne@69: __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 26, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcutils_pyx, __pyx_n_s_pysam_dispatch, 276, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 276, __pyx_L1_error) jpayne@69: __pyx_tuple__32 = PyTuple_Pack(4, Py_None, ((PyObject *)Py_True), ((PyObject *)Py_False), Py_None); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 276, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_tuple__32); jpayne@69: __Pyx_GIVEREF(__pyx_tuple__32); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return 0; jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return -1; jpayne@69: } jpayne@69: /* #### Code section: init_constants ### */ jpayne@69: jpayne@69: static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { jpayne@69: if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); jpayne@69: __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: __pyx_int_33 = PyInt_FromLong(33); if (unlikely(!__pyx_int_33)) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: return 0; jpayne@69: __pyx_L1_error:; jpayne@69: return -1; jpayne@69: } jpayne@69: /* #### Code section: init_globals ### */ jpayne@69: jpayne@69: static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { jpayne@69: return 0; jpayne@69: } jpayne@69: /* #### Code section: init_module ### */ jpayne@69: jpayne@69: static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ jpayne@69: static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ jpayne@69: static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ jpayne@69: static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ jpayne@69: static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ jpayne@69: static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ jpayne@69: static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ jpayne@69: jpayne@69: static int __Pyx_modinit_global_init_code(void) { jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); jpayne@69: /*--- Global init code ---*/ jpayne@69: __pyx_v_5pysam_9libcutils_ERROR_HANDLER = ((PyObject*)Py_None); Py_INCREF(Py_None); jpayne@69: __pyx_v_5pysam_9libcutils_FILENAME_ENCODING = ((PyObject*)Py_None); Py_INCREF(Py_None); jpayne@69: __pyx_v_5pysam_9libcutils_TEXT_ENCODING = ((PyObject*)Py_None); Py_INCREF(Py_None); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return 0; jpayne@69: } jpayne@69: jpayne@69: static int __Pyx_modinit_variable_export_code(void) { jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); jpayne@69: /*--- Variable export code ---*/ jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return 0; jpayne@69: } jpayne@69: jpayne@69: static int __Pyx_modinit_function_export_code(void) { jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); jpayne@69: /*--- Function export code ---*/ jpayne@69: if (__Pyx_ExportFunction("parse_region", (void (*)(void))__pyx_f_5pysam_9libcutils_parse_region, "PyObject *(int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_9libcutils_parse_region *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: if (__Pyx_ExportFunction("libc_whence_from_io", (void (*)(void))__pyx_f_5pysam_9libcutils_libc_whence_from_io, "int (int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: if (__Pyx_ExportFunction("qualitystring_to_array", (void (*)(void))__pyx_f_5pysam_9libcutils_qualitystring_to_array, "arrayobject *(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_9libcutils_qualitystring_to_array *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: if (__Pyx_ExportFunction("array_to_qualitystring", (void (*)(void))__pyx_f_5pysam_9libcutils_array_to_qualitystring, "PyObject *(arrayobject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_9libcutils_array_to_qualitystring *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: if (__Pyx_ExportFunction("qualities_to_qualitystring", (void (*)(void))__pyx_f_5pysam_9libcutils_qualities_to_qualitystring, "PyObject *(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_9libcutils_qualities_to_qualitystring *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: if (__Pyx_ExportFunction("get_encoding_error_handler", (void (*)(void))__pyx_f_5pysam_9libcutils_get_encoding_error_handler, "PyObject *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: if (__Pyx_ExportFunction("set_encoding_error_handler", (void (*)(void))__pyx_f_5pysam_9libcutils_set_encoding_error_handler, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: if (__Pyx_ExportFunction("charptr_to_str", (void (*)(void))__pyx_f_5pysam_9libcutils_charptr_to_str, "PyObject *(char const *, struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: if (__Pyx_ExportFunction("charptr_to_bytes", (void (*)(void))__pyx_f_5pysam_9libcutils_charptr_to_bytes, "PyObject *(char const *, struct __pyx_opt_args_5pysam_9libcutils_charptr_to_bytes *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: if (__Pyx_ExportFunction("charptr_to_str_w_len", (void (*)(void))__pyx_f_5pysam_9libcutils_charptr_to_str_w_len, "PyObject *(char const *, size_t, struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str_w_len *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: if (__Pyx_ExportFunction("force_str", (void (*)(void))__pyx_f_5pysam_9libcutils_force_str, "PyObject *(PyObject *, struct __pyx_opt_args_5pysam_9libcutils_force_str *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: if (__Pyx_ExportFunction("force_bytes", (void (*)(void))__pyx_f_5pysam_9libcutils_force_bytes, "PyObject *(PyObject *, struct __pyx_opt_args_5pysam_9libcutils_force_bytes *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: if (__Pyx_ExportFunction("decode_bytes", (void (*)(void))__pyx_f_5pysam_9libcutils_decode_bytes, "PyObject *(PyObject *, struct __pyx_opt_args_5pysam_9libcutils_decode_bytes *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: if (__Pyx_ExportFunction("encode_filename", (void (*)(void))__pyx_f_5pysam_9libcutils_encode_filename, "PyObject *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: if (__Pyx_ExportFunction("from_string_and_size", (void (*)(void))__pyx_f_5pysam_9libcutils_from_string_and_size, "PyObject *(char const *, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return 0; jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return -1; jpayne@69: } jpayne@69: jpayne@69: static int __Pyx_modinit_type_init_code(void) { jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); jpayne@69: /*--- Type init code ---*/ jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return 0; jpayne@69: } jpayne@69: jpayne@69: static int __Pyx_modinit_type_import_code(void) { jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: PyObject *__pyx_t_1 = NULL; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); jpayne@69: /*--- Type import code ---*/ jpayne@69: __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_1); jpayne@69: __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", jpayne@69: #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 jpayne@69: sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject), jpayne@69: #elif CYTHON_COMPILING_IN_LIMITED_API jpayne@69: sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject), jpayne@69: #else jpayne@69: sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyHeapTypeObject), jpayne@69: #endif jpayne@69: __Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; jpayne@69: __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 8, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_1); jpayne@69: __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyBoolObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(4, 8, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; jpayne@69: __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 15, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_1); jpayne@69: __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyComplexObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(5, 15, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; jpayne@69: __pyx_t_1 = PyImport_ImportModule("array"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 69, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_1); jpayne@69: __pyx_ptype_7cpython_5array_array = __Pyx_ImportType_3_0_11(__pyx_t_1, "array", "array", sizeof(arrayobject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(arrayobject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_5array_array) __PYX_ERR(2, 69, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return 0; jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_1); jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return -1; jpayne@69: } jpayne@69: jpayne@69: static int __Pyx_modinit_variable_import_code(void) { jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); jpayne@69: /*--- Variable import code ---*/ jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return 0; jpayne@69: } jpayne@69: jpayne@69: static int __Pyx_modinit_function_import_code(void) { jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); jpayne@69: /*--- Function import code ---*/ jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: return 0; jpayne@69: } jpayne@69: jpayne@69: jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: #if CYTHON_PEP489_MULTI_PHASE_INIT jpayne@69: static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ jpayne@69: static int __pyx_pymod_exec_libcutils(PyObject* module); /*proto*/ jpayne@69: static PyModuleDef_Slot __pyx_moduledef_slots[] = { jpayne@69: {Py_mod_create, (void*)__pyx_pymod_create}, jpayne@69: {Py_mod_exec, (void*)__pyx_pymod_exec_libcutils}, jpayne@69: {0, NULL} jpayne@69: }; jpayne@69: #endif jpayne@69: jpayne@69: #ifdef __cplusplus jpayne@69: namespace { jpayne@69: struct PyModuleDef __pyx_moduledef = jpayne@69: #else jpayne@69: static struct PyModuleDef __pyx_moduledef = jpayne@69: #endif jpayne@69: { jpayne@69: PyModuleDef_HEAD_INIT, jpayne@69: "libcutils", jpayne@69: 0, /* m_doc */ jpayne@69: #if CYTHON_PEP489_MULTI_PHASE_INIT jpayne@69: 0, /* m_size */ jpayne@69: #elif CYTHON_USE_MODULE_STATE jpayne@69: sizeof(__pyx_mstate), /* m_size */ jpayne@69: #else jpayne@69: -1, /* m_size */ jpayne@69: #endif jpayne@69: __pyx_methods /* m_methods */, jpayne@69: #if CYTHON_PEP489_MULTI_PHASE_INIT jpayne@69: __pyx_moduledef_slots, /* m_slots */ jpayne@69: #else jpayne@69: NULL, /* m_reload */ jpayne@69: #endif jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: __pyx_m_traverse, /* m_traverse */ jpayne@69: __pyx_m_clear, /* m_clear */ jpayne@69: NULL /* m_free */ jpayne@69: #else jpayne@69: NULL, /* m_traverse */ jpayne@69: NULL, /* m_clear */ jpayne@69: NULL /* m_free */ jpayne@69: #endif jpayne@69: }; jpayne@69: #ifdef __cplusplus jpayne@69: } /* anonymous namespace */ jpayne@69: #endif jpayne@69: #endif jpayne@69: jpayne@69: #ifndef CYTHON_NO_PYINIT_EXPORT jpayne@69: #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC jpayne@69: #elif PY_MAJOR_VERSION < 3 jpayne@69: #ifdef __cplusplus jpayne@69: #define __Pyx_PyMODINIT_FUNC extern "C" void jpayne@69: #else jpayne@69: #define __Pyx_PyMODINIT_FUNC void jpayne@69: #endif jpayne@69: #else jpayne@69: #ifdef __cplusplus jpayne@69: #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * jpayne@69: #else jpayne@69: #define __Pyx_PyMODINIT_FUNC PyObject * jpayne@69: #endif jpayne@69: #endif jpayne@69: jpayne@69: jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: __Pyx_PyMODINIT_FUNC initlibcutils(void) CYTHON_SMALL_CODE; /*proto*/ jpayne@69: __Pyx_PyMODINIT_FUNC initlibcutils(void) jpayne@69: #else jpayne@69: __Pyx_PyMODINIT_FUNC PyInit_libcutils(void) CYTHON_SMALL_CODE; /*proto*/ jpayne@69: __Pyx_PyMODINIT_FUNC PyInit_libcutils(void) jpayne@69: #if CYTHON_PEP489_MULTI_PHASE_INIT jpayne@69: { jpayne@69: return PyModuleDef_Init(&__pyx_moduledef); jpayne@69: } jpayne@69: static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { jpayne@69: #if PY_VERSION_HEX >= 0x030700A1 jpayne@69: static PY_INT64_T main_interpreter_id = -1; jpayne@69: PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); jpayne@69: if (main_interpreter_id == -1) { jpayne@69: main_interpreter_id = current_id; jpayne@69: return (unlikely(current_id == -1)) ? -1 : 0; jpayne@69: } else if (unlikely(main_interpreter_id != current_id)) jpayne@69: #else jpayne@69: static PyInterpreterState *main_interpreter = NULL; jpayne@69: PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; jpayne@69: if (!main_interpreter) { jpayne@69: main_interpreter = current_interpreter; jpayne@69: } else if (unlikely(main_interpreter != current_interpreter)) jpayne@69: #endif jpayne@69: { jpayne@69: PyErr_SetString( jpayne@69: PyExc_ImportError, jpayne@69: "Interpreter change detected - this module can only be loaded into one interpreter per process."); jpayne@69: return -1; jpayne@69: } jpayne@69: return 0; jpayne@69: } jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) jpayne@69: #else jpayne@69: static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) jpayne@69: #endif jpayne@69: { jpayne@69: PyObject *value = PyObject_GetAttrString(spec, from_name); jpayne@69: int result = 0; jpayne@69: if (likely(value)) { jpayne@69: if (allow_none || value != Py_None) { jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: result = PyModule_AddObject(module, to_name, value); jpayne@69: #else jpayne@69: result = PyDict_SetItemString(moddict, to_name, value); jpayne@69: #endif jpayne@69: } jpayne@69: Py_DECREF(value); jpayne@69: } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { jpayne@69: PyErr_Clear(); jpayne@69: } else { jpayne@69: result = -1; jpayne@69: } jpayne@69: return result; jpayne@69: } jpayne@69: static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { jpayne@69: PyObject *module = NULL, *moddict, *modname; jpayne@69: CYTHON_UNUSED_VAR(def); jpayne@69: if (__Pyx_check_single_interpreter()) jpayne@69: return NULL; jpayne@69: if (__pyx_m) jpayne@69: return __Pyx_NewRef(__pyx_m); jpayne@69: modname = PyObject_GetAttrString(spec, "name"); jpayne@69: if (unlikely(!modname)) goto bad; jpayne@69: module = PyModule_NewObject(modname); jpayne@69: Py_DECREF(modname); jpayne@69: if (unlikely(!module)) goto bad; jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: moddict = module; jpayne@69: #else jpayne@69: moddict = PyModule_GetDict(module); jpayne@69: if (unlikely(!moddict)) goto bad; jpayne@69: #endif jpayne@69: if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; jpayne@69: if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; jpayne@69: if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; jpayne@69: if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; jpayne@69: return module; jpayne@69: bad: jpayne@69: Py_XDECREF(module); jpayne@69: return NULL; jpayne@69: } jpayne@69: jpayne@69: jpayne@69: static CYTHON_SMALL_CODE int __pyx_pymod_exec_libcutils(PyObject *__pyx_pyinit_module) jpayne@69: #endif jpayne@69: #endif jpayne@69: { jpayne@69: int stringtab_initialized = 0; jpayne@69: #if CYTHON_USE_MODULE_STATE jpayne@69: int pystate_addmodule_run = 0; jpayne@69: #endif jpayne@69: PyObject *__pyx_t_1 = NULL; jpayne@69: PyObject *__pyx_t_2 = NULL; jpayne@69: PyObject *__pyx_t_3 = NULL; jpayne@69: PyObject *__pyx_t_4 = NULL; jpayne@69: int __pyx_t_5; jpayne@69: int __pyx_lineno = 0; jpayne@69: const char *__pyx_filename = NULL; jpayne@69: int __pyx_clineno = 0; jpayne@69: __Pyx_RefNannyDeclarations jpayne@69: #if CYTHON_PEP489_MULTI_PHASE_INIT jpayne@69: if (__pyx_m) { jpayne@69: if (__pyx_m == __pyx_pyinit_module) return 0; jpayne@69: PyErr_SetString(PyExc_RuntimeError, "Module 'libcutils' has already been imported. Re-initialisation is not supported."); jpayne@69: return -1; jpayne@69: } jpayne@69: #elif PY_MAJOR_VERSION >= 3 jpayne@69: if (__pyx_m) return __Pyx_NewRef(__pyx_m); jpayne@69: #endif jpayne@69: /*--- Module creation code ---*/ jpayne@69: #if CYTHON_PEP489_MULTI_PHASE_INIT jpayne@69: __pyx_m = __pyx_pyinit_module; jpayne@69: Py_INCREF(__pyx_m); jpayne@69: #else jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: __pyx_m = Py_InitModule4("libcutils", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); jpayne@69: if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: #elif CYTHON_USE_MODULE_STATE jpayne@69: __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: { jpayne@69: int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); jpayne@69: __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "libcutils" pseudovariable */ jpayne@69: if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: pystate_addmodule_run = 1; jpayne@69: } jpayne@69: #else jpayne@69: __pyx_m = PyModule_Create(&__pyx_moduledef); jpayne@69: if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: #endif jpayne@69: #endif jpayne@69: CYTHON_UNUSED_VAR(__pyx_t_1); jpayne@69: __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: Py_INCREF(__pyx_d); jpayne@69: __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: #if CYTHON_REFNANNY jpayne@69: __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); jpayne@69: if (!__Pyx_RefNanny) { jpayne@69: PyErr_Clear(); jpayne@69: __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); jpayne@69: if (!__Pyx_RefNanny) jpayne@69: Py_FatalError("failed to import 'refnanny' module"); jpayne@69: } jpayne@69: #endif jpayne@69: __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_libcutils(void)", 0); jpayne@69: if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: #ifdef __Pxy_PyFrame_Initialize_Offsets jpayne@69: __Pxy_PyFrame_Initialize_Offsets(); jpayne@69: #endif jpayne@69: __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: #ifdef __Pyx_CyFunction_USED jpayne@69: if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: #endif jpayne@69: #ifdef __Pyx_FusedFunction_USED jpayne@69: if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: #endif jpayne@69: #ifdef __Pyx_Coroutine_USED jpayne@69: if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: #endif jpayne@69: #ifdef __Pyx_Generator_USED jpayne@69: if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: #endif jpayne@69: #ifdef __Pyx_AsyncGen_USED jpayne@69: if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: #endif jpayne@69: #ifdef __Pyx_StopAsyncIteration_USED jpayne@69: if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: #endif jpayne@69: /*--- Library function declarations ---*/ jpayne@69: /*--- Threads initialization code ---*/ jpayne@69: #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS jpayne@69: PyEval_InitThreads(); jpayne@69: #endif jpayne@69: /*--- Initialize various global constants etc. ---*/ jpayne@69: if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: stringtab_initialized = 1; jpayne@69: if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) jpayne@69: if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: #endif jpayne@69: if (__pyx_module_is_main_pysam__libcutils) { jpayne@69: if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: } jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: { jpayne@69: PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: if (!PyDict_GetItemString(modules, "pysam.libcutils")) { jpayne@69: if (unlikely((PyDict_SetItemString(modules, "pysam.libcutils", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: /*--- Builtin init code ---*/ jpayne@69: if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: /*--- Constants init code ---*/ jpayne@69: if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: /*--- Global type/function init code ---*/ jpayne@69: (void)__Pyx_modinit_global_init_code(); jpayne@69: (void)__Pyx_modinit_variable_export_code(); jpayne@69: if (unlikely((__Pyx_modinit_function_export_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: (void)__Pyx_modinit_type_init_code(); jpayne@69: if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: (void)__Pyx_modinit_variable_import_code(); jpayne@69: (void)__Pyx_modinit_function_import_code(); jpayne@69: /*--- Execution code ---*/ jpayne@69: #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) jpayne@69: if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: #endif jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":2 jpayne@69: * # cython: language_level=3 jpayne@69: * import types # <<<<<<<<<<<<<< jpayne@69: * import sys jpayne@69: * import string jpayne@69: */ jpayne@69: __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_types, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: if (PyDict_SetItem(__pyx_d, __pyx_n_s_types, __pyx_t_2) < 0) __PYX_ERR(0, 2, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":3 jpayne@69: * # cython: language_level=3 jpayne@69: * import types jpayne@69: * import sys # <<<<<<<<<<<<<< jpayne@69: * import string jpayne@69: * import re jpayne@69: */ jpayne@69: __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_sys, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":4 jpayne@69: * import types jpayne@69: * import sys jpayne@69: * import string # <<<<<<<<<<<<<< jpayne@69: * import re jpayne@69: * import tempfile jpayne@69: */ jpayne@69: __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_string, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: if (PyDict_SetItem(__pyx_d, __pyx_n_s_string, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":5 jpayne@69: * import sys jpayne@69: * import string jpayne@69: * import re # <<<<<<<<<<<<<< jpayne@69: * import tempfile jpayne@69: * import os jpayne@69: */ jpayne@69: __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_re, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_2) < 0) __PYX_ERR(0, 5, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":6 jpayne@69: * import string jpayne@69: * import re jpayne@69: * import tempfile # <<<<<<<<<<<<<< jpayne@69: * import os jpayne@69: * import io jpayne@69: */ jpayne@69: __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_tempfile, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: if (PyDict_SetItem(__pyx_d, __pyx_n_s_tempfile, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":7 jpayne@69: * import re jpayne@69: * import tempfile jpayne@69: * import os # <<<<<<<<<<<<<< jpayne@69: * import io jpayne@69: * from contextlib import contextmanager jpayne@69: */ jpayne@69: __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_os, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":8 jpayne@69: * import tempfile jpayne@69: * import os jpayne@69: * import io # <<<<<<<<<<<<<< jpayne@69: * from contextlib import contextmanager jpayne@69: * from codecs import register_error jpayne@69: */ jpayne@69: __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_io, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: if (PyDict_SetItem(__pyx_d, __pyx_n_s_io, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":9 jpayne@69: * import os jpayne@69: * import io jpayne@69: * from contextlib import contextmanager # <<<<<<<<<<<<<< jpayne@69: * from codecs import register_error jpayne@69: * jpayne@69: */ jpayne@69: __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __Pyx_INCREF(__pyx_n_s_contextmanager); jpayne@69: __Pyx_GIVEREF(__pyx_n_s_contextmanager); jpayne@69: if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_contextmanager)) __PYX_ERR(0, 9, __pyx_L1_error); jpayne@69: __pyx_t_3 = __Pyx_Import(__pyx_n_s_contextlib, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_contextmanager); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: if (PyDict_SetItem(__pyx_d, __pyx_n_s_contextmanager, __pyx_t_2) < 0) __PYX_ERR(0, 9, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":10 jpayne@69: * import io jpayne@69: * from contextlib import contextmanager jpayne@69: * from codecs import register_error # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * from cpython.version cimport PY_MAJOR_VERSION, PY_MINOR_VERSION jpayne@69: */ jpayne@69: __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __Pyx_INCREF(__pyx_n_s_register_error); jpayne@69: __Pyx_GIVEREF(__pyx_n_s_register_error); jpayne@69: if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_register_error)) __PYX_ERR(0, 10, __pyx_L1_error); jpayne@69: __pyx_t_2 = __Pyx_Import(__pyx_n_s_codecs, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_register_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: if (PyDict_SetItem(__pyx_d, __pyx_n_s_register_error, __pyx_t_3) < 0) __PYX_ERR(0, 10, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":32 jpayne@69: * ##################################################################### jpayne@69: * # hard-coded constants jpayne@69: * cdef int MAX_POS = (1 << 31) - 1 # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * ################################################################# jpayne@69: */ jpayne@69: __pyx_v_5pysam_9libcutils_MAX_POS = 0x7fffffff; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":36 jpayne@69: * ################################################################# jpayne@69: * # Utility functions for quality string conversions jpayne@69: * cpdef c_array.array qualitystring_to_array(input_str, int offset=33): # <<<<<<<<<<<<<< jpayne@69: * """convert a qualitystring to an array of quality values.""" jpayne@69: * if input_str is None: jpayne@69: */ jpayne@69: __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcutils_1qualitystring_to_array, 0, __pyx_n_s_qualitystring_to_array, NULL, __pyx_n_s_pysam_libcutils, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__18); jpayne@69: if (PyDict_SetItem(__pyx_d, __pyx_n_s_qualitystring_to_array, __pyx_t_2) < 0) __PYX_ERR(0, 36, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":45 jpayne@69: * jpayne@69: * jpayne@69: * cpdef array_to_qualitystring(c_array.array qualities, int offset=33): # <<<<<<<<<<<<<< jpayne@69: * """convert an array of quality values to a string.""" jpayne@69: * if qualities is None: jpayne@69: */ jpayne@69: __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcutils_3array_to_qualitystring, 0, __pyx_n_s_array_to_qualitystring, NULL, __pyx_n_s_pysam_libcutils, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__18); jpayne@69: if (PyDict_SetItem(__pyx_d, __pyx_n_s_array_to_qualitystring, __pyx_t_2) < 0) __PYX_ERR(0, 45, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":59 jpayne@69: * jpayne@69: * jpayne@69: * cpdef qualities_to_qualitystring(qualities, int offset=33): # <<<<<<<<<<<<<< jpayne@69: * """convert a list or array of quality scores to the string jpayne@69: * representation used in the SAM format. jpayne@69: */ jpayne@69: __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcutils_5qualities_to_qualitystring, 0, __pyx_n_s_qualities_to_qualitystring, NULL, __pyx_n_s_pysam_libcutils, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__18); jpayne@69: if (PyDict_SetItem(__pyx_d, __pyx_n_s_qualities_to_qualitystring, __pyx_t_2) < 0) __PYX_ERR(0, 59, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":90 jpayne@69: * jpayne@69: * # Codec error handler that just interprets each bad byte as ISO-8859-1. jpayne@69: * def latin1_replace(exception): # <<<<<<<<<<<<<< jpayne@69: * return (chr(exception.object[exception.start]), exception.end) jpayne@69: * jpayne@69: */ jpayne@69: __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcutils_7latin1_replace, 0, __pyx_n_s_latin1_replace, NULL, __pyx_n_s_pysam_libcutils, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: if (PyDict_SetItem(__pyx_d, __pyx_n_s_latin1_replace, __pyx_t_2) < 0) __PYX_ERR(0, 90, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":93 jpayne@69: * return (chr(exception.object[exception.start]), exception.end) jpayne@69: * jpayne@69: * register_error('pysam.latin1replace', latin1_replace) # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * jpayne@69: */ jpayne@69: __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_register_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_latin1_replace); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 93, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_4); jpayne@69: __Pyx_INCREF(__pyx_kp_u_pysam_latin1replace); jpayne@69: __Pyx_GIVEREF(__pyx_kp_u_pysam_latin1replace); jpayne@69: if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_pysam_latin1replace)) __PYX_ERR(0, 93, __pyx_L1_error); jpayne@69: __Pyx_GIVEREF(__pyx_t_3); jpayne@69: if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error); jpayne@69: __pyx_t_3 = 0; jpayne@69: __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":96 jpayne@69: * jpayne@69: * jpayne@69: * cdef str ERROR_HANDLER = 'strict' # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * cpdef get_encoding_error_handler(): jpayne@69: */ jpayne@69: __Pyx_INCREF(__pyx_n_u_strict); jpayne@69: __Pyx_XGOTREF(__pyx_v_5pysam_9libcutils_ERROR_HANDLER); jpayne@69: __Pyx_DECREF_SET(__pyx_v_5pysam_9libcutils_ERROR_HANDLER, __pyx_n_u_strict); jpayne@69: __Pyx_GIVEREF(__pyx_n_u_strict); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":98 jpayne@69: * cdef str ERROR_HANDLER = 'strict' jpayne@69: * jpayne@69: * cpdef get_encoding_error_handler(): # <<<<<<<<<<<<<< jpayne@69: * return ERROR_HANDLER jpayne@69: * jpayne@69: */ jpayne@69: __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcutils_9get_encoding_error_handler, 0, __pyx_n_s_get_encoding_error_handler, NULL, __pyx_n_s_pysam_libcutils, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_encoding_error_handler, __pyx_t_3) < 0) __PYX_ERR(0, 98, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":101 jpayne@69: * return ERROR_HANDLER jpayne@69: * jpayne@69: * cpdef set_encoding_error_handler(name): # <<<<<<<<<<<<<< jpayne@69: * global ERROR_HANDLER jpayne@69: * previous = ERROR_HANDLER jpayne@69: */ jpayne@69: __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcutils_11set_encoding_error_handler, 0, __pyx_n_s_set_encoding_error_handler, NULL, __pyx_n_s_pysam_libcutils, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_encoding_error_handler, __pyx_t_3) < 0) __PYX_ERR(0, 101, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":115 jpayne@69: * jpayne@69: * # filename encoding (adapted from lxml.etree.pyx) jpayne@69: * cdef str FILENAME_ENCODING = sys.getfilesystemencoding() or sys.getdefaultencoding() or 'ascii' # <<<<<<<<<<<<<< jpayne@69: * cdef str TEXT_ENCODING = 'utf-8' jpayne@69: * jpayne@69: */ jpayne@69: __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_4); jpayne@69: __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; jpayne@69: __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_4); jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 115, __pyx_L1_error) jpayne@69: if (!__pyx_t_5) { jpayne@69: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; jpayne@69: } else { jpayne@69: if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_4))) __PYX_ERR(0, 115, __pyx_L1_error) jpayne@69: __Pyx_INCREF(__pyx_t_4); jpayne@69: __pyx_t_3 = __pyx_t_4; jpayne@69: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; jpayne@69: goto __pyx_L2_bool_binop_done; jpayne@69: } jpayne@69: __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_4); jpayne@69: __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_getdefaultencoding); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_2); jpayne@69: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; jpayne@69: __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_4); jpayne@69: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; jpayne@69: __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 115, __pyx_L1_error) jpayne@69: if (!__pyx_t_5) { jpayne@69: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; jpayne@69: } else { jpayne@69: if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_4))) __PYX_ERR(0, 115, __pyx_L1_error) jpayne@69: __Pyx_INCREF(__pyx_t_4); jpayne@69: __pyx_t_3 = __pyx_t_4; jpayne@69: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; jpayne@69: goto __pyx_L2_bool_binop_done; jpayne@69: } jpayne@69: __Pyx_INCREF(__pyx_n_u_ascii); jpayne@69: __pyx_t_3 = __pyx_n_u_ascii; jpayne@69: __pyx_L2_bool_binop_done:; jpayne@69: __Pyx_XGOTREF(__pyx_v_5pysam_9libcutils_FILENAME_ENCODING); jpayne@69: __Pyx_DECREF_SET(__pyx_v_5pysam_9libcutils_FILENAME_ENCODING, ((PyObject*)__pyx_t_3)); jpayne@69: __Pyx_GIVEREF(__pyx_t_3); jpayne@69: __pyx_t_3 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":116 jpayne@69: * # filename encoding (adapted from lxml.etree.pyx) jpayne@69: * cdef str FILENAME_ENCODING = sys.getfilesystemencoding() or sys.getdefaultencoding() or 'ascii' jpayne@69: * cdef str TEXT_ENCODING = 'utf-8' # <<<<<<<<<<<<<< jpayne@69: * jpayne@69: * cdef bytes encode_filename(object filename): jpayne@69: */ jpayne@69: __Pyx_INCREF(__pyx_kp_u_utf_8); jpayne@69: __Pyx_XGOTREF(__pyx_v_5pysam_9libcutils_TEXT_ENCODING); jpayne@69: __Pyx_DECREF_SET(__pyx_v_5pysam_9libcutils_TEXT_ENCODING, __pyx_kp_u_utf_8); jpayne@69: __Pyx_GIVEREF(__pyx_kp_u_utf_8); jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":178 jpayne@69: * jpayne@69: * jpayne@69: * cpdef parse_region(contig=None, # <<<<<<<<<<<<<< jpayne@69: * start=None, jpayne@69: * stop=None, jpayne@69: */ jpayne@69: __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcutils_13parse_region, 0, __pyx_n_s_parse_region, NULL, __pyx_n_s_pysam_libcutils, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__29); jpayne@69: if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_region, __pyx_t_3) < 0) __PYX_ERR(0, 178, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":276 jpayne@69: * jpayne@69: * jpayne@69: * def _pysam_dispatch(collection, # <<<<<<<<<<<<<< jpayne@69: * method, jpayne@69: * args=None, jpayne@69: */ jpayne@69: __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcutils_15_pysam_dispatch, 0, __pyx_n_s_pysam_dispatch, NULL, __pyx_n_s_pysam_libcutils, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__32); jpayne@69: if (PyDict_SetItem(__pyx_d, __pyx_n_s_pysam_dispatch, __pyx_t_3) < 0) __PYX_ERR(0, 276, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":437 jpayne@69: * jpayne@69: * jpayne@69: * __all__ = [ # <<<<<<<<<<<<<< jpayne@69: * "qualitystring_to_array", jpayne@69: * "array_to_qualitystring", jpayne@69: */ jpayne@69: __pyx_t_3 = PyList_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: __Pyx_INCREF(__pyx_n_u_qualitystring_to_array); jpayne@69: __Pyx_GIVEREF(__pyx_n_u_qualitystring_to_array); jpayne@69: if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_u_qualitystring_to_array)) __PYX_ERR(0, 437, __pyx_L1_error); jpayne@69: __Pyx_INCREF(__pyx_n_u_array_to_qualitystring); jpayne@69: __Pyx_GIVEREF(__pyx_n_u_array_to_qualitystring); jpayne@69: if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_u_array_to_qualitystring)) __PYX_ERR(0, 437, __pyx_L1_error); jpayne@69: __Pyx_INCREF(__pyx_n_u_qualities_to_qualitystring); jpayne@69: __Pyx_GIVEREF(__pyx_n_u_qualities_to_qualitystring); jpayne@69: if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_u_qualities_to_qualitystring)) __PYX_ERR(0, 437, __pyx_L1_error); jpayne@69: __Pyx_INCREF(__pyx_n_u_get_encoding_error_handler); jpayne@69: __Pyx_GIVEREF(__pyx_n_u_get_encoding_error_handler); jpayne@69: if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_u_get_encoding_error_handler)) __PYX_ERR(0, 437, __pyx_L1_error); jpayne@69: __Pyx_INCREF(__pyx_n_u_set_encoding_error_handler); jpayne@69: __Pyx_GIVEREF(__pyx_n_u_set_encoding_error_handler); jpayne@69: if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 4, __pyx_n_u_set_encoding_error_handler)) __PYX_ERR(0, 437, __pyx_L1_error); jpayne@69: if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_3) < 0) __PYX_ERR(0, 437, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: jpayne@69: /* "pysam/libcutils.pyx":1 jpayne@69: * # cython: language_level=3 # <<<<<<<<<<<<<< jpayne@69: * import types jpayne@69: * import sys jpayne@69: */ jpayne@69: __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: __Pyx_GOTREF(__pyx_t_3); jpayne@69: if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) jpayne@69: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; jpayne@69: jpayne@69: /*--- Wrapped vars code ---*/ jpayne@69: jpayne@69: goto __pyx_L0; jpayne@69: __pyx_L1_error:; jpayne@69: __Pyx_XDECREF(__pyx_t_2); jpayne@69: __Pyx_XDECREF(__pyx_t_3); jpayne@69: __Pyx_XDECREF(__pyx_t_4); jpayne@69: if (__pyx_m) { jpayne@69: if (__pyx_d && stringtab_initialized) { jpayne@69: __Pyx_AddTraceback("init pysam.libcutils", __pyx_clineno, __pyx_lineno, __pyx_filename); jpayne@69: } jpayne@69: #if !CYTHON_USE_MODULE_STATE jpayne@69: Py_CLEAR(__pyx_m); jpayne@69: #else jpayne@69: Py_DECREF(__pyx_m); jpayne@69: if (pystate_addmodule_run) { jpayne@69: PyObject *tp, *value, *tb; jpayne@69: PyErr_Fetch(&tp, &value, &tb); jpayne@69: PyState_RemoveModule(&__pyx_moduledef); jpayne@69: PyErr_Restore(tp, value, tb); jpayne@69: } jpayne@69: #endif jpayne@69: } else if (!PyErr_Occurred()) { jpayne@69: PyErr_SetString(PyExc_ImportError, "init pysam.libcutils"); jpayne@69: } jpayne@69: __pyx_L0:; jpayne@69: __Pyx_RefNannyFinishContext(); jpayne@69: #if CYTHON_PEP489_MULTI_PHASE_INIT jpayne@69: return (__pyx_m != NULL) ? 0 : -1; jpayne@69: #elif PY_MAJOR_VERSION >= 3 jpayne@69: return __pyx_m; jpayne@69: #else jpayne@69: return; jpayne@69: #endif jpayne@69: } jpayne@69: /* #### Code section: cleanup_globals ### */ jpayne@69: /* #### Code section: cleanup_module ### */ jpayne@69: /* #### Code section: main_method ### */ jpayne@69: /* #### Code section: utility_code_pragmas ### */ jpayne@69: #ifdef _MSC_VER jpayne@69: #pragma warning( push ) jpayne@69: /* Warning 4127: conditional expression is constant jpayne@69: * Cython uses constant conditional expressions to allow in inline functions to be optimized at jpayne@69: * compile-time, so this warning is not useful jpayne@69: */ jpayne@69: #pragma warning( disable : 4127 ) jpayne@69: #endif jpayne@69: jpayne@69: jpayne@69: jpayne@69: /* #### Code section: utility_code_def ### */ jpayne@69: jpayne@69: /* --- Runtime support code --- */ jpayne@69: /* Refnanny */ jpayne@69: #if CYTHON_REFNANNY jpayne@69: static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { jpayne@69: PyObject *m = NULL, *p = NULL; jpayne@69: void *r = NULL; jpayne@69: m = PyImport_ImportModule(modname); jpayne@69: if (!m) goto end; jpayne@69: p = PyObject_GetAttrString(m, "RefNannyAPI"); jpayne@69: if (!p) goto end; jpayne@69: r = PyLong_AsVoidPtr(p); jpayne@69: end: jpayne@69: Py_XDECREF(p); jpayne@69: Py_XDECREF(m); jpayne@69: return (__Pyx_RefNannyAPIStruct *)r; jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: /* PyErrExceptionMatches */ jpayne@69: #if CYTHON_FAST_THREAD_STATE jpayne@69: static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { jpayne@69: Py_ssize_t i, n; jpayne@69: n = PyTuple_GET_SIZE(tuple); jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: for (i=0; i= 0x030C00A6 jpayne@69: PyObject *current_exception = tstate->current_exception; jpayne@69: if (unlikely(!current_exception)) return 0; jpayne@69: exc_type = (PyObject*) Py_TYPE(current_exception); jpayne@69: if (exc_type == err) return 1; jpayne@69: #else jpayne@69: exc_type = tstate->curexc_type; jpayne@69: if (exc_type == err) return 1; jpayne@69: if (unlikely(!exc_type)) return 0; jpayne@69: #endif jpayne@69: #if CYTHON_AVOID_BORROWED_REFS jpayne@69: Py_INCREF(exc_type); jpayne@69: #endif jpayne@69: if (unlikely(PyTuple_Check(err))) { jpayne@69: result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); jpayne@69: } else { jpayne@69: result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); jpayne@69: } jpayne@69: #if CYTHON_AVOID_BORROWED_REFS jpayne@69: Py_DECREF(exc_type); jpayne@69: #endif jpayne@69: return result; jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: /* PyErrFetchRestore */ jpayne@69: #if CYTHON_FAST_THREAD_STATE jpayne@69: static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { jpayne@69: #if PY_VERSION_HEX >= 0x030C00A6 jpayne@69: PyObject *tmp_value; jpayne@69: assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); jpayne@69: if (value) { jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON jpayne@69: if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) jpayne@69: #endif jpayne@69: PyException_SetTraceback(value, tb); jpayne@69: } jpayne@69: tmp_value = tstate->current_exception; jpayne@69: tstate->current_exception = value; jpayne@69: Py_XDECREF(tmp_value); jpayne@69: Py_XDECREF(type); jpayne@69: Py_XDECREF(tb); jpayne@69: #else jpayne@69: PyObject *tmp_type, *tmp_value, *tmp_tb; jpayne@69: tmp_type = tstate->curexc_type; jpayne@69: tmp_value = tstate->curexc_value; jpayne@69: tmp_tb = tstate->curexc_traceback; jpayne@69: tstate->curexc_type = type; jpayne@69: tstate->curexc_value = value; jpayne@69: tstate->curexc_traceback = tb; jpayne@69: Py_XDECREF(tmp_type); jpayne@69: Py_XDECREF(tmp_value); jpayne@69: Py_XDECREF(tmp_tb); jpayne@69: #endif jpayne@69: } jpayne@69: static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { jpayne@69: #if PY_VERSION_HEX >= 0x030C00A6 jpayne@69: PyObject* exc_value; jpayne@69: exc_value = tstate->current_exception; jpayne@69: tstate->current_exception = 0; jpayne@69: *value = exc_value; jpayne@69: *type = NULL; jpayne@69: *tb = NULL; jpayne@69: if (exc_value) { jpayne@69: *type = (PyObject*) Py_TYPE(exc_value); jpayne@69: Py_INCREF(*type); jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON jpayne@69: *tb = ((PyBaseExceptionObject*) exc_value)->traceback; jpayne@69: Py_XINCREF(*tb); jpayne@69: #else jpayne@69: *tb = PyException_GetTraceback(exc_value); jpayne@69: #endif jpayne@69: } jpayne@69: #else jpayne@69: *type = tstate->curexc_type; jpayne@69: *value = tstate->curexc_value; jpayne@69: *tb = tstate->curexc_traceback; jpayne@69: tstate->curexc_type = 0; jpayne@69: tstate->curexc_value = 0; jpayne@69: tstate->curexc_traceback = 0; jpayne@69: #endif jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: /* PyObjectGetAttrStr */ jpayne@69: #if CYTHON_USE_TYPE_SLOTS jpayne@69: static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { jpayne@69: PyTypeObject* tp = Py_TYPE(obj); jpayne@69: if (likely(tp->tp_getattro)) jpayne@69: return tp->tp_getattro(obj, attr_name); jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: if (likely(tp->tp_getattr)) jpayne@69: return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); jpayne@69: #endif jpayne@69: return PyObject_GetAttr(obj, attr_name); jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: /* PyObjectGetAttrStrNoError */ jpayne@69: #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 jpayne@69: static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { jpayne@69: __Pyx_PyThreadState_declare jpayne@69: __Pyx_PyThreadState_assign jpayne@69: if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) jpayne@69: __Pyx_PyErr_Clear(); jpayne@69: } jpayne@69: #endif jpayne@69: static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { jpayne@69: PyObject *result; jpayne@69: #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 jpayne@69: (void) PyObject_GetOptionalAttr(obj, attr_name, &result); jpayne@69: return result; jpayne@69: #else jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 jpayne@69: PyTypeObject* tp = Py_TYPE(obj); jpayne@69: if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { jpayne@69: return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); jpayne@69: } jpayne@69: #endif jpayne@69: result = __Pyx_PyObject_GetAttrStr(obj, attr_name); jpayne@69: if (unlikely(!result)) { jpayne@69: __Pyx_PyObject_GetAttrStr_ClearAttributeError(); jpayne@69: } jpayne@69: return result; jpayne@69: #endif jpayne@69: } jpayne@69: jpayne@69: /* GetBuiltinName */ jpayne@69: static PyObject *__Pyx_GetBuiltinName(PyObject *name) { jpayne@69: PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); jpayne@69: if (unlikely(!result) && !PyErr_Occurred()) { jpayne@69: PyErr_Format(PyExc_NameError, jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: "name '%U' is not defined", name); jpayne@69: #else jpayne@69: "name '%.200s' is not defined", PyString_AS_STRING(name)); jpayne@69: #endif jpayne@69: } jpayne@69: return result; jpayne@69: } jpayne@69: jpayne@69: /* TupleAndListFromArray */ jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON jpayne@69: static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { jpayne@69: PyObject *v; jpayne@69: Py_ssize_t i; jpayne@69: for (i = 0; i < length; i++) { jpayne@69: v = dest[i] = src[i]; jpayne@69: Py_INCREF(v); jpayne@69: } jpayne@69: } jpayne@69: static CYTHON_INLINE PyObject * jpayne@69: __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) jpayne@69: { jpayne@69: PyObject *res; jpayne@69: if (n <= 0) { jpayne@69: Py_INCREF(__pyx_empty_tuple); jpayne@69: return __pyx_empty_tuple; jpayne@69: } jpayne@69: res = PyTuple_New(n); jpayne@69: if (unlikely(res == NULL)) return NULL; jpayne@69: __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); jpayne@69: return res; jpayne@69: } jpayne@69: static CYTHON_INLINE PyObject * jpayne@69: __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) jpayne@69: { jpayne@69: PyObject *res; jpayne@69: if (n <= 0) { jpayne@69: return PyList_New(0); jpayne@69: } jpayne@69: res = PyList_New(n); jpayne@69: if (unlikely(res == NULL)) return NULL; jpayne@69: __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); jpayne@69: return res; jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: /* BytesEquals */ jpayne@69: static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { jpayne@69: #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API jpayne@69: return PyObject_RichCompareBool(s1, s2, equals); jpayne@69: #else jpayne@69: if (s1 == s2) { jpayne@69: return (equals == Py_EQ); jpayne@69: } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { jpayne@69: const char *ps1, *ps2; jpayne@69: Py_ssize_t length = PyBytes_GET_SIZE(s1); jpayne@69: if (length != PyBytes_GET_SIZE(s2)) jpayne@69: return (equals == Py_NE); jpayne@69: ps1 = PyBytes_AS_STRING(s1); jpayne@69: ps2 = PyBytes_AS_STRING(s2); jpayne@69: if (ps1[0] != ps2[0]) { jpayne@69: return (equals == Py_NE); jpayne@69: } else if (length == 1) { jpayne@69: return (equals == Py_EQ); jpayne@69: } else { jpayne@69: int result; jpayne@69: #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) jpayne@69: Py_hash_t hash1, hash2; jpayne@69: hash1 = ((PyBytesObject*)s1)->ob_shash; jpayne@69: hash2 = ((PyBytesObject*)s2)->ob_shash; jpayne@69: if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { jpayne@69: return (equals == Py_NE); jpayne@69: } jpayne@69: #endif jpayne@69: result = memcmp(ps1, ps2, (size_t)length); jpayne@69: return (equals == Py_EQ) ? (result == 0) : (result != 0); jpayne@69: } jpayne@69: } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { jpayne@69: return (equals == Py_NE); jpayne@69: } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { jpayne@69: return (equals == Py_NE); jpayne@69: } else { jpayne@69: int result; jpayne@69: PyObject* py_result = PyObject_RichCompare(s1, s2, equals); jpayne@69: if (!py_result) jpayne@69: return -1; jpayne@69: result = __Pyx_PyObject_IsTrue(py_result); jpayne@69: Py_DECREF(py_result); jpayne@69: return result; jpayne@69: } jpayne@69: #endif jpayne@69: } jpayne@69: jpayne@69: /* UnicodeEquals */ jpayne@69: static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { jpayne@69: #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API jpayne@69: return PyObject_RichCompareBool(s1, s2, equals); jpayne@69: #else jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: PyObject* owned_ref = NULL; jpayne@69: #endif jpayne@69: int s1_is_unicode, s2_is_unicode; jpayne@69: if (s1 == s2) { jpayne@69: goto return_eq; jpayne@69: } jpayne@69: s1_is_unicode = PyUnicode_CheckExact(s1); jpayne@69: s2_is_unicode = PyUnicode_CheckExact(s2); jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { jpayne@69: owned_ref = PyUnicode_FromObject(s2); jpayne@69: if (unlikely(!owned_ref)) jpayne@69: return -1; jpayne@69: s2 = owned_ref; jpayne@69: s2_is_unicode = 1; jpayne@69: } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { jpayne@69: owned_ref = PyUnicode_FromObject(s1); jpayne@69: if (unlikely(!owned_ref)) jpayne@69: return -1; jpayne@69: s1 = owned_ref; jpayne@69: s1_is_unicode = 1; jpayne@69: } else if (((!s2_is_unicode) & (!s1_is_unicode))) { jpayne@69: return __Pyx_PyBytes_Equals(s1, s2, equals); jpayne@69: } jpayne@69: #endif jpayne@69: if (s1_is_unicode & s2_is_unicode) { jpayne@69: Py_ssize_t length; jpayne@69: int kind; jpayne@69: void *data1, *data2; jpayne@69: if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) jpayne@69: return -1; jpayne@69: length = __Pyx_PyUnicode_GET_LENGTH(s1); jpayne@69: if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { jpayne@69: goto return_ne; jpayne@69: } jpayne@69: #if CYTHON_USE_UNICODE_INTERNALS jpayne@69: { jpayne@69: Py_hash_t hash1, hash2; jpayne@69: #if CYTHON_PEP393_ENABLED jpayne@69: hash1 = ((PyASCIIObject*)s1)->hash; jpayne@69: hash2 = ((PyASCIIObject*)s2)->hash; jpayne@69: #else jpayne@69: hash1 = ((PyUnicodeObject*)s1)->hash; jpayne@69: hash2 = ((PyUnicodeObject*)s2)->hash; jpayne@69: #endif jpayne@69: if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { jpayne@69: goto return_ne; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: kind = __Pyx_PyUnicode_KIND(s1); jpayne@69: if (kind != __Pyx_PyUnicode_KIND(s2)) { jpayne@69: goto return_ne; jpayne@69: } jpayne@69: data1 = __Pyx_PyUnicode_DATA(s1); jpayne@69: data2 = __Pyx_PyUnicode_DATA(s2); jpayne@69: if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { jpayne@69: goto return_ne; jpayne@69: } else if (length == 1) { jpayne@69: goto return_eq; jpayne@69: } else { jpayne@69: int result = memcmp(data1, data2, (size_t)(length * kind)); jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: Py_XDECREF(owned_ref); jpayne@69: #endif jpayne@69: return (equals == Py_EQ) ? (result == 0) : (result != 0); jpayne@69: } jpayne@69: } else if ((s1 == Py_None) & s2_is_unicode) { jpayne@69: goto return_ne; jpayne@69: } else if ((s2 == Py_None) & s1_is_unicode) { jpayne@69: goto return_ne; jpayne@69: } else { jpayne@69: int result; jpayne@69: PyObject* py_result = PyObject_RichCompare(s1, s2, equals); jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: Py_XDECREF(owned_ref); jpayne@69: #endif jpayne@69: if (!py_result) jpayne@69: return -1; jpayne@69: result = __Pyx_PyObject_IsTrue(py_result); jpayne@69: Py_DECREF(py_result); jpayne@69: return result; jpayne@69: } jpayne@69: return_eq: jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: Py_XDECREF(owned_ref); jpayne@69: #endif jpayne@69: return (equals == Py_EQ); jpayne@69: return_ne: jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: Py_XDECREF(owned_ref); jpayne@69: #endif jpayne@69: return (equals == Py_NE); jpayne@69: #endif jpayne@69: } jpayne@69: jpayne@69: /* fastcall */ jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) jpayne@69: { jpayne@69: Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); jpayne@69: for (i = 0; i < n; i++) jpayne@69: { jpayne@69: if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; jpayne@69: } jpayne@69: for (i = 0; i < n; i++) jpayne@69: { jpayne@69: int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); jpayne@69: if (unlikely(eq != 0)) { jpayne@69: if (unlikely(eq < 0)) return NULL; jpayne@69: return kwvalues[i]; jpayne@69: } jpayne@69: } jpayne@69: return NULL; jpayne@69: } jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 jpayne@69: CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { jpayne@69: Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); jpayne@69: PyObject *dict; jpayne@69: dict = PyDict_New(); jpayne@69: if (unlikely(!dict)) jpayne@69: return NULL; jpayne@69: for (i=0; itp_call; jpayne@69: if (unlikely(!call)) jpayne@69: return PyObject_Call(func, arg, kw); jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) jpayne@69: return NULL; jpayne@69: #else jpayne@69: if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) jpayne@69: return NULL; jpayne@69: #endif jpayne@69: result = (*call)(func, arg, kw); jpayne@69: Py_LeaveRecursiveCall(); jpayne@69: if (unlikely(!result) && unlikely(!PyErr_Occurred())) { jpayne@69: PyErr_SetString( jpayne@69: PyExc_SystemError, jpayne@69: "NULL result without error in PyObject_Call"); jpayne@69: } jpayne@69: return result; jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: /* RaiseDoubleKeywords */ jpayne@69: static void __Pyx_RaiseDoubleKeywordsError( jpayne@69: const char* func_name, jpayne@69: PyObject* kw_name) jpayne@69: { jpayne@69: PyErr_Format(PyExc_TypeError, jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: "%s() got multiple values for keyword argument '%U'", func_name, kw_name); jpayne@69: #else jpayne@69: "%s() got multiple values for keyword argument '%s'", func_name, jpayne@69: PyString_AsString(kw_name)); jpayne@69: #endif jpayne@69: } jpayne@69: jpayne@69: /* ParseKeywords */ jpayne@69: static int __Pyx_ParseOptionalKeywords( jpayne@69: PyObject *kwds, jpayne@69: PyObject *const *kwvalues, jpayne@69: PyObject **argnames[], jpayne@69: PyObject *kwds2, jpayne@69: PyObject *values[], jpayne@69: Py_ssize_t num_pos_args, jpayne@69: const char* function_name) jpayne@69: { jpayne@69: PyObject *key = 0, *value = 0; jpayne@69: Py_ssize_t pos = 0; jpayne@69: PyObject*** name; jpayne@69: PyObject*** first_kw_arg = argnames + num_pos_args; jpayne@69: int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); jpayne@69: while (1) { jpayne@69: Py_XDECREF(key); key = NULL; jpayne@69: Py_XDECREF(value); value = NULL; jpayne@69: if (kwds_is_tuple) { jpayne@69: Py_ssize_t size; jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS jpayne@69: size = PyTuple_GET_SIZE(kwds); jpayne@69: #else jpayne@69: size = PyTuple_Size(kwds); jpayne@69: if (size < 0) goto bad; jpayne@69: #endif jpayne@69: if (pos >= size) break; jpayne@69: #if CYTHON_AVOID_BORROWED_REFS jpayne@69: key = __Pyx_PySequence_ITEM(kwds, pos); jpayne@69: if (!key) goto bad; jpayne@69: #elif CYTHON_ASSUME_SAFE_MACROS jpayne@69: key = PyTuple_GET_ITEM(kwds, pos); jpayne@69: #else jpayne@69: key = PyTuple_GetItem(kwds, pos); jpayne@69: if (!key) goto bad; jpayne@69: #endif jpayne@69: value = kwvalues[pos]; jpayne@69: pos++; jpayne@69: } jpayne@69: else jpayne@69: { jpayne@69: if (!PyDict_Next(kwds, &pos, &key, &value)) break; jpayne@69: #if CYTHON_AVOID_BORROWED_REFS jpayne@69: Py_INCREF(key); jpayne@69: #endif jpayne@69: } jpayne@69: name = first_kw_arg; jpayne@69: while (*name && (**name != key)) name++; jpayne@69: if (*name) { jpayne@69: values[name-argnames] = value; jpayne@69: #if CYTHON_AVOID_BORROWED_REFS jpayne@69: Py_INCREF(value); jpayne@69: Py_DECREF(key); jpayne@69: #endif jpayne@69: key = NULL; jpayne@69: value = NULL; jpayne@69: continue; jpayne@69: } jpayne@69: #if !CYTHON_AVOID_BORROWED_REFS jpayne@69: Py_INCREF(key); jpayne@69: #endif jpayne@69: Py_INCREF(value); jpayne@69: name = first_kw_arg; jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: if (likely(PyString_Check(key))) { jpayne@69: while (*name) { jpayne@69: if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) jpayne@69: && _PyString_Eq(**name, key)) { jpayne@69: values[name-argnames] = value; jpayne@69: #if CYTHON_AVOID_BORROWED_REFS jpayne@69: value = NULL; jpayne@69: #endif jpayne@69: break; jpayne@69: } jpayne@69: name++; jpayne@69: } jpayne@69: if (*name) continue; jpayne@69: else { jpayne@69: PyObject*** argname = argnames; jpayne@69: while (argname != first_kw_arg) { jpayne@69: if ((**argname == key) || ( jpayne@69: (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) jpayne@69: && _PyString_Eq(**argname, key))) { jpayne@69: goto arg_passed_twice; jpayne@69: } jpayne@69: argname++; jpayne@69: } jpayne@69: } jpayne@69: } else jpayne@69: #endif jpayne@69: if (likely(PyUnicode_Check(key))) { jpayne@69: while (*name) { jpayne@69: int cmp = ( jpayne@69: #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 jpayne@69: (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : jpayne@69: #endif jpayne@69: PyUnicode_Compare(**name, key) jpayne@69: ); jpayne@69: if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; jpayne@69: if (cmp == 0) { jpayne@69: values[name-argnames] = value; jpayne@69: #if CYTHON_AVOID_BORROWED_REFS jpayne@69: value = NULL; jpayne@69: #endif jpayne@69: break; jpayne@69: } jpayne@69: name++; jpayne@69: } jpayne@69: if (*name) continue; jpayne@69: else { jpayne@69: PyObject*** argname = argnames; jpayne@69: while (argname != first_kw_arg) { jpayne@69: int cmp = (**argname == key) ? 0 : jpayne@69: #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 jpayne@69: (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : jpayne@69: #endif jpayne@69: PyUnicode_Compare(**argname, key); jpayne@69: if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; jpayne@69: if (cmp == 0) goto arg_passed_twice; jpayne@69: argname++; jpayne@69: } jpayne@69: } jpayne@69: } else jpayne@69: goto invalid_keyword_type; jpayne@69: if (kwds2) { jpayne@69: if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; jpayne@69: } else { jpayne@69: goto invalid_keyword; jpayne@69: } jpayne@69: } jpayne@69: Py_XDECREF(key); jpayne@69: Py_XDECREF(value); jpayne@69: return 0; jpayne@69: arg_passed_twice: jpayne@69: __Pyx_RaiseDoubleKeywordsError(function_name, key); jpayne@69: goto bad; jpayne@69: invalid_keyword_type: jpayne@69: PyErr_Format(PyExc_TypeError, jpayne@69: "%.200s() keywords must be strings", function_name); jpayne@69: goto bad; jpayne@69: invalid_keyword: jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: PyErr_Format(PyExc_TypeError, jpayne@69: "%.200s() got an unexpected keyword argument '%.200s'", jpayne@69: function_name, PyString_AsString(key)); jpayne@69: #else jpayne@69: PyErr_Format(PyExc_TypeError, jpayne@69: "%s() got an unexpected keyword argument '%U'", jpayne@69: function_name, key); jpayne@69: #endif jpayne@69: bad: jpayne@69: Py_XDECREF(key); jpayne@69: Py_XDECREF(value); jpayne@69: return -1; jpayne@69: } jpayne@69: jpayne@69: /* RaiseArgTupleInvalid */ jpayne@69: static void __Pyx_RaiseArgtupleInvalid( jpayne@69: const char* func_name, jpayne@69: int exact, jpayne@69: Py_ssize_t num_min, jpayne@69: Py_ssize_t num_max, jpayne@69: Py_ssize_t num_found) jpayne@69: { jpayne@69: Py_ssize_t num_expected; jpayne@69: const char *more_or_less; jpayne@69: if (num_found < num_min) { jpayne@69: num_expected = num_min; jpayne@69: more_or_less = "at least"; jpayne@69: } else { jpayne@69: num_expected = num_max; jpayne@69: more_or_less = "at most"; jpayne@69: } jpayne@69: if (exact) { jpayne@69: more_or_less = "exactly"; jpayne@69: } jpayne@69: PyErr_Format(PyExc_TypeError, jpayne@69: "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", jpayne@69: func_name, more_or_less, num_expected, jpayne@69: (num_expected == 1) ? "" : "s", num_found); jpayne@69: } jpayne@69: jpayne@69: /* GetItemInt */ jpayne@69: static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { jpayne@69: PyObject *r; jpayne@69: if (unlikely(!j)) return NULL; jpayne@69: r = PyObject_GetItem(o, j); jpayne@69: Py_DECREF(j); jpayne@69: return r; jpayne@69: } jpayne@69: static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, jpayne@69: CYTHON_NCP_UNUSED int wraparound, jpayne@69: CYTHON_NCP_UNUSED int boundscheck) { jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS jpayne@69: Py_ssize_t wrapped_i = i; jpayne@69: if (wraparound & unlikely(i < 0)) { jpayne@69: wrapped_i += PyList_GET_SIZE(o); jpayne@69: } jpayne@69: if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { jpayne@69: PyObject *r = PyList_GET_ITEM(o, wrapped_i); jpayne@69: Py_INCREF(r); jpayne@69: return r; jpayne@69: } jpayne@69: return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); jpayne@69: #else jpayne@69: return PySequence_GetItem(o, i); jpayne@69: #endif jpayne@69: } jpayne@69: static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, jpayne@69: CYTHON_NCP_UNUSED int wraparound, jpayne@69: CYTHON_NCP_UNUSED int boundscheck) { jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS jpayne@69: Py_ssize_t wrapped_i = i; jpayne@69: if (wraparound & unlikely(i < 0)) { jpayne@69: wrapped_i += PyTuple_GET_SIZE(o); jpayne@69: } jpayne@69: if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { jpayne@69: PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); jpayne@69: Py_INCREF(r); jpayne@69: return r; jpayne@69: } jpayne@69: return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); jpayne@69: #else jpayne@69: return PySequence_GetItem(o, i); jpayne@69: #endif jpayne@69: } jpayne@69: static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, jpayne@69: CYTHON_NCP_UNUSED int wraparound, jpayne@69: CYTHON_NCP_UNUSED int boundscheck) { jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS jpayne@69: if (is_list || PyList_CheckExact(o)) { jpayne@69: Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); jpayne@69: if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { jpayne@69: PyObject *r = PyList_GET_ITEM(o, n); jpayne@69: Py_INCREF(r); jpayne@69: return r; jpayne@69: } jpayne@69: } jpayne@69: else if (PyTuple_CheckExact(o)) { jpayne@69: Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); jpayne@69: if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { jpayne@69: PyObject *r = PyTuple_GET_ITEM(o, n); jpayne@69: Py_INCREF(r); jpayne@69: return r; jpayne@69: } jpayne@69: } else { jpayne@69: PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; jpayne@69: PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; jpayne@69: if (mm && mm->mp_subscript) { jpayne@69: PyObject *r, *key = PyInt_FromSsize_t(i); jpayne@69: if (unlikely(!key)) return NULL; jpayne@69: r = mm->mp_subscript(o, key); jpayne@69: Py_DECREF(key); jpayne@69: return r; jpayne@69: } jpayne@69: if (likely(sm && sm->sq_item)) { jpayne@69: if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { jpayne@69: Py_ssize_t l = sm->sq_length(o); jpayne@69: if (likely(l >= 0)) { jpayne@69: i += l; jpayne@69: } else { jpayne@69: if (!PyErr_ExceptionMatches(PyExc_OverflowError)) jpayne@69: return NULL; jpayne@69: PyErr_Clear(); jpayne@69: } jpayne@69: } jpayne@69: return sm->sq_item(o, i); jpayne@69: } jpayne@69: } jpayne@69: #else jpayne@69: if (is_list || !PyMapping_Check(o)) { jpayne@69: return PySequence_GetItem(o, i); jpayne@69: } jpayne@69: #endif jpayne@69: return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); jpayne@69: } jpayne@69: jpayne@69: /* SetItemInt */ jpayne@69: static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { jpayne@69: int r; jpayne@69: if (unlikely(!j)) return -1; jpayne@69: r = PyObject_SetItem(o, j, v); jpayne@69: Py_DECREF(j); jpayne@69: return r; jpayne@69: } jpayne@69: static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, jpayne@69: CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS jpayne@69: if (is_list || PyList_CheckExact(o)) { jpayne@69: Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o)); jpayne@69: if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) { jpayne@69: PyObject* old = PyList_GET_ITEM(o, n); jpayne@69: Py_INCREF(v); jpayne@69: PyList_SET_ITEM(o, n, v); jpayne@69: Py_DECREF(old); jpayne@69: return 1; jpayne@69: } jpayne@69: } else { jpayne@69: PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; jpayne@69: PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; jpayne@69: if (mm && mm->mp_ass_subscript) { jpayne@69: int r; jpayne@69: PyObject *key = PyInt_FromSsize_t(i); jpayne@69: if (unlikely(!key)) return -1; jpayne@69: r = mm->mp_ass_subscript(o, key, v); jpayne@69: Py_DECREF(key); jpayne@69: return r; jpayne@69: } jpayne@69: if (likely(sm && sm->sq_ass_item)) { jpayne@69: if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { jpayne@69: Py_ssize_t l = sm->sq_length(o); jpayne@69: if (likely(l >= 0)) { jpayne@69: i += l; jpayne@69: } else { jpayne@69: if (!PyErr_ExceptionMatches(PyExc_OverflowError)) jpayne@69: return -1; jpayne@69: PyErr_Clear(); jpayne@69: } jpayne@69: } jpayne@69: return sm->sq_ass_item(o, i, v); jpayne@69: } jpayne@69: } jpayne@69: #else jpayne@69: if (is_list || !PyMapping_Check(o)) jpayne@69: { jpayne@69: return PySequence_SetItem(o, i, v); jpayne@69: } jpayne@69: #endif jpayne@69: return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); jpayne@69: } jpayne@69: jpayne@69: /* PyFunctionFastCall */ jpayne@69: #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL jpayne@69: static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, jpayne@69: PyObject *globals) { jpayne@69: PyFrameObject *f; jpayne@69: PyThreadState *tstate = __Pyx_PyThreadState_Current; jpayne@69: PyObject **fastlocals; jpayne@69: Py_ssize_t i; jpayne@69: PyObject *result; jpayne@69: assert(globals != NULL); jpayne@69: /* XXX Perhaps we should create a specialized jpayne@69: PyFrame_New() that doesn't take locals, but does jpayne@69: take builtins without sanity checking them. jpayne@69: */ jpayne@69: assert(tstate != NULL); jpayne@69: f = PyFrame_New(tstate, co, globals, NULL); jpayne@69: if (f == NULL) { jpayne@69: return NULL; jpayne@69: } jpayne@69: fastlocals = __Pyx_PyFrame_GetLocalsplus(f); jpayne@69: for (i = 0; i < na; i++) { jpayne@69: Py_INCREF(*args); jpayne@69: fastlocals[i] = *args++; jpayne@69: } jpayne@69: result = PyEval_EvalFrameEx(f,0); jpayne@69: ++tstate->recursion_depth; jpayne@69: Py_DECREF(f); jpayne@69: --tstate->recursion_depth; jpayne@69: return result; jpayne@69: } jpayne@69: static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { jpayne@69: PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); jpayne@69: PyObject *globals = PyFunction_GET_GLOBALS(func); jpayne@69: PyObject *argdefs = PyFunction_GET_DEFAULTS(func); jpayne@69: PyObject *closure; jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: PyObject *kwdefs; jpayne@69: #endif jpayne@69: PyObject *kwtuple, **k; jpayne@69: PyObject **d; jpayne@69: Py_ssize_t nd; jpayne@69: Py_ssize_t nk; jpayne@69: PyObject *result; jpayne@69: assert(kwargs == NULL || PyDict_Check(kwargs)); jpayne@69: nk = kwargs ? PyDict_Size(kwargs) : 0; jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { jpayne@69: return NULL; jpayne@69: } jpayne@69: #else jpayne@69: if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { jpayne@69: return NULL; jpayne@69: } jpayne@69: #endif jpayne@69: if ( jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: co->co_kwonlyargcount == 0 && jpayne@69: #endif jpayne@69: likely(kwargs == NULL || nk == 0) && jpayne@69: co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { jpayne@69: if (argdefs == NULL && co->co_argcount == nargs) { jpayne@69: result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); jpayne@69: goto done; jpayne@69: } jpayne@69: else if (nargs == 0 && argdefs != NULL jpayne@69: && co->co_argcount == Py_SIZE(argdefs)) { jpayne@69: /* function called with no arguments, but all parameters have jpayne@69: a default value: use default values as arguments .*/ jpayne@69: args = &PyTuple_GET_ITEM(argdefs, 0); jpayne@69: result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); jpayne@69: goto done; jpayne@69: } jpayne@69: } jpayne@69: if (kwargs != NULL) { jpayne@69: Py_ssize_t pos, i; jpayne@69: kwtuple = PyTuple_New(2 * nk); jpayne@69: if (kwtuple == NULL) { jpayne@69: result = NULL; jpayne@69: goto done; jpayne@69: } jpayne@69: k = &PyTuple_GET_ITEM(kwtuple, 0); jpayne@69: pos = i = 0; jpayne@69: while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { jpayne@69: Py_INCREF(k[i]); jpayne@69: Py_INCREF(k[i+1]); jpayne@69: i += 2; jpayne@69: } jpayne@69: nk = i / 2; jpayne@69: } jpayne@69: else { jpayne@69: kwtuple = NULL; jpayne@69: k = NULL; jpayne@69: } jpayne@69: closure = PyFunction_GET_CLOSURE(func); jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: kwdefs = PyFunction_GET_KW_DEFAULTS(func); jpayne@69: #endif jpayne@69: if (argdefs != NULL) { jpayne@69: d = &PyTuple_GET_ITEM(argdefs, 0); jpayne@69: nd = Py_SIZE(argdefs); jpayne@69: } jpayne@69: else { jpayne@69: d = NULL; jpayne@69: nd = 0; jpayne@69: } jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, jpayne@69: args, (int)nargs, jpayne@69: k, (int)nk, jpayne@69: d, (int)nd, kwdefs, closure); jpayne@69: #else jpayne@69: result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, jpayne@69: args, (int)nargs, jpayne@69: k, (int)nk, jpayne@69: d, (int)nd, closure); jpayne@69: #endif jpayne@69: Py_XDECREF(kwtuple); jpayne@69: done: jpayne@69: Py_LeaveRecursiveCall(); jpayne@69: return result; jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: /* PyObjectCallMethO */ jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON jpayne@69: static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { jpayne@69: PyObject *self, *result; jpayne@69: PyCFunction cfunc; jpayne@69: cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); jpayne@69: self = __Pyx_CyOrPyCFunction_GET_SELF(func); jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) jpayne@69: return NULL; jpayne@69: #else jpayne@69: if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) jpayne@69: return NULL; jpayne@69: #endif jpayne@69: result = cfunc(self, arg); jpayne@69: Py_LeaveRecursiveCall(); jpayne@69: if (unlikely(!result) && unlikely(!PyErr_Occurred())) { jpayne@69: PyErr_SetString( jpayne@69: PyExc_SystemError, jpayne@69: "NULL result without error in PyObject_Call"); jpayne@69: } jpayne@69: return result; jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: /* PyObjectFastCall */ jpayne@69: #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API jpayne@69: static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { jpayne@69: PyObject *argstuple; jpayne@69: PyObject *result = 0; jpayne@69: size_t i; jpayne@69: argstuple = PyTuple_New((Py_ssize_t)nargs); jpayne@69: if (unlikely(!argstuple)) return NULL; jpayne@69: for (i = 0; i < nargs; i++) { jpayne@69: Py_INCREF(args[i]); jpayne@69: if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; jpayne@69: } jpayne@69: result = __Pyx_PyObject_Call(func, argstuple, kwargs); jpayne@69: bad: jpayne@69: Py_DECREF(argstuple); jpayne@69: return result; jpayne@69: } jpayne@69: #endif jpayne@69: static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { jpayne@69: Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON jpayne@69: if (nargs == 0 && kwargs == NULL) { jpayne@69: if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) jpayne@69: return __Pyx_PyObject_CallMethO(func, NULL); jpayne@69: } jpayne@69: else if (nargs == 1 && kwargs == NULL) { jpayne@69: if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) jpayne@69: return __Pyx_PyObject_CallMethO(func, args[0]); jpayne@69: } jpayne@69: #endif jpayne@69: #if PY_VERSION_HEX < 0x030800B1 jpayne@69: #if CYTHON_FAST_PYCCALL jpayne@69: if (PyCFunction_Check(func)) { jpayne@69: if (kwargs) { jpayne@69: return _PyCFunction_FastCallDict(func, args, nargs, kwargs); jpayne@69: } else { jpayne@69: return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); jpayne@69: } jpayne@69: } jpayne@69: #if PY_VERSION_HEX >= 0x030700A1 jpayne@69: if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { jpayne@69: return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); jpayne@69: } jpayne@69: #endif jpayne@69: #endif jpayne@69: #if CYTHON_FAST_PYCALL jpayne@69: if (PyFunction_Check(func)) { jpayne@69: return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); jpayne@69: } jpayne@69: #endif jpayne@69: #endif jpayne@69: if (kwargs == NULL) { jpayne@69: #if CYTHON_VECTORCALL jpayne@69: #if PY_VERSION_HEX < 0x03090000 jpayne@69: vectorcallfunc f = _PyVectorcall_Function(func); jpayne@69: #else jpayne@69: vectorcallfunc f = PyVectorcall_Function(func); jpayne@69: #endif jpayne@69: if (f) { jpayne@69: return f(func, args, (size_t)nargs, NULL); jpayne@69: } jpayne@69: #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL jpayne@69: if (__Pyx_CyFunction_CheckExact(func)) { jpayne@69: __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); jpayne@69: if (f) return f(func, args, (size_t)nargs, NULL); jpayne@69: } jpayne@69: #endif jpayne@69: } jpayne@69: if (nargs == 0) { jpayne@69: return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); jpayne@69: } jpayne@69: #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API jpayne@69: return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); jpayne@69: #else jpayne@69: return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); jpayne@69: #endif jpayne@69: } jpayne@69: jpayne@69: /* ArgTypeTest */ jpayne@69: static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) jpayne@69: { jpayne@69: __Pyx_TypeName type_name; jpayne@69: __Pyx_TypeName obj_type_name; jpayne@69: if (unlikely(!type)) { jpayne@69: PyErr_SetString(PyExc_SystemError, "Missing type object"); jpayne@69: return 0; jpayne@69: } jpayne@69: else if (exact) { jpayne@69: #if PY_MAJOR_VERSION == 2 jpayne@69: if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; jpayne@69: #endif jpayne@69: } jpayne@69: else { jpayne@69: if (likely(__Pyx_TypeCheck(obj, type))) return 1; jpayne@69: } jpayne@69: type_name = __Pyx_PyType_GetName(type); jpayne@69: obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); jpayne@69: PyErr_Format(PyExc_TypeError, jpayne@69: "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME jpayne@69: ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); jpayne@69: __Pyx_DECREF_TypeName(type_name); jpayne@69: __Pyx_DECREF_TypeName(obj_type_name); jpayne@69: return 0; jpayne@69: } jpayne@69: jpayne@69: /* ExtTypeTest */ jpayne@69: static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { jpayne@69: __Pyx_TypeName obj_type_name; jpayne@69: __Pyx_TypeName type_name; jpayne@69: if (unlikely(!type)) { jpayne@69: PyErr_SetString(PyExc_SystemError, "Missing type object"); jpayne@69: return 0; jpayne@69: } jpayne@69: if (likely(__Pyx_TypeCheck(obj, type))) jpayne@69: return 1; jpayne@69: obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); jpayne@69: type_name = __Pyx_PyType_GetName(type); jpayne@69: PyErr_Format(PyExc_TypeError, jpayne@69: "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME, jpayne@69: obj_type_name, type_name); jpayne@69: __Pyx_DECREF_TypeName(obj_type_name); jpayne@69: __Pyx_DECREF_TypeName(type_name); jpayne@69: return 0; jpayne@69: } jpayne@69: jpayne@69: /* PyObjectCallOneArg */ jpayne@69: static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { jpayne@69: PyObject *args[2] = {NULL, arg}; jpayne@69: return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); jpayne@69: } jpayne@69: jpayne@69: /* ObjectGetItem */ jpayne@69: #if CYTHON_USE_TYPE_SLOTS jpayne@69: static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { jpayne@69: PyObject *runerr = NULL; jpayne@69: Py_ssize_t key_value; jpayne@69: key_value = __Pyx_PyIndex_AsSsize_t(index); jpayne@69: if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { jpayne@69: return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); jpayne@69: } jpayne@69: if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { jpayne@69: __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); jpayne@69: PyErr_Clear(); jpayne@69: PyErr_Format(PyExc_IndexError, jpayne@69: "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); jpayne@69: __Pyx_DECREF_TypeName(index_type_name); jpayne@69: } jpayne@69: return NULL; jpayne@69: } jpayne@69: static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { jpayne@69: __Pyx_TypeName obj_type_name; jpayne@69: if (likely(PyType_Check(obj))) { jpayne@69: PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); jpayne@69: if (!meth) { jpayne@69: PyErr_Clear(); jpayne@69: } else { jpayne@69: PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); jpayne@69: Py_DECREF(meth); jpayne@69: return result; jpayne@69: } jpayne@69: } jpayne@69: obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); jpayne@69: PyErr_Format(PyExc_TypeError, jpayne@69: "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); jpayne@69: __Pyx_DECREF_TypeName(obj_type_name); jpayne@69: return NULL; jpayne@69: } jpayne@69: static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { jpayne@69: PyTypeObject *tp = Py_TYPE(obj); jpayne@69: PyMappingMethods *mm = tp->tp_as_mapping; jpayne@69: PySequenceMethods *sm = tp->tp_as_sequence; jpayne@69: if (likely(mm && mm->mp_subscript)) { jpayne@69: return mm->mp_subscript(obj, key); jpayne@69: } jpayne@69: if (likely(sm && sm->sq_item)) { jpayne@69: return __Pyx_PyObject_GetIndex(obj, key); jpayne@69: } jpayne@69: return __Pyx_PyObject_GetItem_Slow(obj, key); jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: /* RaiseUnexpectedTypeError */ jpayne@69: static int jpayne@69: __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) jpayne@69: { jpayne@69: __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); jpayne@69: PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME, jpayne@69: expected, obj_type_name); jpayne@69: __Pyx_DECREF_TypeName(obj_type_name); jpayne@69: return 0; jpayne@69: } jpayne@69: jpayne@69: /* PyDictVersioning */ jpayne@69: #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS jpayne@69: static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { jpayne@69: PyObject *dict = Py_TYPE(obj)->tp_dict; jpayne@69: return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; jpayne@69: } jpayne@69: static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { jpayne@69: PyObject **dictptr = NULL; jpayne@69: Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; jpayne@69: if (offset) { jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON jpayne@69: dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); jpayne@69: #else jpayne@69: dictptr = _PyObject_GetDictPtr(obj); jpayne@69: #endif jpayne@69: } jpayne@69: return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; jpayne@69: } jpayne@69: static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { jpayne@69: PyObject *dict = Py_TYPE(obj)->tp_dict; jpayne@69: if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) jpayne@69: return 0; jpayne@69: return obj_dict_version == __Pyx_get_object_dict_version(obj); jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: /* GetModuleGlobalName */ jpayne@69: #if CYTHON_USE_DICT_VERSIONS jpayne@69: static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) jpayne@69: #else jpayne@69: static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) jpayne@69: #endif jpayne@69: { jpayne@69: PyObject *result; jpayne@69: #if !CYTHON_AVOID_BORROWED_REFS jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 jpayne@69: result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); jpayne@69: __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) jpayne@69: if (likely(result)) { jpayne@69: return __Pyx_NewRef(result); jpayne@69: } else if (unlikely(PyErr_Occurred())) { jpayne@69: return NULL; jpayne@69: } jpayne@69: #elif CYTHON_COMPILING_IN_LIMITED_API jpayne@69: if (unlikely(!__pyx_m)) { jpayne@69: return NULL; jpayne@69: } jpayne@69: result = PyObject_GetAttr(__pyx_m, name); jpayne@69: if (likely(result)) { jpayne@69: return result; jpayne@69: } jpayne@69: #else jpayne@69: result = PyDict_GetItem(__pyx_d, name); jpayne@69: __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) jpayne@69: if (likely(result)) { jpayne@69: return __Pyx_NewRef(result); jpayne@69: } jpayne@69: #endif jpayne@69: #else jpayne@69: result = PyObject_GetItem(__pyx_d, name); jpayne@69: __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) jpayne@69: if (likely(result)) { jpayne@69: return __Pyx_NewRef(result); jpayne@69: } jpayne@69: PyErr_Clear(); jpayne@69: #endif jpayne@69: return __Pyx_GetBuiltinName(name); jpayne@69: } jpayne@69: jpayne@69: /* RaiseException */ jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { jpayne@69: __Pyx_PyThreadState_declare jpayne@69: CYTHON_UNUSED_VAR(cause); jpayne@69: Py_XINCREF(type); jpayne@69: if (!value || value == Py_None) jpayne@69: value = NULL; jpayne@69: else jpayne@69: Py_INCREF(value); jpayne@69: if (!tb || tb == Py_None) jpayne@69: tb = NULL; jpayne@69: else { jpayne@69: Py_INCREF(tb); jpayne@69: if (!PyTraceBack_Check(tb)) { jpayne@69: PyErr_SetString(PyExc_TypeError, jpayne@69: "raise: arg 3 must be a traceback or None"); jpayne@69: goto raise_error; jpayne@69: } jpayne@69: } jpayne@69: if (PyType_Check(type)) { jpayne@69: #if CYTHON_COMPILING_IN_PYPY jpayne@69: if (!value) { jpayne@69: Py_INCREF(Py_None); jpayne@69: value = Py_None; jpayne@69: } jpayne@69: #endif jpayne@69: PyErr_NormalizeException(&type, &value, &tb); jpayne@69: } else { jpayne@69: if (value) { jpayne@69: PyErr_SetString(PyExc_TypeError, jpayne@69: "instance exception may not have a separate value"); jpayne@69: goto raise_error; jpayne@69: } jpayne@69: value = type; jpayne@69: type = (PyObject*) Py_TYPE(type); jpayne@69: Py_INCREF(type); jpayne@69: if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { jpayne@69: PyErr_SetString(PyExc_TypeError, jpayne@69: "raise: exception class must be a subclass of BaseException"); jpayne@69: goto raise_error; jpayne@69: } jpayne@69: } jpayne@69: __Pyx_PyThreadState_assign jpayne@69: __Pyx_ErrRestore(type, value, tb); jpayne@69: return; jpayne@69: raise_error: jpayne@69: Py_XDECREF(value); jpayne@69: Py_XDECREF(type); jpayne@69: Py_XDECREF(tb); jpayne@69: return; jpayne@69: } jpayne@69: #else jpayne@69: static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { jpayne@69: PyObject* owned_instance = NULL; jpayne@69: if (tb == Py_None) { jpayne@69: tb = 0; jpayne@69: } else if (tb && !PyTraceBack_Check(tb)) { jpayne@69: PyErr_SetString(PyExc_TypeError, jpayne@69: "raise: arg 3 must be a traceback or None"); jpayne@69: goto bad; jpayne@69: } jpayne@69: if (value == Py_None) jpayne@69: value = 0; jpayne@69: if (PyExceptionInstance_Check(type)) { jpayne@69: if (value) { jpayne@69: PyErr_SetString(PyExc_TypeError, jpayne@69: "instance exception may not have a separate value"); jpayne@69: goto bad; jpayne@69: } jpayne@69: value = type; jpayne@69: type = (PyObject*) Py_TYPE(value); jpayne@69: } else if (PyExceptionClass_Check(type)) { jpayne@69: PyObject *instance_class = NULL; jpayne@69: if (value && PyExceptionInstance_Check(value)) { jpayne@69: instance_class = (PyObject*) Py_TYPE(value); jpayne@69: if (instance_class != type) { jpayne@69: int is_subclass = PyObject_IsSubclass(instance_class, type); jpayne@69: if (!is_subclass) { jpayne@69: instance_class = NULL; jpayne@69: } else if (unlikely(is_subclass == -1)) { jpayne@69: goto bad; jpayne@69: } else { jpayne@69: type = instance_class; jpayne@69: } jpayne@69: } jpayne@69: } jpayne@69: if (!instance_class) { jpayne@69: PyObject *args; jpayne@69: if (!value) jpayne@69: args = PyTuple_New(0); jpayne@69: else if (PyTuple_Check(value)) { jpayne@69: Py_INCREF(value); jpayne@69: args = value; jpayne@69: } else jpayne@69: args = PyTuple_Pack(1, value); jpayne@69: if (!args) jpayne@69: goto bad; jpayne@69: owned_instance = PyObject_Call(type, args, NULL); jpayne@69: Py_DECREF(args); jpayne@69: if (!owned_instance) jpayne@69: goto bad; jpayne@69: value = owned_instance; jpayne@69: if (!PyExceptionInstance_Check(value)) { jpayne@69: PyErr_Format(PyExc_TypeError, jpayne@69: "calling %R should have returned an instance of " jpayne@69: "BaseException, not %R", jpayne@69: type, Py_TYPE(value)); jpayne@69: goto bad; jpayne@69: } jpayne@69: } jpayne@69: } else { jpayne@69: PyErr_SetString(PyExc_TypeError, jpayne@69: "raise: exception class must be a subclass of BaseException"); jpayne@69: goto bad; jpayne@69: } jpayne@69: if (cause) { jpayne@69: PyObject *fixed_cause; jpayne@69: if (cause == Py_None) { jpayne@69: fixed_cause = NULL; jpayne@69: } else if (PyExceptionClass_Check(cause)) { jpayne@69: fixed_cause = PyObject_CallObject(cause, NULL); jpayne@69: if (fixed_cause == NULL) jpayne@69: goto bad; jpayne@69: } else if (PyExceptionInstance_Check(cause)) { jpayne@69: fixed_cause = cause; jpayne@69: Py_INCREF(fixed_cause); jpayne@69: } else { jpayne@69: PyErr_SetString(PyExc_TypeError, jpayne@69: "exception causes must derive from " jpayne@69: "BaseException"); jpayne@69: goto bad; jpayne@69: } jpayne@69: PyException_SetCause(value, fixed_cause); jpayne@69: } jpayne@69: PyErr_SetObject(type, value); jpayne@69: if (tb) { jpayne@69: #if PY_VERSION_HEX >= 0x030C00A6 jpayne@69: PyException_SetTraceback(value, tb); jpayne@69: #elif CYTHON_FAST_THREAD_STATE jpayne@69: PyThreadState *tstate = __Pyx_PyThreadState_Current; jpayne@69: PyObject* tmp_tb = tstate->curexc_traceback; jpayne@69: if (tb != tmp_tb) { jpayne@69: Py_INCREF(tb); jpayne@69: tstate->curexc_traceback = tb; jpayne@69: Py_XDECREF(tmp_tb); jpayne@69: } jpayne@69: #else jpayne@69: PyObject *tmp_type, *tmp_value, *tmp_tb; jpayne@69: PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); jpayne@69: Py_INCREF(tb); jpayne@69: PyErr_Restore(tmp_type, tmp_value, tb); jpayne@69: Py_XDECREF(tmp_tb); jpayne@69: #endif jpayne@69: } jpayne@69: bad: jpayne@69: Py_XDECREF(owned_instance); jpayne@69: return; jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: /* GetTopmostException */ jpayne@69: #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE jpayne@69: static _PyErr_StackItem * jpayne@69: __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) jpayne@69: { jpayne@69: _PyErr_StackItem *exc_info = tstate->exc_info; jpayne@69: while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && jpayne@69: exc_info->previous_item != NULL) jpayne@69: { jpayne@69: exc_info = exc_info->previous_item; jpayne@69: } jpayne@69: return exc_info; jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: /* SaveResetException */ jpayne@69: #if CYTHON_FAST_THREAD_STATE jpayne@69: static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { jpayne@69: #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 jpayne@69: _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); jpayne@69: PyObject *exc_value = exc_info->exc_value; jpayne@69: if (exc_value == NULL || exc_value == Py_None) { jpayne@69: *value = NULL; jpayne@69: *type = NULL; jpayne@69: *tb = NULL; jpayne@69: } else { jpayne@69: *value = exc_value; jpayne@69: Py_INCREF(*value); jpayne@69: *type = (PyObject*) Py_TYPE(exc_value); jpayne@69: Py_INCREF(*type); jpayne@69: *tb = PyException_GetTraceback(exc_value); jpayne@69: } jpayne@69: #elif CYTHON_USE_EXC_INFO_STACK jpayne@69: _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); jpayne@69: *type = exc_info->exc_type; jpayne@69: *value = exc_info->exc_value; jpayne@69: *tb = exc_info->exc_traceback; jpayne@69: Py_XINCREF(*type); jpayne@69: Py_XINCREF(*value); jpayne@69: Py_XINCREF(*tb); jpayne@69: #else jpayne@69: *type = tstate->exc_type; jpayne@69: *value = tstate->exc_value; jpayne@69: *tb = tstate->exc_traceback; jpayne@69: Py_XINCREF(*type); jpayne@69: Py_XINCREF(*value); jpayne@69: Py_XINCREF(*tb); jpayne@69: #endif jpayne@69: } jpayne@69: static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { jpayne@69: #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 jpayne@69: _PyErr_StackItem *exc_info = tstate->exc_info; jpayne@69: PyObject *tmp_value = exc_info->exc_value; jpayne@69: exc_info->exc_value = value; jpayne@69: Py_XDECREF(tmp_value); jpayne@69: Py_XDECREF(type); jpayne@69: Py_XDECREF(tb); jpayne@69: #else jpayne@69: PyObject *tmp_type, *tmp_value, *tmp_tb; jpayne@69: #if CYTHON_USE_EXC_INFO_STACK jpayne@69: _PyErr_StackItem *exc_info = tstate->exc_info; jpayne@69: tmp_type = exc_info->exc_type; jpayne@69: tmp_value = exc_info->exc_value; jpayne@69: tmp_tb = exc_info->exc_traceback; jpayne@69: exc_info->exc_type = type; jpayne@69: exc_info->exc_value = value; jpayne@69: exc_info->exc_traceback = tb; jpayne@69: #else jpayne@69: tmp_type = tstate->exc_type; jpayne@69: tmp_value = tstate->exc_value; jpayne@69: tmp_tb = tstate->exc_traceback; jpayne@69: tstate->exc_type = type; jpayne@69: tstate->exc_value = value; jpayne@69: tstate->exc_traceback = tb; jpayne@69: #endif jpayne@69: Py_XDECREF(tmp_type); jpayne@69: Py_XDECREF(tmp_value); jpayne@69: Py_XDECREF(tmp_tb); jpayne@69: #endif jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: /* GetException */ jpayne@69: #if CYTHON_FAST_THREAD_STATE jpayne@69: static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) jpayne@69: #else jpayne@69: static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) jpayne@69: #endif jpayne@69: { jpayne@69: PyObject *local_type = NULL, *local_value, *local_tb = NULL; jpayne@69: #if CYTHON_FAST_THREAD_STATE jpayne@69: PyObject *tmp_type, *tmp_value, *tmp_tb; jpayne@69: #if PY_VERSION_HEX >= 0x030C00A6 jpayne@69: local_value = tstate->current_exception; jpayne@69: tstate->current_exception = 0; jpayne@69: if (likely(local_value)) { jpayne@69: local_type = (PyObject*) Py_TYPE(local_value); jpayne@69: Py_INCREF(local_type); jpayne@69: local_tb = PyException_GetTraceback(local_value); jpayne@69: } jpayne@69: #else jpayne@69: local_type = tstate->curexc_type; jpayne@69: local_value = tstate->curexc_value; jpayne@69: local_tb = tstate->curexc_traceback; jpayne@69: tstate->curexc_type = 0; jpayne@69: tstate->curexc_value = 0; jpayne@69: tstate->curexc_traceback = 0; jpayne@69: #endif jpayne@69: #else jpayne@69: PyErr_Fetch(&local_type, &local_value, &local_tb); jpayne@69: #endif jpayne@69: PyErr_NormalizeException(&local_type, &local_value, &local_tb); jpayne@69: #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 jpayne@69: if (unlikely(tstate->current_exception)) jpayne@69: #elif CYTHON_FAST_THREAD_STATE jpayne@69: if (unlikely(tstate->curexc_type)) jpayne@69: #else jpayne@69: if (unlikely(PyErr_Occurred())) jpayne@69: #endif jpayne@69: goto bad; jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: if (local_tb) { jpayne@69: if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) jpayne@69: goto bad; jpayne@69: } jpayne@69: #endif jpayne@69: Py_XINCREF(local_tb); jpayne@69: Py_XINCREF(local_type); jpayne@69: Py_XINCREF(local_value); jpayne@69: *type = local_type; jpayne@69: *value = local_value; jpayne@69: *tb = local_tb; jpayne@69: #if CYTHON_FAST_THREAD_STATE jpayne@69: #if CYTHON_USE_EXC_INFO_STACK jpayne@69: { jpayne@69: _PyErr_StackItem *exc_info = tstate->exc_info; jpayne@69: #if PY_VERSION_HEX >= 0x030B00a4 jpayne@69: tmp_value = exc_info->exc_value; jpayne@69: exc_info->exc_value = local_value; jpayne@69: tmp_type = NULL; jpayne@69: tmp_tb = NULL; jpayne@69: Py_XDECREF(local_type); jpayne@69: Py_XDECREF(local_tb); jpayne@69: #else jpayne@69: tmp_type = exc_info->exc_type; jpayne@69: tmp_value = exc_info->exc_value; jpayne@69: tmp_tb = exc_info->exc_traceback; jpayne@69: exc_info->exc_type = local_type; jpayne@69: exc_info->exc_value = local_value; jpayne@69: exc_info->exc_traceback = local_tb; jpayne@69: #endif jpayne@69: } jpayne@69: #else jpayne@69: tmp_type = tstate->exc_type; jpayne@69: tmp_value = tstate->exc_value; jpayne@69: tmp_tb = tstate->exc_traceback; jpayne@69: tstate->exc_type = local_type; jpayne@69: tstate->exc_value = local_value; jpayne@69: tstate->exc_traceback = local_tb; jpayne@69: #endif jpayne@69: Py_XDECREF(tmp_type); jpayne@69: Py_XDECREF(tmp_value); jpayne@69: Py_XDECREF(tmp_tb); jpayne@69: #else jpayne@69: PyErr_SetExcInfo(local_type, local_value, local_tb); jpayne@69: #endif jpayne@69: return 0; jpayne@69: bad: jpayne@69: *type = 0; jpayne@69: *value = 0; jpayne@69: *tb = 0; jpayne@69: Py_XDECREF(local_type); jpayne@69: Py_XDECREF(local_value); jpayne@69: Py_XDECREF(local_tb); jpayne@69: return -1; jpayne@69: } jpayne@69: jpayne@69: /* RaiseTooManyValuesToUnpack */ jpayne@69: static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { jpayne@69: PyErr_Format(PyExc_ValueError, jpayne@69: "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); jpayne@69: } jpayne@69: jpayne@69: /* RaiseNeedMoreValuesToUnpack */ jpayne@69: static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { jpayne@69: PyErr_Format(PyExc_ValueError, jpayne@69: "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", jpayne@69: index, (index == 1) ? "" : "s"); jpayne@69: } jpayne@69: jpayne@69: /* IterFinish */ jpayne@69: static CYTHON_INLINE int __Pyx_IterFinish(void) { jpayne@69: PyObject* exc_type; jpayne@69: __Pyx_PyThreadState_declare jpayne@69: __Pyx_PyThreadState_assign jpayne@69: exc_type = __Pyx_PyErr_CurrentExceptionType(); jpayne@69: if (unlikely(exc_type)) { jpayne@69: if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) jpayne@69: return -1; jpayne@69: __Pyx_PyErr_Clear(); jpayne@69: return 0; jpayne@69: } jpayne@69: return 0; jpayne@69: } jpayne@69: jpayne@69: /* UnpackItemEndCheck */ jpayne@69: static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { jpayne@69: if (unlikely(retval)) { jpayne@69: Py_DECREF(retval); jpayne@69: __Pyx_RaiseTooManyValuesError(expected); jpayne@69: return -1; jpayne@69: } jpayne@69: return __Pyx_IterFinish(); jpayne@69: } jpayne@69: jpayne@69: /* PyIntBinop */ jpayne@69: #if !CYTHON_COMPILING_IN_PYPY jpayne@69: static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { jpayne@69: CYTHON_MAYBE_UNUSED_VAR(intval); jpayne@69: CYTHON_MAYBE_UNUSED_VAR(inplace); jpayne@69: CYTHON_UNUSED_VAR(zerodivision_check); jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: if (likely(PyInt_CheckExact(op1))) { jpayne@69: const long b = intval; jpayne@69: long x; jpayne@69: long a = PyInt_AS_LONG(op1); jpayne@69: jpayne@69: x = (long)((unsigned long)a - (unsigned long)b); jpayne@69: if (likely((x^a) >= 0 || (x^~b) >= 0)) jpayne@69: return PyInt_FromLong(x); jpayne@69: return PyLong_Type.tp_as_number->nb_subtract(op1, op2); jpayne@69: } jpayne@69: #endif jpayne@69: #if CYTHON_USE_PYLONG_INTERNALS jpayne@69: if (likely(PyLong_CheckExact(op1))) { jpayne@69: const long b = intval; jpayne@69: long a, x; jpayne@69: #ifdef HAVE_LONG_LONG jpayne@69: const PY_LONG_LONG llb = intval; jpayne@69: PY_LONG_LONG lla, llx; jpayne@69: #endif jpayne@69: if (unlikely(__Pyx_PyLong_IsZero(op1))) { jpayne@69: return PyLong_FromLong(-intval); jpayne@69: } jpayne@69: if (likely(__Pyx_PyLong_IsCompact(op1))) { jpayne@69: a = __Pyx_PyLong_CompactValue(op1); jpayne@69: } else { jpayne@69: const digit* digits = __Pyx_PyLong_Digits(op1); jpayne@69: const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); jpayne@69: switch (size) { jpayne@69: case -2: jpayne@69: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { jpayne@69: a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); jpayne@69: break; jpayne@69: #ifdef HAVE_LONG_LONG jpayne@69: } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { jpayne@69: lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); jpayne@69: goto long_long; jpayne@69: #endif jpayne@69: } jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 2: jpayne@69: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { jpayne@69: a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); jpayne@69: break; jpayne@69: #ifdef HAVE_LONG_LONG jpayne@69: } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { jpayne@69: lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); jpayne@69: goto long_long; jpayne@69: #endif jpayne@69: } jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case -3: jpayne@69: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { jpayne@69: a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); jpayne@69: break; jpayne@69: #ifdef HAVE_LONG_LONG jpayne@69: } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { jpayne@69: 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])); jpayne@69: goto long_long; jpayne@69: #endif jpayne@69: } jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 3: jpayne@69: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { jpayne@69: a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); jpayne@69: break; jpayne@69: #ifdef HAVE_LONG_LONG jpayne@69: } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { jpayne@69: 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])); jpayne@69: goto long_long; jpayne@69: #endif jpayne@69: } jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case -4: jpayne@69: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { jpayne@69: a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); jpayne@69: break; jpayne@69: #ifdef HAVE_LONG_LONG jpayne@69: } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { jpayne@69: 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])); jpayne@69: goto long_long; jpayne@69: #endif jpayne@69: } jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: case 4: jpayne@69: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { jpayne@69: a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); jpayne@69: break; jpayne@69: #ifdef HAVE_LONG_LONG jpayne@69: } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { jpayne@69: 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])); jpayne@69: goto long_long; jpayne@69: #endif jpayne@69: } jpayne@69: CYTHON_FALLTHROUGH; jpayne@69: default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2); jpayne@69: } jpayne@69: } jpayne@69: x = a - b; jpayne@69: return PyLong_FromLong(x); jpayne@69: #ifdef HAVE_LONG_LONG jpayne@69: long_long: jpayne@69: llx = lla - llb; jpayne@69: return PyLong_FromLongLong(llx); jpayne@69: #endif jpayne@69: jpayne@69: jpayne@69: } jpayne@69: #endif jpayne@69: if (PyFloat_CheckExact(op1)) { jpayne@69: const long b = intval; jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: double a = __pyx_PyFloat_AsDouble(op1); jpayne@69: #else jpayne@69: double a = PyFloat_AS_DOUBLE(op1); jpayne@69: #endif jpayne@69: double result; jpayne@69: jpayne@69: PyFPE_START_PROTECT("subtract", return NULL) jpayne@69: result = ((double)a) - (double)b; jpayne@69: PyFPE_END_PROTECT(result) jpayne@69: return PyFloat_FromDouble(result); jpayne@69: } jpayne@69: return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2); jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: /* PyObjectLookupSpecial */ jpayne@69: #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS jpayne@69: static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { jpayne@69: PyObject *res; jpayne@69: PyTypeObject *tp = Py_TYPE(obj); jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: if (unlikely(PyInstance_Check(obj))) jpayne@69: return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); jpayne@69: #endif jpayne@69: res = _PyType_Lookup(tp, attr_name); jpayne@69: if (likely(res)) { jpayne@69: descrgetfunc f = Py_TYPE(res)->tp_descr_get; jpayne@69: if (!f) { jpayne@69: Py_INCREF(res); jpayne@69: } else { jpayne@69: res = f(res, obj, (PyObject *)tp); jpayne@69: } jpayne@69: } else if (with_error) { jpayne@69: PyErr_SetObject(PyExc_AttributeError, attr_name); jpayne@69: } jpayne@69: return res; jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: /* SwapException */ jpayne@69: #if CYTHON_FAST_THREAD_STATE jpayne@69: static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { jpayne@69: PyObject *tmp_type, *tmp_value, *tmp_tb; jpayne@69: #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 jpayne@69: _PyErr_StackItem *exc_info = tstate->exc_info; jpayne@69: tmp_value = exc_info->exc_value; jpayne@69: exc_info->exc_value = *value; jpayne@69: if (tmp_value == NULL || tmp_value == Py_None) { jpayne@69: Py_XDECREF(tmp_value); jpayne@69: tmp_value = NULL; jpayne@69: tmp_type = NULL; jpayne@69: tmp_tb = NULL; jpayne@69: } else { jpayne@69: tmp_type = (PyObject*) Py_TYPE(tmp_value); jpayne@69: Py_INCREF(tmp_type); jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON jpayne@69: tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; jpayne@69: Py_XINCREF(tmp_tb); jpayne@69: #else jpayne@69: tmp_tb = PyException_GetTraceback(tmp_value); jpayne@69: #endif jpayne@69: } jpayne@69: #elif CYTHON_USE_EXC_INFO_STACK jpayne@69: _PyErr_StackItem *exc_info = tstate->exc_info; jpayne@69: tmp_type = exc_info->exc_type; jpayne@69: tmp_value = exc_info->exc_value; jpayne@69: tmp_tb = exc_info->exc_traceback; jpayne@69: exc_info->exc_type = *type; jpayne@69: exc_info->exc_value = *value; jpayne@69: exc_info->exc_traceback = *tb; jpayne@69: #else jpayne@69: tmp_type = tstate->exc_type; jpayne@69: tmp_value = tstate->exc_value; jpayne@69: tmp_tb = tstate->exc_traceback; jpayne@69: tstate->exc_type = *type; jpayne@69: tstate->exc_value = *value; jpayne@69: tstate->exc_traceback = *tb; jpayne@69: #endif jpayne@69: *type = tmp_type; jpayne@69: *value = tmp_value; jpayne@69: *tb = tmp_tb; jpayne@69: } jpayne@69: #else jpayne@69: static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { jpayne@69: PyObject *tmp_type, *tmp_value, *tmp_tb; jpayne@69: PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); jpayne@69: PyErr_SetExcInfo(*type, *value, *tb); jpayne@69: *type = tmp_type; jpayne@69: *value = tmp_value; jpayne@69: *tb = tmp_tb; jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: /* PyIntCompare */ jpayne@69: static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { jpayne@69: CYTHON_MAYBE_UNUSED_VAR(intval); jpayne@69: CYTHON_UNUSED_VAR(inplace); jpayne@69: if (op1 == op2) { jpayne@69: return 1; jpayne@69: } jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: if (likely(PyInt_CheckExact(op1))) { jpayne@69: const long b = intval; jpayne@69: long a = PyInt_AS_LONG(op1); jpayne@69: return (a == b); jpayne@69: } jpayne@69: #endif jpayne@69: #if CYTHON_USE_PYLONG_INTERNALS jpayne@69: if (likely(PyLong_CheckExact(op1))) { jpayne@69: int unequal; jpayne@69: unsigned long uintval; jpayne@69: Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); jpayne@69: const digit* digits = __Pyx_PyLong_Digits(op1); jpayne@69: if (intval == 0) { jpayne@69: return (__Pyx_PyLong_IsZero(op1) == 1); jpayne@69: } else if (intval < 0) { jpayne@69: if (__Pyx_PyLong_IsNonNeg(op1)) jpayne@69: return 0; jpayne@69: intval = -intval; jpayne@69: } else { jpayne@69: if (__Pyx_PyLong_IsNeg(op1)) jpayne@69: return 0; jpayne@69: } jpayne@69: uintval = (unsigned long) intval; jpayne@69: #if PyLong_SHIFT * 4 < SIZEOF_LONG*8 jpayne@69: if (uintval >> (PyLong_SHIFT * 4)) { jpayne@69: unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) jpayne@69: | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); jpayne@69: } else jpayne@69: #endif jpayne@69: #if PyLong_SHIFT * 3 < SIZEOF_LONG*8 jpayne@69: if (uintval >> (PyLong_SHIFT * 3)) { jpayne@69: unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) jpayne@69: | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); jpayne@69: } else jpayne@69: #endif jpayne@69: #if PyLong_SHIFT * 2 < SIZEOF_LONG*8 jpayne@69: if (uintval >> (PyLong_SHIFT * 2)) { jpayne@69: unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) jpayne@69: | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); jpayne@69: } else jpayne@69: #endif jpayne@69: #if PyLong_SHIFT * 1 < SIZEOF_LONG*8 jpayne@69: if (uintval >> (PyLong_SHIFT * 1)) { jpayne@69: unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) jpayne@69: | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); jpayne@69: } else jpayne@69: #endif jpayne@69: unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); jpayne@69: return (unequal == 0); jpayne@69: } jpayne@69: #endif jpayne@69: if (PyFloat_CheckExact(op1)) { jpayne@69: const long b = intval; jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: double a = __pyx_PyFloat_AsDouble(op1); jpayne@69: #else jpayne@69: double a = PyFloat_AS_DOUBLE(op1); jpayne@69: #endif jpayne@69: return ((double)a == (double)b); jpayne@69: } jpayne@69: return __Pyx_PyObject_IsTrueAndDecref( jpayne@69: PyObject_RichCompare(op1, op2, Py_EQ)); jpayne@69: } jpayne@69: jpayne@69: /* DictGetItem */ jpayne@69: #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY jpayne@69: static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { jpayne@69: PyObject *value; jpayne@69: value = PyDict_GetItemWithError(d, key); jpayne@69: if (unlikely(!value)) { jpayne@69: if (!PyErr_Occurred()) { jpayne@69: if (unlikely(PyTuple_Check(key))) { jpayne@69: PyObject* args = PyTuple_Pack(1, key); jpayne@69: if (likely(args)) { jpayne@69: PyErr_SetObject(PyExc_KeyError, args); jpayne@69: Py_DECREF(args); jpayne@69: } jpayne@69: } else { jpayne@69: PyErr_SetObject(PyExc_KeyError, key); jpayne@69: } jpayne@69: } jpayne@69: return NULL; jpayne@69: } jpayne@69: Py_INCREF(value); jpayne@69: return value; jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: /* FixUpExtensionType */ jpayne@69: #if CYTHON_USE_TYPE_SPECS jpayne@69: static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { jpayne@69: #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API jpayne@69: CYTHON_UNUSED_VAR(spec); jpayne@69: CYTHON_UNUSED_VAR(type); jpayne@69: #else jpayne@69: const PyType_Slot *slot = spec->slots; jpayne@69: while (slot && slot->slot && slot->slot != Py_tp_members) jpayne@69: slot++; jpayne@69: if (slot && slot->slot == Py_tp_members) { jpayne@69: int changed = 0; jpayne@69: #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) jpayne@69: const jpayne@69: #endif jpayne@69: PyMemberDef *memb = (PyMemberDef*) slot->pfunc; jpayne@69: while (memb && memb->name) { jpayne@69: if (memb->name[0] == '_' && memb->name[1] == '_') { jpayne@69: #if PY_VERSION_HEX < 0x030900b1 jpayne@69: if (strcmp(memb->name, "__weaklistoffset__") == 0) { jpayne@69: assert(memb->type == T_PYSSIZET); jpayne@69: assert(memb->flags == READONLY); jpayne@69: type->tp_weaklistoffset = memb->offset; jpayne@69: changed = 1; jpayne@69: } jpayne@69: else if (strcmp(memb->name, "__dictoffset__") == 0) { jpayne@69: assert(memb->type == T_PYSSIZET); jpayne@69: assert(memb->flags == READONLY); jpayne@69: type->tp_dictoffset = memb->offset; jpayne@69: changed = 1; jpayne@69: } jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { jpayne@69: assert(memb->type == T_PYSSIZET); jpayne@69: assert(memb->flags == READONLY); jpayne@69: #if PY_VERSION_HEX >= 0x030800b4 jpayne@69: type->tp_vectorcall_offset = memb->offset; jpayne@69: #else jpayne@69: type->tp_print = (printfunc) memb->offset; jpayne@69: #endif jpayne@69: changed = 1; jpayne@69: } jpayne@69: #endif jpayne@69: #else jpayne@69: if ((0)); jpayne@69: #endif jpayne@69: #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON jpayne@69: else if (strcmp(memb->name, "__module__") == 0) { jpayne@69: PyObject *descr; jpayne@69: assert(memb->type == T_OBJECT); jpayne@69: assert(memb->flags == 0 || memb->flags == READONLY); jpayne@69: descr = PyDescr_NewMember(type, memb); jpayne@69: if (unlikely(!descr)) jpayne@69: return -1; jpayne@69: if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { jpayne@69: Py_DECREF(descr); jpayne@69: return -1; jpayne@69: } jpayne@69: Py_DECREF(descr); jpayne@69: changed = 1; jpayne@69: } jpayne@69: #endif jpayne@69: } jpayne@69: memb++; jpayne@69: } jpayne@69: if (changed) jpayne@69: PyType_Modified(type); jpayne@69: } jpayne@69: #endif jpayne@69: return 0; jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: /* FetchSharedCythonModule */ jpayne@69: static PyObject *__Pyx_FetchSharedCythonABIModule(void) { jpayne@69: return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); jpayne@69: } jpayne@69: jpayne@69: /* FetchCommonType */ jpayne@69: static int __Pyx_VerifyCachedType(PyObject *cached_type, jpayne@69: const char *name, jpayne@69: Py_ssize_t basicsize, jpayne@69: Py_ssize_t expected_basicsize) { jpayne@69: if (!PyType_Check(cached_type)) { jpayne@69: PyErr_Format(PyExc_TypeError, jpayne@69: "Shared Cython type %.200s is not a type object", name); jpayne@69: return -1; jpayne@69: } jpayne@69: if (basicsize != expected_basicsize) { jpayne@69: PyErr_Format(PyExc_TypeError, jpayne@69: "Shared Cython type %.200s has the wrong size, try recompiling", jpayne@69: name); jpayne@69: return -1; jpayne@69: } jpayne@69: return 0; jpayne@69: } jpayne@69: #if !CYTHON_USE_TYPE_SPECS jpayne@69: static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { jpayne@69: PyObject* abi_module; jpayne@69: const char* object_name; jpayne@69: PyTypeObject *cached_type = NULL; jpayne@69: abi_module = __Pyx_FetchSharedCythonABIModule(); jpayne@69: if (!abi_module) return NULL; jpayne@69: object_name = strrchr(type->tp_name, '.'); jpayne@69: object_name = object_name ? object_name+1 : type->tp_name; jpayne@69: cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); jpayne@69: if (cached_type) { jpayne@69: if (__Pyx_VerifyCachedType( jpayne@69: (PyObject *)cached_type, jpayne@69: object_name, jpayne@69: cached_type->tp_basicsize, jpayne@69: type->tp_basicsize) < 0) { jpayne@69: goto bad; jpayne@69: } jpayne@69: goto done; jpayne@69: } jpayne@69: if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; jpayne@69: PyErr_Clear(); jpayne@69: if (PyType_Ready(type) < 0) goto bad; jpayne@69: if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) jpayne@69: goto bad; jpayne@69: Py_INCREF(type); jpayne@69: cached_type = type; jpayne@69: done: jpayne@69: Py_DECREF(abi_module); jpayne@69: return cached_type; jpayne@69: bad: jpayne@69: Py_XDECREF(cached_type); jpayne@69: cached_type = NULL; jpayne@69: goto done; jpayne@69: } jpayne@69: #else jpayne@69: static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { jpayne@69: PyObject *abi_module, *cached_type = NULL; jpayne@69: const char* object_name = strrchr(spec->name, '.'); jpayne@69: object_name = object_name ? object_name+1 : spec->name; jpayne@69: abi_module = __Pyx_FetchSharedCythonABIModule(); jpayne@69: if (!abi_module) return NULL; jpayne@69: cached_type = PyObject_GetAttrString(abi_module, object_name); jpayne@69: if (cached_type) { jpayne@69: Py_ssize_t basicsize; jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: PyObject *py_basicsize; jpayne@69: py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); jpayne@69: if (unlikely(!py_basicsize)) goto bad; jpayne@69: basicsize = PyLong_AsSsize_t(py_basicsize); jpayne@69: Py_DECREF(py_basicsize); jpayne@69: py_basicsize = 0; jpayne@69: if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; jpayne@69: #else jpayne@69: basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; jpayne@69: #endif jpayne@69: if (__Pyx_VerifyCachedType( jpayne@69: cached_type, jpayne@69: object_name, jpayne@69: basicsize, jpayne@69: spec->basicsize) < 0) { jpayne@69: goto bad; jpayne@69: } jpayne@69: goto done; jpayne@69: } jpayne@69: if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; jpayne@69: PyErr_Clear(); jpayne@69: CYTHON_UNUSED_VAR(module); jpayne@69: cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); jpayne@69: if (unlikely(!cached_type)) goto bad; jpayne@69: if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; jpayne@69: if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; jpayne@69: done: jpayne@69: Py_DECREF(abi_module); jpayne@69: assert(cached_type == NULL || PyType_Check(cached_type)); jpayne@69: return (PyTypeObject *) cached_type; jpayne@69: bad: jpayne@69: Py_XDECREF(cached_type); jpayne@69: cached_type = NULL; jpayne@69: goto done; jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: /* PyVectorcallFastCallDict */ jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) jpayne@69: { jpayne@69: PyObject *res = NULL; jpayne@69: PyObject *kwnames; jpayne@69: PyObject **newargs; jpayne@69: PyObject **kwvalues; jpayne@69: Py_ssize_t i, pos; jpayne@69: size_t j; jpayne@69: PyObject *key, *value; jpayne@69: unsigned long keys_are_strings; jpayne@69: Py_ssize_t nkw = PyDict_GET_SIZE(kw); jpayne@69: newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); jpayne@69: if (unlikely(newargs == NULL)) { jpayne@69: PyErr_NoMemory(); jpayne@69: return NULL; jpayne@69: } jpayne@69: for (j = 0; j < nargs; j++) newargs[j] = args[j]; jpayne@69: kwnames = PyTuple_New(nkw); jpayne@69: if (unlikely(kwnames == NULL)) { jpayne@69: PyMem_Free(newargs); jpayne@69: return NULL; jpayne@69: } jpayne@69: kwvalues = newargs + nargs; jpayne@69: pos = i = 0; jpayne@69: keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; jpayne@69: while (PyDict_Next(kw, &pos, &key, &value)) { jpayne@69: keys_are_strings &= Py_TYPE(key)->tp_flags; jpayne@69: Py_INCREF(key); jpayne@69: Py_INCREF(value); jpayne@69: PyTuple_SET_ITEM(kwnames, i, key); jpayne@69: kwvalues[i] = value; jpayne@69: i++; jpayne@69: } jpayne@69: if (unlikely(!keys_are_strings)) { jpayne@69: PyErr_SetString(PyExc_TypeError, "keywords must be strings"); jpayne@69: goto cleanup; jpayne@69: } jpayne@69: res = vc(func, newargs, nargs, kwnames); jpayne@69: cleanup: jpayne@69: Py_DECREF(kwnames); jpayne@69: for (i = 0; i < nkw; i++) jpayne@69: Py_DECREF(kwvalues[i]); jpayne@69: PyMem_Free(newargs); jpayne@69: return res; jpayne@69: } jpayne@69: static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) jpayne@69: { jpayne@69: if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { jpayne@69: return vc(func, args, nargs, NULL); jpayne@69: } jpayne@69: return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: /* CythonFunctionShared */ jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { jpayne@69: if (__Pyx_CyFunction_Check(func)) { jpayne@69: return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; jpayne@69: } else if (PyCFunction_Check(func)) { jpayne@69: return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; jpayne@69: } jpayne@69: return 0; jpayne@69: } jpayne@69: #else jpayne@69: static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { jpayne@69: return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; jpayne@69: } jpayne@69: #endif jpayne@69: static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { jpayne@69: #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API jpayne@69: __Pyx_Py_XDECREF_SET( jpayne@69: __Pyx_CyFunction_GetClassObj(f), jpayne@69: ((classobj) ? __Pyx_NewRef(classobj) : NULL)); jpayne@69: #else jpayne@69: __Pyx_Py_XDECREF_SET( jpayne@69: ((PyCMethodObject *) (f))->mm_class, jpayne@69: (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); jpayne@69: #endif jpayne@69: } jpayne@69: static PyObject * jpayne@69: __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) jpayne@69: { jpayne@69: CYTHON_UNUSED_VAR(closure); jpayne@69: if (unlikely(op->func_doc == NULL)) { jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); jpayne@69: if (unlikely(!op->func_doc)) return NULL; jpayne@69: #else jpayne@69: if (((PyCFunctionObject*)op)->m_ml->ml_doc) { jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); jpayne@69: #else jpayne@69: op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); jpayne@69: #endif jpayne@69: if (unlikely(op->func_doc == NULL)) jpayne@69: return NULL; jpayne@69: } else { jpayne@69: Py_INCREF(Py_None); jpayne@69: return Py_None; jpayne@69: } jpayne@69: #endif jpayne@69: } jpayne@69: Py_INCREF(op->func_doc); jpayne@69: return op->func_doc; jpayne@69: } jpayne@69: static int jpayne@69: __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) jpayne@69: { jpayne@69: CYTHON_UNUSED_VAR(context); jpayne@69: if (value == NULL) { jpayne@69: value = Py_None; jpayne@69: } jpayne@69: Py_INCREF(value); jpayne@69: __Pyx_Py_XDECREF_SET(op->func_doc, value); jpayne@69: return 0; jpayne@69: } jpayne@69: static PyObject * jpayne@69: __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) jpayne@69: { jpayne@69: CYTHON_UNUSED_VAR(context); jpayne@69: if (unlikely(op->func_name == NULL)) { jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: op->func_name = PyObject_GetAttrString(op->func, "__name__"); jpayne@69: #elif PY_MAJOR_VERSION >= 3 jpayne@69: op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); jpayne@69: #else jpayne@69: op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); jpayne@69: #endif jpayne@69: if (unlikely(op->func_name == NULL)) jpayne@69: return NULL; jpayne@69: } jpayne@69: Py_INCREF(op->func_name); jpayne@69: return op->func_name; jpayne@69: } jpayne@69: static int jpayne@69: __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) jpayne@69: { jpayne@69: CYTHON_UNUSED_VAR(context); jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: if (unlikely(value == NULL || !PyUnicode_Check(value))) jpayne@69: #else jpayne@69: if (unlikely(value == NULL || !PyString_Check(value))) jpayne@69: #endif jpayne@69: { jpayne@69: PyErr_SetString(PyExc_TypeError, jpayne@69: "__name__ must be set to a string object"); jpayne@69: return -1; jpayne@69: } jpayne@69: Py_INCREF(value); jpayne@69: __Pyx_Py_XDECREF_SET(op->func_name, value); jpayne@69: return 0; jpayne@69: } jpayne@69: static PyObject * jpayne@69: __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) jpayne@69: { jpayne@69: CYTHON_UNUSED_VAR(context); jpayne@69: Py_INCREF(op->func_qualname); jpayne@69: return op->func_qualname; jpayne@69: } jpayne@69: static int jpayne@69: __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) jpayne@69: { jpayne@69: CYTHON_UNUSED_VAR(context); jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: if (unlikely(value == NULL || !PyUnicode_Check(value))) jpayne@69: #else jpayne@69: if (unlikely(value == NULL || !PyString_Check(value))) jpayne@69: #endif jpayne@69: { jpayne@69: PyErr_SetString(PyExc_TypeError, jpayne@69: "__qualname__ must be set to a string object"); jpayne@69: return -1; jpayne@69: } jpayne@69: Py_INCREF(value); jpayne@69: __Pyx_Py_XDECREF_SET(op->func_qualname, value); jpayne@69: return 0; jpayne@69: } jpayne@69: static PyObject * jpayne@69: __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) jpayne@69: { jpayne@69: CYTHON_UNUSED_VAR(context); jpayne@69: if (unlikely(op->func_dict == NULL)) { jpayne@69: op->func_dict = PyDict_New(); jpayne@69: if (unlikely(op->func_dict == NULL)) jpayne@69: return NULL; jpayne@69: } jpayne@69: Py_INCREF(op->func_dict); jpayne@69: return op->func_dict; jpayne@69: } jpayne@69: static int jpayne@69: __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) jpayne@69: { jpayne@69: CYTHON_UNUSED_VAR(context); jpayne@69: if (unlikely(value == NULL)) { jpayne@69: PyErr_SetString(PyExc_TypeError, jpayne@69: "function's dictionary may not be deleted"); jpayne@69: return -1; jpayne@69: } jpayne@69: if (unlikely(!PyDict_Check(value))) { jpayne@69: PyErr_SetString(PyExc_TypeError, jpayne@69: "setting function's dictionary to a non-dict"); jpayne@69: return -1; jpayne@69: } jpayne@69: Py_INCREF(value); jpayne@69: __Pyx_Py_XDECREF_SET(op->func_dict, value); jpayne@69: return 0; jpayne@69: } jpayne@69: static PyObject * jpayne@69: __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) jpayne@69: { jpayne@69: CYTHON_UNUSED_VAR(context); jpayne@69: Py_INCREF(op->func_globals); jpayne@69: return op->func_globals; jpayne@69: } jpayne@69: static PyObject * jpayne@69: __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) jpayne@69: { jpayne@69: CYTHON_UNUSED_VAR(op); jpayne@69: CYTHON_UNUSED_VAR(context); jpayne@69: Py_INCREF(Py_None); jpayne@69: return Py_None; jpayne@69: } jpayne@69: static PyObject * jpayne@69: __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) jpayne@69: { jpayne@69: PyObject* result = (op->func_code) ? op->func_code : Py_None; jpayne@69: CYTHON_UNUSED_VAR(context); jpayne@69: Py_INCREF(result); jpayne@69: return result; jpayne@69: } jpayne@69: static int jpayne@69: __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { jpayne@69: int result = 0; jpayne@69: PyObject *res = op->defaults_getter((PyObject *) op); jpayne@69: if (unlikely(!res)) jpayne@69: return -1; jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS jpayne@69: op->defaults_tuple = PyTuple_GET_ITEM(res, 0); jpayne@69: Py_INCREF(op->defaults_tuple); jpayne@69: op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); jpayne@69: Py_INCREF(op->defaults_kwdict); jpayne@69: #else jpayne@69: op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); jpayne@69: if (unlikely(!op->defaults_tuple)) result = -1; jpayne@69: else { jpayne@69: op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); jpayne@69: if (unlikely(!op->defaults_kwdict)) result = -1; jpayne@69: } jpayne@69: #endif jpayne@69: Py_DECREF(res); jpayne@69: return result; jpayne@69: } jpayne@69: static int jpayne@69: __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { jpayne@69: CYTHON_UNUSED_VAR(context); jpayne@69: if (!value) { jpayne@69: value = Py_None; jpayne@69: } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { jpayne@69: PyErr_SetString(PyExc_TypeError, jpayne@69: "__defaults__ must be set to a tuple object"); jpayne@69: return -1; jpayne@69: } jpayne@69: PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " jpayne@69: "currently affect the values used in function calls", 1); jpayne@69: Py_INCREF(value); jpayne@69: __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); jpayne@69: return 0; jpayne@69: } jpayne@69: static PyObject * jpayne@69: __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { jpayne@69: PyObject* result = op->defaults_tuple; jpayne@69: CYTHON_UNUSED_VAR(context); jpayne@69: if (unlikely(!result)) { jpayne@69: if (op->defaults_getter) { jpayne@69: if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; jpayne@69: result = op->defaults_tuple; jpayne@69: } else { jpayne@69: result = Py_None; jpayne@69: } jpayne@69: } jpayne@69: Py_INCREF(result); jpayne@69: return result; jpayne@69: } jpayne@69: static int jpayne@69: __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { jpayne@69: CYTHON_UNUSED_VAR(context); jpayne@69: if (!value) { jpayne@69: value = Py_None; jpayne@69: } else if (unlikely(value != Py_None && !PyDict_Check(value))) { jpayne@69: PyErr_SetString(PyExc_TypeError, jpayne@69: "__kwdefaults__ must be set to a dict object"); jpayne@69: return -1; jpayne@69: } jpayne@69: PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " jpayne@69: "currently affect the values used in function calls", 1); jpayne@69: Py_INCREF(value); jpayne@69: __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); jpayne@69: return 0; jpayne@69: } jpayne@69: static PyObject * jpayne@69: __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { jpayne@69: PyObject* result = op->defaults_kwdict; jpayne@69: CYTHON_UNUSED_VAR(context); jpayne@69: if (unlikely(!result)) { jpayne@69: if (op->defaults_getter) { jpayne@69: if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; jpayne@69: result = op->defaults_kwdict; jpayne@69: } else { jpayne@69: result = Py_None; jpayne@69: } jpayne@69: } jpayne@69: Py_INCREF(result); jpayne@69: return result; jpayne@69: } jpayne@69: static int jpayne@69: __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { jpayne@69: CYTHON_UNUSED_VAR(context); jpayne@69: if (!value || value == Py_None) { jpayne@69: value = NULL; jpayne@69: } else if (unlikely(!PyDict_Check(value))) { jpayne@69: PyErr_SetString(PyExc_TypeError, jpayne@69: "__annotations__ must be set to a dict object"); jpayne@69: return -1; jpayne@69: } jpayne@69: Py_XINCREF(value); jpayne@69: __Pyx_Py_XDECREF_SET(op->func_annotations, value); jpayne@69: return 0; jpayne@69: } jpayne@69: static PyObject * jpayne@69: __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { jpayne@69: PyObject* result = op->func_annotations; jpayne@69: CYTHON_UNUSED_VAR(context); jpayne@69: if (unlikely(!result)) { jpayne@69: result = PyDict_New(); jpayne@69: if (unlikely(!result)) return NULL; jpayne@69: op->func_annotations = result; jpayne@69: } jpayne@69: Py_INCREF(result); jpayne@69: return result; jpayne@69: } jpayne@69: static PyObject * jpayne@69: __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { jpayne@69: int is_coroutine; jpayne@69: CYTHON_UNUSED_VAR(context); jpayne@69: if (op->func_is_coroutine) { jpayne@69: return __Pyx_NewRef(op->func_is_coroutine); jpayne@69: } jpayne@69: is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; jpayne@69: #if PY_VERSION_HEX >= 0x03050000 jpayne@69: if (is_coroutine) { jpayne@69: PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; jpayne@69: fromlist = PyList_New(1); jpayne@69: if (unlikely(!fromlist)) return NULL; jpayne@69: Py_INCREF(marker); jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS jpayne@69: PyList_SET_ITEM(fromlist, 0, marker); jpayne@69: #else jpayne@69: if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { jpayne@69: Py_DECREF(marker); jpayne@69: Py_DECREF(fromlist); jpayne@69: return NULL; jpayne@69: } jpayne@69: #endif jpayne@69: module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); jpayne@69: Py_DECREF(fromlist); jpayne@69: if (unlikely(!module)) goto ignore; jpayne@69: op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); jpayne@69: Py_DECREF(module); jpayne@69: if (likely(op->func_is_coroutine)) { jpayne@69: return __Pyx_NewRef(op->func_is_coroutine); jpayne@69: } jpayne@69: ignore: jpayne@69: PyErr_Clear(); jpayne@69: } jpayne@69: #endif jpayne@69: op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); jpayne@69: return __Pyx_NewRef(op->func_is_coroutine); jpayne@69: } jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: static PyObject * jpayne@69: __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { jpayne@69: CYTHON_UNUSED_VAR(context); jpayne@69: return PyObject_GetAttrString(op->func, "__module__"); jpayne@69: } jpayne@69: static int jpayne@69: __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { jpayne@69: CYTHON_UNUSED_VAR(context); jpayne@69: return PyObject_SetAttrString(op->func, "__module__", value); jpayne@69: } jpayne@69: #endif jpayne@69: static PyGetSetDef __pyx_CyFunction_getsets[] = { jpayne@69: {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, jpayne@69: {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, jpayne@69: {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, jpayne@69: {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, jpayne@69: {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, jpayne@69: {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, jpayne@69: {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, jpayne@69: {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, jpayne@69: {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, jpayne@69: {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, jpayne@69: {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, jpayne@69: {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, jpayne@69: {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, jpayne@69: {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, jpayne@69: {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, jpayne@69: {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, jpayne@69: {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, jpayne@69: {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, jpayne@69: #endif jpayne@69: {0, 0, 0, 0, 0} jpayne@69: }; jpayne@69: static PyMemberDef __pyx_CyFunction_members[] = { jpayne@69: #if !CYTHON_COMPILING_IN_LIMITED_API jpayne@69: {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, jpayne@69: #endif jpayne@69: #if CYTHON_USE_TYPE_SPECS jpayne@69: {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: #if CYTHON_BACKPORT_VECTORCALL jpayne@69: {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, jpayne@69: #else jpayne@69: #if !CYTHON_COMPILING_IN_LIMITED_API jpayne@69: {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, jpayne@69: #endif jpayne@69: #endif jpayne@69: #endif jpayne@69: #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API jpayne@69: {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, jpayne@69: #else jpayne@69: {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, jpayne@69: #endif jpayne@69: #endif jpayne@69: {0, 0, 0, 0, 0} jpayne@69: }; jpayne@69: static PyObject * jpayne@69: __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) jpayne@69: { jpayne@69: CYTHON_UNUSED_VAR(args); jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: Py_INCREF(m->func_qualname); jpayne@69: return m->func_qualname; jpayne@69: #else jpayne@69: return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); jpayne@69: #endif jpayne@69: } jpayne@69: static PyMethodDef __pyx_CyFunction_methods[] = { jpayne@69: {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, jpayne@69: {0, 0, 0, 0} jpayne@69: }; jpayne@69: #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API jpayne@69: #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) jpayne@69: #else jpayne@69: #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) jpayne@69: #endif jpayne@69: static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, jpayne@69: PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { jpayne@69: #if !CYTHON_COMPILING_IN_LIMITED_API jpayne@69: PyCFunctionObject *cf = (PyCFunctionObject*) op; jpayne@69: #endif jpayne@69: if (unlikely(op == NULL)) jpayne@69: return NULL; jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); jpayne@69: if (unlikely(!op->func)) return NULL; jpayne@69: #endif jpayne@69: op->flags = flags; jpayne@69: __Pyx_CyFunction_weakreflist(op) = NULL; jpayne@69: #if !CYTHON_COMPILING_IN_LIMITED_API jpayne@69: cf->m_ml = ml; jpayne@69: cf->m_self = (PyObject *) op; jpayne@69: #endif jpayne@69: Py_XINCREF(closure); jpayne@69: op->func_closure = closure; jpayne@69: #if !CYTHON_COMPILING_IN_LIMITED_API jpayne@69: Py_XINCREF(module); jpayne@69: cf->m_module = module; jpayne@69: #endif jpayne@69: op->func_dict = NULL; jpayne@69: op->func_name = NULL; jpayne@69: Py_INCREF(qualname); jpayne@69: op->func_qualname = qualname; jpayne@69: op->func_doc = NULL; jpayne@69: #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API jpayne@69: op->func_classobj = NULL; jpayne@69: #else jpayne@69: ((PyCMethodObject*)op)->mm_class = NULL; jpayne@69: #endif jpayne@69: op->func_globals = globals; jpayne@69: Py_INCREF(op->func_globals); jpayne@69: Py_XINCREF(code); jpayne@69: op->func_code = code; jpayne@69: op->defaults_pyobjects = 0; jpayne@69: op->defaults_size = 0; jpayne@69: op->defaults = NULL; jpayne@69: op->defaults_tuple = NULL; jpayne@69: op->defaults_kwdict = NULL; jpayne@69: op->defaults_getter = NULL; jpayne@69: op->func_annotations = NULL; jpayne@69: op->func_is_coroutine = NULL; jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { jpayne@69: case METH_NOARGS: jpayne@69: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; jpayne@69: break; jpayne@69: case METH_O: jpayne@69: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; jpayne@69: break; jpayne@69: case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: jpayne@69: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; jpayne@69: break; jpayne@69: case METH_FASTCALL | METH_KEYWORDS: jpayne@69: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; jpayne@69: break; jpayne@69: case METH_VARARGS | METH_KEYWORDS: jpayne@69: __Pyx_CyFunction_func_vectorcall(op) = NULL; jpayne@69: break; jpayne@69: default: jpayne@69: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); jpayne@69: Py_DECREF(op); jpayne@69: return NULL; jpayne@69: } jpayne@69: #endif jpayne@69: return (PyObject *) op; jpayne@69: } jpayne@69: static int jpayne@69: __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) jpayne@69: { jpayne@69: Py_CLEAR(m->func_closure); jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: Py_CLEAR(m->func); jpayne@69: #else jpayne@69: Py_CLEAR(((PyCFunctionObject*)m)->m_module); jpayne@69: #endif jpayne@69: Py_CLEAR(m->func_dict); jpayne@69: Py_CLEAR(m->func_name); jpayne@69: Py_CLEAR(m->func_qualname); jpayne@69: Py_CLEAR(m->func_doc); jpayne@69: Py_CLEAR(m->func_globals); jpayne@69: Py_CLEAR(m->func_code); jpayne@69: #if !CYTHON_COMPILING_IN_LIMITED_API jpayne@69: #if PY_VERSION_HEX < 0x030900B1 jpayne@69: Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); jpayne@69: #else jpayne@69: { jpayne@69: PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; jpayne@69: ((PyCMethodObject *) (m))->mm_class = NULL; jpayne@69: Py_XDECREF(cls); jpayne@69: } jpayne@69: #endif jpayne@69: #endif jpayne@69: Py_CLEAR(m->defaults_tuple); jpayne@69: Py_CLEAR(m->defaults_kwdict); jpayne@69: Py_CLEAR(m->func_annotations); jpayne@69: Py_CLEAR(m->func_is_coroutine); jpayne@69: if (m->defaults) { jpayne@69: PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); jpayne@69: int i; jpayne@69: for (i = 0; i < m->defaults_pyobjects; i++) jpayne@69: Py_XDECREF(pydefaults[i]); jpayne@69: PyObject_Free(m->defaults); jpayne@69: m->defaults = NULL; jpayne@69: } jpayne@69: return 0; jpayne@69: } jpayne@69: static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) jpayne@69: { jpayne@69: if (__Pyx_CyFunction_weakreflist(m) != NULL) jpayne@69: PyObject_ClearWeakRefs((PyObject *) m); jpayne@69: __Pyx_CyFunction_clear(m); jpayne@69: __Pyx_PyHeapTypeObject_GC_Del(m); jpayne@69: } jpayne@69: static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) jpayne@69: { jpayne@69: PyObject_GC_UnTrack(m); jpayne@69: __Pyx__CyFunction_dealloc(m); jpayne@69: } jpayne@69: static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) jpayne@69: { jpayne@69: Py_VISIT(m->func_closure); jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: Py_VISIT(m->func); jpayne@69: #else jpayne@69: Py_VISIT(((PyCFunctionObject*)m)->m_module); jpayne@69: #endif jpayne@69: Py_VISIT(m->func_dict); jpayne@69: Py_VISIT(m->func_name); jpayne@69: Py_VISIT(m->func_qualname); jpayne@69: Py_VISIT(m->func_doc); jpayne@69: Py_VISIT(m->func_globals); jpayne@69: Py_VISIT(m->func_code); jpayne@69: #if !CYTHON_COMPILING_IN_LIMITED_API jpayne@69: Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); jpayne@69: #endif jpayne@69: Py_VISIT(m->defaults_tuple); jpayne@69: Py_VISIT(m->defaults_kwdict); jpayne@69: Py_VISIT(m->func_is_coroutine); jpayne@69: if (m->defaults) { jpayne@69: PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); jpayne@69: int i; jpayne@69: for (i = 0; i < m->defaults_pyobjects; i++) jpayne@69: Py_VISIT(pydefaults[i]); jpayne@69: } jpayne@69: return 0; jpayne@69: } jpayne@69: static PyObject* jpayne@69: __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) jpayne@69: { jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: return PyUnicode_FromFormat("", jpayne@69: op->func_qualname, (void *)op); jpayne@69: #else jpayne@69: return PyString_FromFormat("", jpayne@69: PyString_AsString(op->func_qualname), (void *)op); jpayne@69: #endif jpayne@69: } jpayne@69: static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: PyObject *f = ((__pyx_CyFunctionObject*)func)->func; jpayne@69: PyObject *py_name = NULL; jpayne@69: PyCFunction meth; jpayne@69: int flags; jpayne@69: meth = PyCFunction_GetFunction(f); jpayne@69: if (unlikely(!meth)) return NULL; jpayne@69: flags = PyCFunction_GetFlags(f); jpayne@69: if (unlikely(flags < 0)) return NULL; jpayne@69: #else jpayne@69: PyCFunctionObject* f = (PyCFunctionObject*)func; jpayne@69: PyCFunction meth = f->m_ml->ml_meth; jpayne@69: int flags = f->m_ml->ml_flags; jpayne@69: #endif jpayne@69: Py_ssize_t size; jpayne@69: switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { jpayne@69: case METH_VARARGS: jpayne@69: if (likely(kw == NULL || PyDict_Size(kw) == 0)) jpayne@69: return (*meth)(self, arg); jpayne@69: break; jpayne@69: case METH_VARARGS | METH_KEYWORDS: jpayne@69: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); jpayne@69: case METH_NOARGS: jpayne@69: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS jpayne@69: size = PyTuple_GET_SIZE(arg); jpayne@69: #else jpayne@69: size = PyTuple_Size(arg); jpayne@69: if (unlikely(size < 0)) return NULL; jpayne@69: #endif jpayne@69: if (likely(size == 0)) jpayne@69: return (*meth)(self, NULL); jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); jpayne@69: if (!py_name) return NULL; jpayne@69: PyErr_Format(PyExc_TypeError, jpayne@69: "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", jpayne@69: py_name, size); jpayne@69: Py_DECREF(py_name); jpayne@69: #else jpayne@69: PyErr_Format(PyExc_TypeError, jpayne@69: "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", jpayne@69: f->m_ml->ml_name, size); jpayne@69: #endif jpayne@69: return NULL; jpayne@69: } jpayne@69: break; jpayne@69: case METH_O: jpayne@69: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS jpayne@69: size = PyTuple_GET_SIZE(arg); jpayne@69: #else jpayne@69: size = PyTuple_Size(arg); jpayne@69: if (unlikely(size < 0)) return NULL; jpayne@69: #endif jpayne@69: if (likely(size == 1)) { jpayne@69: PyObject *result, *arg0; jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS jpayne@69: arg0 = PyTuple_GET_ITEM(arg, 0); jpayne@69: #else jpayne@69: arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; jpayne@69: #endif jpayne@69: result = (*meth)(self, arg0); jpayne@69: #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) jpayne@69: Py_DECREF(arg0); jpayne@69: #endif jpayne@69: return result; jpayne@69: } jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); jpayne@69: if (!py_name) return NULL; jpayne@69: PyErr_Format(PyExc_TypeError, jpayne@69: "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", jpayne@69: py_name, size); jpayne@69: Py_DECREF(py_name); jpayne@69: #else jpayne@69: PyErr_Format(PyExc_TypeError, jpayne@69: "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", jpayne@69: f->m_ml->ml_name, size); jpayne@69: #endif jpayne@69: return NULL; jpayne@69: } jpayne@69: break; jpayne@69: default: jpayne@69: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); jpayne@69: return NULL; jpayne@69: } jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); jpayne@69: if (!py_name) return NULL; jpayne@69: PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", jpayne@69: py_name); jpayne@69: Py_DECREF(py_name); jpayne@69: #else jpayne@69: PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", jpayne@69: f->m_ml->ml_name); jpayne@69: #endif jpayne@69: return NULL; jpayne@69: } jpayne@69: static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { jpayne@69: PyObject *self, *result; jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); jpayne@69: if (unlikely(!self) && PyErr_Occurred()) return NULL; jpayne@69: #else jpayne@69: self = ((PyCFunctionObject*)func)->m_self; jpayne@69: #endif jpayne@69: result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); jpayne@69: return result; jpayne@69: } jpayne@69: static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { jpayne@69: PyObject *result; jpayne@69: __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); jpayne@69: if (vc) { jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS jpayne@69: return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); jpayne@69: #else jpayne@69: (void) &__Pyx_PyVectorcall_FastCallDict; jpayne@69: return PyVectorcall_Call(func, args, kw); jpayne@69: #endif jpayne@69: } jpayne@69: #endif jpayne@69: if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { jpayne@69: Py_ssize_t argc; jpayne@69: PyObject *new_args; jpayne@69: PyObject *self; jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS jpayne@69: argc = PyTuple_GET_SIZE(args); jpayne@69: #else jpayne@69: argc = PyTuple_Size(args); jpayne@69: if (unlikely(!argc) < 0) return NULL; jpayne@69: #endif jpayne@69: new_args = PyTuple_GetSlice(args, 1, argc); jpayne@69: if (unlikely(!new_args)) jpayne@69: return NULL; jpayne@69: self = PyTuple_GetItem(args, 0); jpayne@69: if (unlikely(!self)) { jpayne@69: Py_DECREF(new_args); jpayne@69: #if PY_MAJOR_VERSION > 2 jpayne@69: PyErr_Format(PyExc_TypeError, jpayne@69: "unbound method %.200S() needs an argument", jpayne@69: cyfunc->func_qualname); jpayne@69: #else jpayne@69: PyErr_SetString(PyExc_TypeError, jpayne@69: "unbound method needs an argument"); jpayne@69: #endif jpayne@69: return NULL; jpayne@69: } jpayne@69: result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); jpayne@69: Py_DECREF(new_args); jpayne@69: } else { jpayne@69: result = __Pyx_CyFunction_Call(func, args, kw); jpayne@69: } jpayne@69: return result; jpayne@69: } jpayne@69: #if CYTHON_METH_FASTCALL jpayne@69: static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) jpayne@69: { jpayne@69: int ret = 0; jpayne@69: if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { jpayne@69: if (unlikely(nargs < 1)) { jpayne@69: PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", jpayne@69: ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); jpayne@69: return -1; jpayne@69: } jpayne@69: ret = 1; jpayne@69: } jpayne@69: if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { jpayne@69: PyErr_Format(PyExc_TypeError, jpayne@69: "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); jpayne@69: return -1; jpayne@69: } jpayne@69: return ret; jpayne@69: } jpayne@69: static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) jpayne@69: { jpayne@69: __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; jpayne@69: PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; jpayne@69: #if CYTHON_BACKPORT_VECTORCALL jpayne@69: Py_ssize_t nargs = (Py_ssize_t)nargsf; jpayne@69: #else jpayne@69: Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); jpayne@69: #endif jpayne@69: PyObject *self; jpayne@69: switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { jpayne@69: case 1: jpayne@69: self = args[0]; jpayne@69: args += 1; jpayne@69: nargs -= 1; jpayne@69: break; jpayne@69: case 0: jpayne@69: self = ((PyCFunctionObject*)cyfunc)->m_self; jpayne@69: break; jpayne@69: default: jpayne@69: return NULL; jpayne@69: } jpayne@69: if (unlikely(nargs != 0)) { jpayne@69: PyErr_Format(PyExc_TypeError, jpayne@69: "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", jpayne@69: def->ml_name, nargs); jpayne@69: return NULL; jpayne@69: } jpayne@69: return def->ml_meth(self, NULL); jpayne@69: } jpayne@69: static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) jpayne@69: { jpayne@69: __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; jpayne@69: PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; jpayne@69: #if CYTHON_BACKPORT_VECTORCALL jpayne@69: Py_ssize_t nargs = (Py_ssize_t)nargsf; jpayne@69: #else jpayne@69: Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); jpayne@69: #endif jpayne@69: PyObject *self; jpayne@69: switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { jpayne@69: case 1: jpayne@69: self = args[0]; jpayne@69: args += 1; jpayne@69: nargs -= 1; jpayne@69: break; jpayne@69: case 0: jpayne@69: self = ((PyCFunctionObject*)cyfunc)->m_self; jpayne@69: break; jpayne@69: default: jpayne@69: return NULL; jpayne@69: } jpayne@69: if (unlikely(nargs != 1)) { jpayne@69: PyErr_Format(PyExc_TypeError, jpayne@69: "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", jpayne@69: def->ml_name, nargs); jpayne@69: return NULL; jpayne@69: } jpayne@69: return def->ml_meth(self, args[0]); jpayne@69: } jpayne@69: static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) jpayne@69: { jpayne@69: __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; jpayne@69: PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; jpayne@69: #if CYTHON_BACKPORT_VECTORCALL jpayne@69: Py_ssize_t nargs = (Py_ssize_t)nargsf; jpayne@69: #else jpayne@69: Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); jpayne@69: #endif jpayne@69: PyObject *self; jpayne@69: switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { jpayne@69: case 1: jpayne@69: self = args[0]; jpayne@69: args += 1; jpayne@69: nargs -= 1; jpayne@69: break; jpayne@69: case 0: jpayne@69: self = ((PyCFunctionObject*)cyfunc)->m_self; jpayne@69: break; jpayne@69: default: jpayne@69: return NULL; jpayne@69: } jpayne@69: return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); jpayne@69: } jpayne@69: static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) jpayne@69: { jpayne@69: __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; jpayne@69: PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; jpayne@69: PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); jpayne@69: #if CYTHON_BACKPORT_VECTORCALL jpayne@69: Py_ssize_t nargs = (Py_ssize_t)nargsf; jpayne@69: #else jpayne@69: Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); jpayne@69: #endif jpayne@69: PyObject *self; jpayne@69: switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { jpayne@69: case 1: jpayne@69: self = args[0]; jpayne@69: args += 1; jpayne@69: nargs -= 1; jpayne@69: break; jpayne@69: case 0: jpayne@69: self = ((PyCFunctionObject*)cyfunc)->m_self; jpayne@69: break; jpayne@69: default: jpayne@69: return NULL; jpayne@69: } jpayne@69: return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); jpayne@69: } jpayne@69: #endif jpayne@69: #if CYTHON_USE_TYPE_SPECS jpayne@69: static PyType_Slot __pyx_CyFunctionType_slots[] = { jpayne@69: {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, jpayne@69: {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, jpayne@69: {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, jpayne@69: {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, jpayne@69: {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, jpayne@69: {Py_tp_methods, (void *)__pyx_CyFunction_methods}, jpayne@69: {Py_tp_members, (void *)__pyx_CyFunction_members}, jpayne@69: {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, jpayne@69: {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, jpayne@69: {0, 0}, jpayne@69: }; jpayne@69: static PyType_Spec __pyx_CyFunctionType_spec = { jpayne@69: __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", jpayne@69: sizeof(__pyx_CyFunctionObject), jpayne@69: 0, jpayne@69: #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR jpayne@69: Py_TPFLAGS_METHOD_DESCRIPTOR | jpayne@69: #endif jpayne@69: #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) jpayne@69: _Py_TPFLAGS_HAVE_VECTORCALL | jpayne@69: #endif jpayne@69: Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, jpayne@69: __pyx_CyFunctionType_slots jpayne@69: }; jpayne@69: #else jpayne@69: static PyTypeObject __pyx_CyFunctionType_type = { jpayne@69: PyVarObject_HEAD_INIT(0, 0) jpayne@69: __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", jpayne@69: sizeof(__pyx_CyFunctionObject), jpayne@69: 0, jpayne@69: (destructor) __Pyx_CyFunction_dealloc, jpayne@69: #if !CYTHON_METH_FASTCALL jpayne@69: 0, jpayne@69: #elif CYTHON_BACKPORT_VECTORCALL jpayne@69: (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), jpayne@69: #else jpayne@69: offsetof(PyCFunctionObject, vectorcall), jpayne@69: #endif jpayne@69: 0, jpayne@69: 0, jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: 0, jpayne@69: #else jpayne@69: 0, jpayne@69: #endif jpayne@69: (reprfunc) __Pyx_CyFunction_repr, jpayne@69: 0, jpayne@69: 0, jpayne@69: 0, jpayne@69: 0, jpayne@69: __Pyx_CyFunction_CallAsMethod, jpayne@69: 0, jpayne@69: 0, jpayne@69: 0, jpayne@69: 0, jpayne@69: #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR jpayne@69: Py_TPFLAGS_METHOD_DESCRIPTOR | jpayne@69: #endif jpayne@69: #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL jpayne@69: _Py_TPFLAGS_HAVE_VECTORCALL | jpayne@69: #endif jpayne@69: Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, jpayne@69: 0, jpayne@69: (traverseproc) __Pyx_CyFunction_traverse, jpayne@69: (inquiry) __Pyx_CyFunction_clear, jpayne@69: 0, jpayne@69: #if PY_VERSION_HEX < 0x030500A0 jpayne@69: offsetof(__pyx_CyFunctionObject, func_weakreflist), jpayne@69: #else jpayne@69: offsetof(PyCFunctionObject, m_weakreflist), jpayne@69: #endif jpayne@69: 0, jpayne@69: 0, jpayne@69: __pyx_CyFunction_methods, jpayne@69: __pyx_CyFunction_members, jpayne@69: __pyx_CyFunction_getsets, jpayne@69: 0, jpayne@69: 0, jpayne@69: __Pyx_PyMethod_New, jpayne@69: 0, jpayne@69: offsetof(__pyx_CyFunctionObject, func_dict), jpayne@69: 0, jpayne@69: 0, jpayne@69: 0, jpayne@69: 0, jpayne@69: 0, jpayne@69: 0, jpayne@69: 0, jpayne@69: 0, jpayne@69: 0, jpayne@69: 0, jpayne@69: 0, jpayne@69: 0, jpayne@69: #if PY_VERSION_HEX >= 0x030400a1 jpayne@69: 0, jpayne@69: #endif jpayne@69: #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) jpayne@69: 0, jpayne@69: #endif jpayne@69: #if __PYX_NEED_TP_PRINT_SLOT jpayne@69: 0, jpayne@69: #endif jpayne@69: #if PY_VERSION_HEX >= 0x030C0000 jpayne@69: 0, jpayne@69: #endif jpayne@69: #if PY_VERSION_HEX >= 0x030d00A4 jpayne@69: 0, jpayne@69: #endif jpayne@69: #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 jpayne@69: 0, jpayne@69: #endif jpayne@69: }; jpayne@69: #endif jpayne@69: static int __pyx_CyFunction_init(PyObject *module) { jpayne@69: #if CYTHON_USE_TYPE_SPECS jpayne@69: __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); jpayne@69: #else jpayne@69: CYTHON_UNUSED_VAR(module); jpayne@69: __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); jpayne@69: #endif jpayne@69: if (unlikely(__pyx_CyFunctionType == NULL)) { jpayne@69: return -1; jpayne@69: } jpayne@69: return 0; jpayne@69: } jpayne@69: static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { jpayne@69: __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; jpayne@69: m->defaults = PyObject_Malloc(size); jpayne@69: if (unlikely(!m->defaults)) jpayne@69: return PyErr_NoMemory(); jpayne@69: memset(m->defaults, 0, size); jpayne@69: m->defaults_pyobjects = pyobjects; jpayne@69: m->defaults_size = size; jpayne@69: return m->defaults; jpayne@69: } jpayne@69: static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { jpayne@69: __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; jpayne@69: m->defaults_tuple = tuple; jpayne@69: Py_INCREF(tuple); jpayne@69: } jpayne@69: static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { jpayne@69: __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; jpayne@69: m->defaults_kwdict = dict; jpayne@69: Py_INCREF(dict); jpayne@69: } jpayne@69: static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { jpayne@69: __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; jpayne@69: m->func_annotations = dict; jpayne@69: Py_INCREF(dict); jpayne@69: } jpayne@69: jpayne@69: /* CythonFunction */ jpayne@69: static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, jpayne@69: PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { jpayne@69: PyObject *op = __Pyx_CyFunction_Init( jpayne@69: PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), jpayne@69: ml, flags, qualname, closure, module, globals, code jpayne@69: ); jpayne@69: if (likely(op)) { jpayne@69: PyObject_GC_Track(op); jpayne@69: } jpayne@69: return op; jpayne@69: } jpayne@69: jpayne@69: /* RaiseUnboundLocalError */ jpayne@69: static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { jpayne@69: PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); jpayne@69: } jpayne@69: jpayne@69: /* TypeImport */ jpayne@69: #ifndef __PYX_HAVE_RT_ImportType_3_0_11 jpayne@69: #define __PYX_HAVE_RT_ImportType_3_0_11 jpayne@69: static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject *module, const char *module_name, const char *class_name, jpayne@69: size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size) jpayne@69: { jpayne@69: PyObject *result = 0; jpayne@69: char warning[200]; jpayne@69: Py_ssize_t basicsize; jpayne@69: Py_ssize_t itemsize; jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: PyObject *py_basicsize; jpayne@69: PyObject *py_itemsize; jpayne@69: #endif jpayne@69: result = PyObject_GetAttrString(module, class_name); jpayne@69: if (!result) jpayne@69: goto bad; jpayne@69: if (!PyType_Check(result)) { jpayne@69: PyErr_Format(PyExc_TypeError, jpayne@69: "%.200s.%.200s is not a type object", jpayne@69: module_name, class_name); jpayne@69: goto bad; jpayne@69: } jpayne@69: #if !CYTHON_COMPILING_IN_LIMITED_API jpayne@69: basicsize = ((PyTypeObject *)result)->tp_basicsize; jpayne@69: itemsize = ((PyTypeObject *)result)->tp_itemsize; jpayne@69: #else jpayne@69: py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); jpayne@69: if (!py_basicsize) jpayne@69: goto bad; jpayne@69: basicsize = PyLong_AsSsize_t(py_basicsize); jpayne@69: Py_DECREF(py_basicsize); jpayne@69: py_basicsize = 0; jpayne@69: if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) jpayne@69: goto bad; jpayne@69: py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); jpayne@69: if (!py_itemsize) jpayne@69: goto bad; jpayne@69: itemsize = PyLong_AsSsize_t(py_itemsize); jpayne@69: Py_DECREF(py_itemsize); jpayne@69: py_itemsize = 0; jpayne@69: if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) jpayne@69: goto bad; jpayne@69: #endif jpayne@69: if (itemsize) { jpayne@69: if (size % alignment) { jpayne@69: alignment = size % alignment; jpayne@69: } jpayne@69: if (itemsize < (Py_ssize_t)alignment) jpayne@69: itemsize = (Py_ssize_t)alignment; jpayne@69: } jpayne@69: if ((size_t)(basicsize + itemsize) < size) { jpayne@69: PyErr_Format(PyExc_ValueError, jpayne@69: "%.200s.%.200s size changed, may indicate binary incompatibility. " jpayne@69: "Expected %zd from C header, got %zd from PyObject", jpayne@69: module_name, class_name, size, basicsize+itemsize); jpayne@69: goto bad; jpayne@69: } jpayne@69: if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_11 && jpayne@69: ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { jpayne@69: PyErr_Format(PyExc_ValueError, jpayne@69: "%.200s.%.200s size changed, may indicate binary incompatibility. " jpayne@69: "Expected %zd from C header, got %zd-%zd from PyObject", jpayne@69: module_name, class_name, size, basicsize, basicsize+itemsize); jpayne@69: goto bad; jpayne@69: } jpayne@69: else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_11 && (size_t)basicsize > size) { jpayne@69: PyOS_snprintf(warning, sizeof(warning), jpayne@69: "%s.%s size changed, may indicate binary incompatibility. " jpayne@69: "Expected %zd from C header, got %zd from PyObject", jpayne@69: module_name, class_name, size, basicsize); jpayne@69: if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; jpayne@69: } jpayne@69: return (PyTypeObject *)result; jpayne@69: bad: jpayne@69: Py_XDECREF(result); jpayne@69: return NULL; jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: /* Import */ jpayne@69: static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { jpayne@69: PyObject *module = 0; jpayne@69: PyObject *empty_dict = 0; jpayne@69: PyObject *empty_list = 0; jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: PyObject *py_import; jpayne@69: py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); jpayne@69: if (unlikely(!py_import)) jpayne@69: goto bad; jpayne@69: if (!from_list) { jpayne@69: empty_list = PyList_New(0); jpayne@69: if (unlikely(!empty_list)) jpayne@69: goto bad; jpayne@69: from_list = empty_list; jpayne@69: } jpayne@69: #endif jpayne@69: empty_dict = PyDict_New(); jpayne@69: if (unlikely(!empty_dict)) jpayne@69: goto bad; jpayne@69: { jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: if (level == -1) { jpayne@69: if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { jpayne@69: module = PyImport_ImportModuleLevelObject( jpayne@69: name, __pyx_d, empty_dict, from_list, 1); jpayne@69: if (unlikely(!module)) { jpayne@69: if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) jpayne@69: goto bad; jpayne@69: PyErr_Clear(); jpayne@69: } jpayne@69: } jpayne@69: level = 0; jpayne@69: } jpayne@69: #endif jpayne@69: if (!module) { jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: PyObject *py_level = PyInt_FromLong(level); jpayne@69: if (unlikely(!py_level)) jpayne@69: goto bad; jpayne@69: module = PyObject_CallFunctionObjArgs(py_import, jpayne@69: name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); jpayne@69: Py_DECREF(py_level); jpayne@69: #else jpayne@69: module = PyImport_ImportModuleLevelObject( jpayne@69: name, __pyx_d, empty_dict, from_list, level); jpayne@69: #endif jpayne@69: } jpayne@69: } jpayne@69: bad: jpayne@69: Py_XDECREF(empty_dict); jpayne@69: Py_XDECREF(empty_list); jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: Py_XDECREF(py_import); jpayne@69: #endif jpayne@69: return module; jpayne@69: } jpayne@69: jpayne@69: /* ImportDottedModule */ jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { jpayne@69: PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; jpayne@69: if (unlikely(PyErr_Occurred())) { jpayne@69: PyErr_Clear(); jpayne@69: } jpayne@69: if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { jpayne@69: partial_name = name; jpayne@69: } else { jpayne@69: slice = PySequence_GetSlice(parts_tuple, 0, count); jpayne@69: if (unlikely(!slice)) jpayne@69: goto bad; jpayne@69: sep = PyUnicode_FromStringAndSize(".", 1); jpayne@69: if (unlikely(!sep)) jpayne@69: goto bad; jpayne@69: partial_name = PyUnicode_Join(sep, slice); jpayne@69: } jpayne@69: PyErr_Format( jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: PyExc_ImportError, jpayne@69: "No module named '%s'", PyString_AS_STRING(partial_name)); jpayne@69: #else jpayne@69: #if PY_VERSION_HEX >= 0x030600B1 jpayne@69: PyExc_ModuleNotFoundError, jpayne@69: #else jpayne@69: PyExc_ImportError, jpayne@69: #endif jpayne@69: "No module named '%U'", partial_name); jpayne@69: #endif jpayne@69: bad: jpayne@69: Py_XDECREF(sep); jpayne@69: Py_XDECREF(slice); jpayne@69: Py_XDECREF(partial_name); jpayne@69: return NULL; jpayne@69: } jpayne@69: #endif jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { jpayne@69: PyObject *imported_module; jpayne@69: #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) jpayne@69: PyObject *modules = PyImport_GetModuleDict(); jpayne@69: if (unlikely(!modules)) jpayne@69: return NULL; jpayne@69: imported_module = __Pyx_PyDict_GetItemStr(modules, name); jpayne@69: Py_XINCREF(imported_module); jpayne@69: #else jpayne@69: imported_module = PyImport_GetModule(name); jpayne@69: #endif jpayne@69: return imported_module; jpayne@69: } jpayne@69: #endif jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { jpayne@69: Py_ssize_t i, nparts; jpayne@69: nparts = PyTuple_GET_SIZE(parts_tuple); jpayne@69: for (i=1; i < nparts && module; i++) { jpayne@69: PyObject *part, *submodule; jpayne@69: #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS jpayne@69: part = PyTuple_GET_ITEM(parts_tuple, i); jpayne@69: #else jpayne@69: part = PySequence_ITEM(parts_tuple, i); jpayne@69: #endif jpayne@69: submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); jpayne@69: #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) jpayne@69: Py_DECREF(part); jpayne@69: #endif jpayne@69: Py_DECREF(module); jpayne@69: module = submodule; jpayne@69: } jpayne@69: if (unlikely(!module)) { jpayne@69: return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); jpayne@69: } jpayne@69: return module; jpayne@69: } jpayne@69: #endif jpayne@69: static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: PyObject *module, *from_list, *star = __pyx_n_s__14; jpayne@69: CYTHON_UNUSED_VAR(parts_tuple); jpayne@69: from_list = PyList_New(1); jpayne@69: if (unlikely(!from_list)) jpayne@69: return NULL; jpayne@69: Py_INCREF(star); jpayne@69: PyList_SET_ITEM(from_list, 0, star); jpayne@69: module = __Pyx_Import(name, from_list, 0); jpayne@69: Py_DECREF(from_list); jpayne@69: return module; jpayne@69: #else jpayne@69: PyObject *imported_module; jpayne@69: PyObject *module = __Pyx_Import(name, NULL, 0); jpayne@69: if (!parts_tuple || unlikely(!module)) jpayne@69: return module; jpayne@69: imported_module = __Pyx__ImportDottedModule_Lookup(name); jpayne@69: if (likely(imported_module)) { jpayne@69: Py_DECREF(module); jpayne@69: return imported_module; jpayne@69: } jpayne@69: PyErr_Clear(); jpayne@69: return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); jpayne@69: #endif jpayne@69: } jpayne@69: static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 jpayne@69: PyObject *module = __Pyx__ImportDottedModule_Lookup(name); jpayne@69: if (likely(module)) { jpayne@69: PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); jpayne@69: if (likely(spec)) { jpayne@69: PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); jpayne@69: if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { jpayne@69: Py_DECREF(spec); jpayne@69: spec = NULL; jpayne@69: } jpayne@69: Py_XDECREF(unsafe); jpayne@69: } jpayne@69: if (likely(!spec)) { jpayne@69: PyErr_Clear(); jpayne@69: return module; jpayne@69: } jpayne@69: Py_DECREF(spec); jpayne@69: Py_DECREF(module); jpayne@69: } else if (PyErr_Occurred()) { jpayne@69: PyErr_Clear(); jpayne@69: } jpayne@69: #endif jpayne@69: return __Pyx__ImportDottedModule(name, parts_tuple); jpayne@69: } jpayne@69: jpayne@69: /* ImportFrom */ jpayne@69: static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { jpayne@69: PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); jpayne@69: if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { jpayne@69: const char* module_name_str = 0; jpayne@69: PyObject* module_name = 0; jpayne@69: PyObject* module_dot = 0; jpayne@69: PyObject* full_name = 0; jpayne@69: PyErr_Clear(); jpayne@69: module_name_str = PyModule_GetName(module); jpayne@69: if (unlikely(!module_name_str)) { goto modbad; } jpayne@69: module_name = PyUnicode_FromString(module_name_str); jpayne@69: if (unlikely(!module_name)) { goto modbad; } jpayne@69: module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__15); jpayne@69: if (unlikely(!module_dot)) { goto modbad; } jpayne@69: full_name = PyUnicode_Concat(module_dot, name); jpayne@69: if (unlikely(!full_name)) { goto modbad; } jpayne@69: #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) jpayne@69: { jpayne@69: PyObject *modules = PyImport_GetModuleDict(); jpayne@69: if (unlikely(!modules)) jpayne@69: goto modbad; jpayne@69: value = PyObject_GetItem(modules, full_name); jpayne@69: } jpayne@69: #else jpayne@69: value = PyImport_GetModule(full_name); jpayne@69: #endif jpayne@69: modbad: jpayne@69: Py_XDECREF(full_name); jpayne@69: Py_XDECREF(module_dot); jpayne@69: Py_XDECREF(module_name); jpayne@69: } jpayne@69: if (unlikely(!value)) { jpayne@69: PyErr_Format(PyExc_ImportError, jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: "cannot import name %.230s", PyString_AS_STRING(name)); jpayne@69: #else jpayne@69: "cannot import name %S", name); jpayne@69: #endif jpayne@69: } jpayne@69: return value; jpayne@69: } jpayne@69: jpayne@69: /* PyObjectCallNoArg */ jpayne@69: static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { jpayne@69: PyObject *arg[2] = {NULL, NULL}; jpayne@69: return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); jpayne@69: } jpayne@69: jpayne@69: /* CLineInTraceback */ jpayne@69: #ifndef CYTHON_CLINE_IN_TRACEBACK jpayne@69: static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { jpayne@69: PyObject *use_cline; jpayne@69: PyObject *ptype, *pvalue, *ptraceback; jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON jpayne@69: PyObject **cython_runtime_dict; jpayne@69: #endif jpayne@69: CYTHON_MAYBE_UNUSED_VAR(tstate); jpayne@69: if (unlikely(!__pyx_cython_runtime)) { jpayne@69: return c_line; jpayne@69: } jpayne@69: __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON jpayne@69: cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); jpayne@69: if (likely(cython_runtime_dict)) { jpayne@69: __PYX_PY_DICT_LOOKUP_IF_MODIFIED( jpayne@69: use_cline, *cython_runtime_dict, jpayne@69: __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) jpayne@69: } else jpayne@69: #endif jpayne@69: { jpayne@69: PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); jpayne@69: if (use_cline_obj) { jpayne@69: use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; jpayne@69: Py_DECREF(use_cline_obj); jpayne@69: } else { jpayne@69: PyErr_Clear(); jpayne@69: use_cline = NULL; jpayne@69: } jpayne@69: } jpayne@69: if (!use_cline) { jpayne@69: c_line = 0; jpayne@69: (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); jpayne@69: } jpayne@69: else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { jpayne@69: c_line = 0; jpayne@69: } jpayne@69: __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); jpayne@69: return c_line; jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: /* CodeObjectCache */ jpayne@69: #if !CYTHON_COMPILING_IN_LIMITED_API jpayne@69: static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { jpayne@69: int start = 0, mid = 0, end = count - 1; jpayne@69: if (end >= 0 && code_line > entries[end].code_line) { jpayne@69: return count; jpayne@69: } jpayne@69: while (start < end) { jpayne@69: mid = start + (end - start) / 2; jpayne@69: if (code_line < entries[mid].code_line) { jpayne@69: end = mid; jpayne@69: } else if (code_line > entries[mid].code_line) { jpayne@69: start = mid + 1; jpayne@69: } else { jpayne@69: return mid; jpayne@69: } jpayne@69: } jpayne@69: if (code_line <= entries[mid].code_line) { jpayne@69: return mid; jpayne@69: } else { jpayne@69: return mid + 1; jpayne@69: } jpayne@69: } jpayne@69: static PyCodeObject *__pyx_find_code_object(int code_line) { jpayne@69: PyCodeObject* code_object; jpayne@69: int pos; jpayne@69: if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { jpayne@69: return NULL; jpayne@69: } jpayne@69: pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); jpayne@69: if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { jpayne@69: return NULL; jpayne@69: } jpayne@69: code_object = __pyx_code_cache.entries[pos].code_object; jpayne@69: Py_INCREF(code_object); jpayne@69: return code_object; jpayne@69: } jpayne@69: static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { jpayne@69: int pos, i; jpayne@69: __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; jpayne@69: if (unlikely(!code_line)) { jpayne@69: return; jpayne@69: } jpayne@69: if (unlikely(!entries)) { jpayne@69: entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); jpayne@69: if (likely(entries)) { jpayne@69: __pyx_code_cache.entries = entries; jpayne@69: __pyx_code_cache.max_count = 64; jpayne@69: __pyx_code_cache.count = 1; jpayne@69: entries[0].code_line = code_line; jpayne@69: entries[0].code_object = code_object; jpayne@69: Py_INCREF(code_object); jpayne@69: } jpayne@69: return; jpayne@69: } jpayne@69: pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); jpayne@69: if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { jpayne@69: PyCodeObject* tmp = entries[pos].code_object; jpayne@69: entries[pos].code_object = code_object; jpayne@69: Py_DECREF(tmp); jpayne@69: return; jpayne@69: } jpayne@69: if (__pyx_code_cache.count == __pyx_code_cache.max_count) { jpayne@69: int new_max = __pyx_code_cache.max_count + 64; jpayne@69: entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( jpayne@69: __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); jpayne@69: if (unlikely(!entries)) { jpayne@69: return; jpayne@69: } jpayne@69: __pyx_code_cache.entries = entries; jpayne@69: __pyx_code_cache.max_count = new_max; jpayne@69: } jpayne@69: for (i=__pyx_code_cache.count; i>pos; i--) { jpayne@69: entries[i] = entries[i-1]; jpayne@69: } jpayne@69: entries[pos].code_line = code_line; jpayne@69: entries[pos].code_object = code_object; jpayne@69: __pyx_code_cache.count++; jpayne@69: Py_INCREF(code_object); jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: /* AddTraceback */ jpayne@69: #include "compile.h" jpayne@69: #include "frameobject.h" jpayne@69: #include "traceback.h" jpayne@69: #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API jpayne@69: #ifndef Py_BUILD_CORE jpayne@69: #define Py_BUILD_CORE 1 jpayne@69: #endif jpayne@69: #include "internal/pycore_frame.h" jpayne@69: #endif jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, jpayne@69: PyObject *firstlineno, PyObject *name) { jpayne@69: PyObject *replace = NULL; jpayne@69: if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; jpayne@69: if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; jpayne@69: replace = PyObject_GetAttrString(code, "replace"); jpayne@69: if (likely(replace)) { jpayne@69: PyObject *result; jpayne@69: result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); jpayne@69: Py_DECREF(replace); jpayne@69: return result; jpayne@69: } jpayne@69: PyErr_Clear(); jpayne@69: #if __PYX_LIMITED_VERSION_HEX < 0x030780000 jpayne@69: { jpayne@69: PyObject *compiled = NULL, *result = NULL; jpayne@69: if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; jpayne@69: if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; jpayne@69: compiled = Py_CompileString( jpayne@69: "out = type(code)(\n" jpayne@69: " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" jpayne@69: " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" jpayne@69: " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" jpayne@69: " code.co_lnotab)\n", "", Py_file_input); jpayne@69: if (!compiled) return NULL; jpayne@69: result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); jpayne@69: Py_DECREF(compiled); jpayne@69: if (!result) PyErr_Print(); jpayne@69: Py_DECREF(result); jpayne@69: result = PyDict_GetItemString(scratch_dict, "out"); jpayne@69: if (result) Py_INCREF(result); jpayne@69: return result; jpayne@69: } jpayne@69: #else jpayne@69: return NULL; jpayne@69: #endif jpayne@69: } jpayne@69: static void __Pyx_AddTraceback(const char *funcname, int c_line, jpayne@69: int py_line, const char *filename) { jpayne@69: PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; jpayne@69: PyObject *replace = NULL, *getframe = NULL, *frame = NULL; jpayne@69: PyObject *exc_type, *exc_value, *exc_traceback; jpayne@69: int success = 0; jpayne@69: if (c_line) { jpayne@69: (void) __pyx_cfilenm; jpayne@69: (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); jpayne@69: } jpayne@69: PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); jpayne@69: code_object = Py_CompileString("_getframe()", filename, Py_eval_input); jpayne@69: if (unlikely(!code_object)) goto bad; jpayne@69: py_py_line = PyLong_FromLong(py_line); jpayne@69: if (unlikely(!py_py_line)) goto bad; jpayne@69: py_funcname = PyUnicode_FromString(funcname); jpayne@69: if (unlikely(!py_funcname)) goto bad; jpayne@69: dict = PyDict_New(); jpayne@69: if (unlikely(!dict)) goto bad; jpayne@69: { jpayne@69: PyObject *old_code_object = code_object; jpayne@69: code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); jpayne@69: Py_DECREF(old_code_object); jpayne@69: } jpayne@69: if (unlikely(!code_object)) goto bad; jpayne@69: getframe = PySys_GetObject("_getframe"); jpayne@69: if (unlikely(!getframe)) goto bad; jpayne@69: if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; jpayne@69: frame = PyEval_EvalCode(code_object, dict, dict); jpayne@69: if (unlikely(!frame) || frame == Py_None) goto bad; jpayne@69: success = 1; jpayne@69: bad: jpayne@69: PyErr_Restore(exc_type, exc_value, exc_traceback); jpayne@69: Py_XDECREF(code_object); jpayne@69: Py_XDECREF(py_py_line); jpayne@69: Py_XDECREF(py_funcname); jpayne@69: Py_XDECREF(dict); jpayne@69: Py_XDECREF(replace); jpayne@69: if (success) { jpayne@69: PyTraceBack_Here( jpayne@69: (struct _frame*)frame); jpayne@69: } jpayne@69: Py_XDECREF(frame); jpayne@69: } jpayne@69: #else jpayne@69: static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( jpayne@69: const char *funcname, int c_line, jpayne@69: int py_line, const char *filename) { jpayne@69: PyCodeObject *py_code = NULL; jpayne@69: PyObject *py_funcname = NULL; jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: PyObject *py_srcfile = NULL; jpayne@69: py_srcfile = PyString_FromString(filename); jpayne@69: if (!py_srcfile) goto bad; jpayne@69: #endif jpayne@69: if (c_line) { jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); jpayne@69: if (!py_funcname) goto bad; jpayne@69: #else jpayne@69: py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); jpayne@69: if (!py_funcname) goto bad; jpayne@69: funcname = PyUnicode_AsUTF8(py_funcname); jpayne@69: if (!funcname) goto bad; jpayne@69: #endif jpayne@69: } jpayne@69: else { jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: py_funcname = PyString_FromString(funcname); jpayne@69: if (!py_funcname) goto bad; jpayne@69: #endif jpayne@69: } jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: py_code = __Pyx_PyCode_New( jpayne@69: 0, jpayne@69: 0, jpayne@69: 0, jpayne@69: 0, jpayne@69: 0, jpayne@69: 0, jpayne@69: __pyx_empty_bytes, /*PyObject *code,*/ jpayne@69: __pyx_empty_tuple, /*PyObject *consts,*/ jpayne@69: __pyx_empty_tuple, /*PyObject *names,*/ jpayne@69: __pyx_empty_tuple, /*PyObject *varnames,*/ jpayne@69: __pyx_empty_tuple, /*PyObject *freevars,*/ jpayne@69: __pyx_empty_tuple, /*PyObject *cellvars,*/ jpayne@69: py_srcfile, /*PyObject *filename,*/ jpayne@69: py_funcname, /*PyObject *name,*/ jpayne@69: py_line, jpayne@69: __pyx_empty_bytes /*PyObject *lnotab*/ jpayne@69: ); jpayne@69: Py_DECREF(py_srcfile); jpayne@69: #else jpayne@69: py_code = PyCode_NewEmpty(filename, funcname, py_line); jpayne@69: #endif jpayne@69: Py_XDECREF(py_funcname); jpayne@69: return py_code; jpayne@69: bad: jpayne@69: Py_XDECREF(py_funcname); jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: Py_XDECREF(py_srcfile); jpayne@69: #endif jpayne@69: return NULL; jpayne@69: } jpayne@69: static void __Pyx_AddTraceback(const char *funcname, int c_line, jpayne@69: int py_line, const char *filename) { jpayne@69: PyCodeObject *py_code = 0; jpayne@69: PyFrameObject *py_frame = 0; jpayne@69: PyThreadState *tstate = __Pyx_PyThreadState_Current; jpayne@69: PyObject *ptype, *pvalue, *ptraceback; jpayne@69: if (c_line) { jpayne@69: c_line = __Pyx_CLineForTraceback(tstate, c_line); jpayne@69: } jpayne@69: py_code = __pyx_find_code_object(c_line ? -c_line : py_line); jpayne@69: if (!py_code) { jpayne@69: __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); jpayne@69: py_code = __Pyx_CreateCodeObjectForTraceback( jpayne@69: funcname, c_line, py_line, filename); jpayne@69: if (!py_code) { jpayne@69: /* If the code object creation fails, then we should clear the jpayne@69: fetched exception references and propagate the new exception */ jpayne@69: Py_XDECREF(ptype); jpayne@69: Py_XDECREF(pvalue); jpayne@69: Py_XDECREF(ptraceback); jpayne@69: goto bad; jpayne@69: } jpayne@69: __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); jpayne@69: __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); jpayne@69: } jpayne@69: py_frame = PyFrame_New( jpayne@69: tstate, /*PyThreadState *tstate,*/ jpayne@69: py_code, /*PyCodeObject *code,*/ jpayne@69: __pyx_d, /*PyObject *globals,*/ jpayne@69: 0 /*PyObject *locals*/ jpayne@69: ); jpayne@69: if (!py_frame) goto bad; jpayne@69: __Pyx_PyFrame_SetLineNumber(py_frame, py_line); jpayne@69: PyTraceBack_Here(py_frame); jpayne@69: bad: jpayne@69: Py_XDECREF(py_code); jpayne@69: Py_XDECREF(py_frame); jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: /* CIntFromPyVerify */ jpayne@69: #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ jpayne@69: __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) jpayne@69: #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ jpayne@69: __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) jpayne@69: #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ jpayne@69: {\ jpayne@69: func_type value = func_value;\ jpayne@69: if (sizeof(target_type) < sizeof(func_type)) {\ jpayne@69: if (unlikely(value != (func_type) (target_type) value)) {\ jpayne@69: func_type zero = 0;\ jpayne@69: if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ jpayne@69: return (target_type) -1;\ jpayne@69: if (is_unsigned && unlikely(value < zero))\ jpayne@69: goto raise_neg_overflow;\ jpayne@69: else\ jpayne@69: goto raise_overflow;\ jpayne@69: }\ jpayne@69: }\ jpayne@69: return (target_type) value;\ jpayne@69: } jpayne@69: jpayne@69: /* CIntFromPy */ jpayne@69: static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { jpayne@69: #ifdef __Pyx_HAS_GCC_DIAGNOSTIC jpayne@69: #pragma GCC diagnostic push jpayne@69: #pragma GCC diagnostic ignored "-Wconversion" jpayne@69: #endif jpayne@69: const int neg_one = (int) -1, const_zero = (int) 0; jpayne@69: #ifdef __Pyx_HAS_GCC_DIAGNOSTIC jpayne@69: #pragma GCC diagnostic pop jpayne@69: #endif jpayne@69: const int is_unsigned = neg_one > const_zero; jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: if (likely(PyInt_Check(x))) { jpayne@69: if ((sizeof(int) < sizeof(long))) { jpayne@69: __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) jpayne@69: } else { jpayne@69: long val = PyInt_AS_LONG(x); jpayne@69: if (is_unsigned && unlikely(val < 0)) { jpayne@69: goto raise_neg_overflow; jpayne@69: } jpayne@69: return (int) val; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: if (unlikely(!PyLong_Check(x))) { jpayne@69: int val; jpayne@69: PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); jpayne@69: if (!tmp) return (int) -1; jpayne@69: val = __Pyx_PyInt_As_int(tmp); jpayne@69: Py_DECREF(tmp); jpayne@69: return val; jpayne@69: } jpayne@69: if (is_unsigned) { jpayne@69: #if CYTHON_USE_PYLONG_INTERNALS jpayne@69: if (unlikely(__Pyx_PyLong_IsNeg(x))) { jpayne@69: goto raise_neg_overflow; jpayne@69: } else if (__Pyx_PyLong_IsCompact(x)) { jpayne@69: __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) jpayne@69: } else { jpayne@69: const digit* digits = __Pyx_PyLong_Digits(x); jpayne@69: assert(__Pyx_PyLong_DigitCount(x) > 1); jpayne@69: switch (__Pyx_PyLong_DigitCount(x)) { jpayne@69: case 2: jpayne@69: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { jpayne@69: __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) jpayne@69: } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { jpayne@69: return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: case 3: jpayne@69: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { jpayne@69: __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) jpayne@69: } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { jpayne@69: return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: case 4: jpayne@69: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { jpayne@69: __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]))) jpayne@69: } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { jpayne@69: return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 jpayne@69: if (unlikely(Py_SIZE(x) < 0)) { jpayne@69: goto raise_neg_overflow; jpayne@69: } jpayne@69: #else jpayne@69: { jpayne@69: int result = PyObject_RichCompareBool(x, Py_False, Py_LT); jpayne@69: if (unlikely(result < 0)) jpayne@69: return (int) -1; jpayne@69: if (unlikely(result == 1)) jpayne@69: goto raise_neg_overflow; jpayne@69: } jpayne@69: #endif jpayne@69: if ((sizeof(int) <= sizeof(unsigned long))) { jpayne@69: __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) jpayne@69: #ifdef HAVE_LONG_LONG jpayne@69: } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { jpayne@69: __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) jpayne@69: #endif jpayne@69: } jpayne@69: } else { jpayne@69: #if CYTHON_USE_PYLONG_INTERNALS jpayne@69: if (__Pyx_PyLong_IsCompact(x)) { jpayne@69: __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) jpayne@69: } else { jpayne@69: const digit* digits = __Pyx_PyLong_Digits(x); jpayne@69: assert(__Pyx_PyLong_DigitCount(x) > 1); jpayne@69: switch (__Pyx_PyLong_SignedDigitCount(x)) { jpayne@69: case -2: jpayne@69: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { jpayne@69: __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) jpayne@69: } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { jpayne@69: return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: case 2: jpayne@69: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { jpayne@69: __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) jpayne@69: } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { jpayne@69: return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: case -3: jpayne@69: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { jpayne@69: __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) jpayne@69: } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { jpayne@69: return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: case 3: jpayne@69: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { jpayne@69: __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) jpayne@69: } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { jpayne@69: return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: case -4: jpayne@69: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { jpayne@69: __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]))) jpayne@69: } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { jpayne@69: return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: case 4: jpayne@69: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { jpayne@69: __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]))) jpayne@69: } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { jpayne@69: return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: if ((sizeof(int) <= sizeof(long))) { jpayne@69: __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) jpayne@69: #ifdef HAVE_LONG_LONG jpayne@69: } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { jpayne@69: __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) jpayne@69: #endif jpayne@69: } jpayne@69: } jpayne@69: { jpayne@69: int val; jpayne@69: int ret = -1; jpayne@69: #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API jpayne@69: Py_ssize_t bytes_copied = PyLong_AsNativeBytes( jpayne@69: x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); jpayne@69: if (unlikely(bytes_copied == -1)) { jpayne@69: } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { jpayne@69: goto raise_overflow; jpayne@69: } else { jpayne@69: ret = 0; jpayne@69: } jpayne@69: #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) jpayne@69: int one = 1; int is_little = (int)*(unsigned char *)&one; jpayne@69: unsigned char *bytes = (unsigned char *)&val; jpayne@69: ret = _PyLong_AsByteArray((PyLongObject *)x, jpayne@69: bytes, sizeof(val), jpayne@69: is_little, !is_unsigned); jpayne@69: #else jpayne@69: PyObject *v; jpayne@69: PyObject *stepval = NULL, *mask = NULL, *shift = NULL; jpayne@69: int bits, remaining_bits, is_negative = 0; jpayne@69: int chunk_size = (sizeof(long) < 8) ? 30 : 62; jpayne@69: if (likely(PyLong_CheckExact(x))) { jpayne@69: v = __Pyx_NewRef(x); jpayne@69: } else { jpayne@69: v = PyNumber_Long(x); jpayne@69: if (unlikely(!v)) return (int) -1; jpayne@69: assert(PyLong_CheckExact(v)); jpayne@69: } jpayne@69: { jpayne@69: int result = PyObject_RichCompareBool(v, Py_False, Py_LT); jpayne@69: if (unlikely(result < 0)) { jpayne@69: Py_DECREF(v); jpayne@69: return (int) -1; jpayne@69: } jpayne@69: is_negative = result == 1; jpayne@69: } jpayne@69: if (is_unsigned && unlikely(is_negative)) { jpayne@69: Py_DECREF(v); jpayne@69: goto raise_neg_overflow; jpayne@69: } else if (is_negative) { jpayne@69: stepval = PyNumber_Invert(v); jpayne@69: Py_DECREF(v); jpayne@69: if (unlikely(!stepval)) jpayne@69: return (int) -1; jpayne@69: } else { jpayne@69: stepval = v; jpayne@69: } jpayne@69: v = NULL; jpayne@69: val = (int) 0; jpayne@69: mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; jpayne@69: shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; jpayne@69: for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { jpayne@69: PyObject *tmp, *digit; jpayne@69: long idigit; jpayne@69: digit = PyNumber_And(stepval, mask); jpayne@69: if (unlikely(!digit)) goto done; jpayne@69: idigit = PyLong_AsLong(digit); jpayne@69: Py_DECREF(digit); jpayne@69: if (unlikely(idigit < 0)) goto done; jpayne@69: val |= ((int) idigit) << bits; jpayne@69: tmp = PyNumber_Rshift(stepval, shift); jpayne@69: if (unlikely(!tmp)) goto done; jpayne@69: Py_DECREF(stepval); stepval = tmp; jpayne@69: } jpayne@69: Py_DECREF(shift); shift = NULL; jpayne@69: Py_DECREF(mask); mask = NULL; jpayne@69: { jpayne@69: long idigit = PyLong_AsLong(stepval); jpayne@69: if (unlikely(idigit < 0)) goto done; jpayne@69: remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); jpayne@69: if (unlikely(idigit >= (1L << remaining_bits))) jpayne@69: goto raise_overflow; jpayne@69: val |= ((int) idigit) << bits; jpayne@69: } jpayne@69: if (!is_unsigned) { jpayne@69: if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) jpayne@69: goto raise_overflow; jpayne@69: if (is_negative) jpayne@69: val = ~val; jpayne@69: } jpayne@69: ret = 0; jpayne@69: done: jpayne@69: Py_XDECREF(shift); jpayne@69: Py_XDECREF(mask); jpayne@69: Py_XDECREF(stepval); jpayne@69: #endif jpayne@69: if (unlikely(ret)) jpayne@69: return (int) -1; jpayne@69: return val; jpayne@69: } jpayne@69: raise_overflow: jpayne@69: PyErr_SetString(PyExc_OverflowError, jpayne@69: "value too large to convert to int"); jpayne@69: return (int) -1; jpayne@69: raise_neg_overflow: jpayne@69: PyErr_SetString(PyExc_OverflowError, jpayne@69: "can't convert negative value to int"); jpayne@69: return (int) -1; jpayne@69: } jpayne@69: jpayne@69: /* CIntFromPy */ jpayne@69: static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { jpayne@69: #ifdef __Pyx_HAS_GCC_DIAGNOSTIC jpayne@69: #pragma GCC diagnostic push jpayne@69: #pragma GCC diagnostic ignored "-Wconversion" jpayne@69: #endif jpayne@69: const char neg_one = (char) -1, const_zero = (char) 0; jpayne@69: #ifdef __Pyx_HAS_GCC_DIAGNOSTIC jpayne@69: #pragma GCC diagnostic pop jpayne@69: #endif jpayne@69: const int is_unsigned = neg_one > const_zero; jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: if (likely(PyInt_Check(x))) { jpayne@69: if ((sizeof(char) < sizeof(long))) { jpayne@69: __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x)) jpayne@69: } else { jpayne@69: long val = PyInt_AS_LONG(x); jpayne@69: if (is_unsigned && unlikely(val < 0)) { jpayne@69: goto raise_neg_overflow; jpayne@69: } jpayne@69: return (char) val; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: if (unlikely(!PyLong_Check(x))) { jpayne@69: char val; jpayne@69: PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); jpayne@69: if (!tmp) return (char) -1; jpayne@69: val = __Pyx_PyInt_As_char(tmp); jpayne@69: Py_DECREF(tmp); jpayne@69: return val; jpayne@69: } jpayne@69: if (is_unsigned) { jpayne@69: #if CYTHON_USE_PYLONG_INTERNALS jpayne@69: if (unlikely(__Pyx_PyLong_IsNeg(x))) { jpayne@69: goto raise_neg_overflow; jpayne@69: } else if (__Pyx_PyLong_IsCompact(x)) { jpayne@69: __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) jpayne@69: } else { jpayne@69: const digit* digits = __Pyx_PyLong_Digits(x); jpayne@69: assert(__Pyx_PyLong_DigitCount(x) > 1); jpayne@69: switch (__Pyx_PyLong_DigitCount(x)) { jpayne@69: case 2: jpayne@69: if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { jpayne@69: __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) jpayne@69: } else if ((8 * sizeof(char) >= 2 * PyLong_SHIFT)) { jpayne@69: return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: case 3: jpayne@69: if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { jpayne@69: __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) jpayne@69: } else if ((8 * sizeof(char) >= 3 * PyLong_SHIFT)) { jpayne@69: return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: case 4: jpayne@69: if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { jpayne@69: __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) jpayne@69: } else if ((8 * sizeof(char) >= 4 * PyLong_SHIFT)) { jpayne@69: return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 jpayne@69: if (unlikely(Py_SIZE(x) < 0)) { jpayne@69: goto raise_neg_overflow; jpayne@69: } jpayne@69: #else jpayne@69: { jpayne@69: int result = PyObject_RichCompareBool(x, Py_False, Py_LT); jpayne@69: if (unlikely(result < 0)) jpayne@69: return (char) -1; jpayne@69: if (unlikely(result == 1)) jpayne@69: goto raise_neg_overflow; jpayne@69: } jpayne@69: #endif jpayne@69: if ((sizeof(char) <= sizeof(unsigned long))) { jpayne@69: __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x)) jpayne@69: #ifdef HAVE_LONG_LONG jpayne@69: } else if ((sizeof(char) <= sizeof(unsigned PY_LONG_LONG))) { jpayne@69: __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) jpayne@69: #endif jpayne@69: } jpayne@69: } else { jpayne@69: #if CYTHON_USE_PYLONG_INTERNALS jpayne@69: if (__Pyx_PyLong_IsCompact(x)) { jpayne@69: __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) jpayne@69: } else { jpayne@69: const digit* digits = __Pyx_PyLong_Digits(x); jpayne@69: assert(__Pyx_PyLong_DigitCount(x) > 1); jpayne@69: switch (__Pyx_PyLong_SignedDigitCount(x)) { jpayne@69: case -2: jpayne@69: if ((8 * sizeof(char) - 1 > 1 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { jpayne@69: __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) jpayne@69: } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) { jpayne@69: return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: case 2: jpayne@69: if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { jpayne@69: __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) jpayne@69: } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) { jpayne@69: return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: case -3: jpayne@69: if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { jpayne@69: __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) jpayne@69: } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) { jpayne@69: return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: case 3: jpayne@69: if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { jpayne@69: __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) jpayne@69: } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) { jpayne@69: return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: case -4: jpayne@69: if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { jpayne@69: __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) jpayne@69: } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) { jpayne@69: return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: case 4: jpayne@69: if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { jpayne@69: __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) jpayne@69: } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) { jpayne@69: return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: if ((sizeof(char) <= sizeof(long))) { jpayne@69: __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x)) jpayne@69: #ifdef HAVE_LONG_LONG jpayne@69: } else if ((sizeof(char) <= sizeof(PY_LONG_LONG))) { jpayne@69: __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x)) jpayne@69: #endif jpayne@69: } jpayne@69: } jpayne@69: { jpayne@69: char val; jpayne@69: int ret = -1; jpayne@69: #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API jpayne@69: Py_ssize_t bytes_copied = PyLong_AsNativeBytes( jpayne@69: x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); jpayne@69: if (unlikely(bytes_copied == -1)) { jpayne@69: } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { jpayne@69: goto raise_overflow; jpayne@69: } else { jpayne@69: ret = 0; jpayne@69: } jpayne@69: #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) jpayne@69: int one = 1; int is_little = (int)*(unsigned char *)&one; jpayne@69: unsigned char *bytes = (unsigned char *)&val; jpayne@69: ret = _PyLong_AsByteArray((PyLongObject *)x, jpayne@69: bytes, sizeof(val), jpayne@69: is_little, !is_unsigned); jpayne@69: #else jpayne@69: PyObject *v; jpayne@69: PyObject *stepval = NULL, *mask = NULL, *shift = NULL; jpayne@69: int bits, remaining_bits, is_negative = 0; jpayne@69: int chunk_size = (sizeof(long) < 8) ? 30 : 62; jpayne@69: if (likely(PyLong_CheckExact(x))) { jpayne@69: v = __Pyx_NewRef(x); jpayne@69: } else { jpayne@69: v = PyNumber_Long(x); jpayne@69: if (unlikely(!v)) return (char) -1; jpayne@69: assert(PyLong_CheckExact(v)); jpayne@69: } jpayne@69: { jpayne@69: int result = PyObject_RichCompareBool(v, Py_False, Py_LT); jpayne@69: if (unlikely(result < 0)) { jpayne@69: Py_DECREF(v); jpayne@69: return (char) -1; jpayne@69: } jpayne@69: is_negative = result == 1; jpayne@69: } jpayne@69: if (is_unsigned && unlikely(is_negative)) { jpayne@69: Py_DECREF(v); jpayne@69: goto raise_neg_overflow; jpayne@69: } else if (is_negative) { jpayne@69: stepval = PyNumber_Invert(v); jpayne@69: Py_DECREF(v); jpayne@69: if (unlikely(!stepval)) jpayne@69: return (char) -1; jpayne@69: } else { jpayne@69: stepval = v; jpayne@69: } jpayne@69: v = NULL; jpayne@69: val = (char) 0; jpayne@69: mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; jpayne@69: shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; jpayne@69: for (bits = 0; bits < (int) sizeof(char) * 8 - chunk_size; bits += chunk_size) { jpayne@69: PyObject *tmp, *digit; jpayne@69: long idigit; jpayne@69: digit = PyNumber_And(stepval, mask); jpayne@69: if (unlikely(!digit)) goto done; jpayne@69: idigit = PyLong_AsLong(digit); jpayne@69: Py_DECREF(digit); jpayne@69: if (unlikely(idigit < 0)) goto done; jpayne@69: val |= ((char) idigit) << bits; jpayne@69: tmp = PyNumber_Rshift(stepval, shift); jpayne@69: if (unlikely(!tmp)) goto done; jpayne@69: Py_DECREF(stepval); stepval = tmp; jpayne@69: } jpayne@69: Py_DECREF(shift); shift = NULL; jpayne@69: Py_DECREF(mask); mask = NULL; jpayne@69: { jpayne@69: long idigit = PyLong_AsLong(stepval); jpayne@69: if (unlikely(idigit < 0)) goto done; jpayne@69: remaining_bits = ((int) sizeof(char) * 8) - bits - (is_unsigned ? 0 : 1); jpayne@69: if (unlikely(idigit >= (1L << remaining_bits))) jpayne@69: goto raise_overflow; jpayne@69: val |= ((char) idigit) << bits; jpayne@69: } jpayne@69: if (!is_unsigned) { jpayne@69: if (unlikely(val & (((char) 1) << (sizeof(char) * 8 - 1)))) jpayne@69: goto raise_overflow; jpayne@69: if (is_negative) jpayne@69: val = ~val; jpayne@69: } jpayne@69: ret = 0; jpayne@69: done: jpayne@69: Py_XDECREF(shift); jpayne@69: Py_XDECREF(mask); jpayne@69: Py_XDECREF(stepval); jpayne@69: #endif jpayne@69: if (unlikely(ret)) jpayne@69: return (char) -1; jpayne@69: return val; jpayne@69: } jpayne@69: raise_overflow: jpayne@69: PyErr_SetString(PyExc_OverflowError, jpayne@69: "value too large to convert to char"); jpayne@69: return (char) -1; jpayne@69: raise_neg_overflow: jpayne@69: PyErr_SetString(PyExc_OverflowError, jpayne@69: "can't convert negative value to char"); jpayne@69: return (char) -1; jpayne@69: } jpayne@69: jpayne@69: /* CIntToPy */ jpayne@69: static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { jpayne@69: #ifdef __Pyx_HAS_GCC_DIAGNOSTIC jpayne@69: #pragma GCC diagnostic push jpayne@69: #pragma GCC diagnostic ignored "-Wconversion" jpayne@69: #endif jpayne@69: const int neg_one = (int) -1, const_zero = (int) 0; jpayne@69: #ifdef __Pyx_HAS_GCC_DIAGNOSTIC jpayne@69: #pragma GCC diagnostic pop jpayne@69: #endif jpayne@69: const int is_unsigned = neg_one > const_zero; jpayne@69: if (is_unsigned) { jpayne@69: if (sizeof(int) < sizeof(long)) { jpayne@69: return PyInt_FromLong((long) value); jpayne@69: } else if (sizeof(int) <= sizeof(unsigned long)) { jpayne@69: return PyLong_FromUnsignedLong((unsigned long) value); jpayne@69: #ifdef HAVE_LONG_LONG jpayne@69: } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { jpayne@69: return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); jpayne@69: #endif jpayne@69: } jpayne@69: } else { jpayne@69: if (sizeof(int) <= sizeof(long)) { jpayne@69: return PyInt_FromLong((long) value); jpayne@69: #ifdef HAVE_LONG_LONG jpayne@69: } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { jpayne@69: return PyLong_FromLongLong((PY_LONG_LONG) value); jpayne@69: #endif jpayne@69: } jpayne@69: } jpayne@69: { jpayne@69: unsigned char *bytes = (unsigned char *)&value; jpayne@69: #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 jpayne@69: if (is_unsigned) { jpayne@69: return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); jpayne@69: } else { jpayne@69: return PyLong_FromNativeBytes(bytes, sizeof(value), -1); jpayne@69: } jpayne@69: #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 jpayne@69: int one = 1; int little = (int)*(unsigned char *)&one; jpayne@69: return _PyLong_FromByteArray(bytes, sizeof(int), jpayne@69: little, !is_unsigned); jpayne@69: #else jpayne@69: int one = 1; int little = (int)*(unsigned char *)&one; jpayne@69: PyObject *from_bytes, *result = NULL; jpayne@69: PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; jpayne@69: from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); jpayne@69: if (!from_bytes) return NULL; jpayne@69: py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); jpayne@69: if (!py_bytes) goto limited_bad; jpayne@69: order_str = PyUnicode_FromString(little ? "little" : "big"); jpayne@69: if (!order_str) goto limited_bad; jpayne@69: arg_tuple = PyTuple_Pack(2, py_bytes, order_str); jpayne@69: if (!arg_tuple) goto limited_bad; jpayne@69: if (!is_unsigned) { jpayne@69: kwds = PyDict_New(); jpayne@69: if (!kwds) goto limited_bad; jpayne@69: if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; jpayne@69: } jpayne@69: result = PyObject_Call(from_bytes, arg_tuple, kwds); jpayne@69: limited_bad: jpayne@69: Py_XDECREF(kwds); jpayne@69: Py_XDECREF(arg_tuple); jpayne@69: Py_XDECREF(order_str); jpayne@69: Py_XDECREF(py_bytes); jpayne@69: Py_XDECREF(from_bytes); jpayne@69: return result; jpayne@69: #endif jpayne@69: } jpayne@69: } jpayne@69: jpayne@69: /* CIntFromPy */ jpayne@69: static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *x) { jpayne@69: #ifdef __Pyx_HAS_GCC_DIAGNOSTIC jpayne@69: #pragma GCC diagnostic push jpayne@69: #pragma GCC diagnostic ignored "-Wconversion" jpayne@69: #endif jpayne@69: const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; jpayne@69: #ifdef __Pyx_HAS_GCC_DIAGNOSTIC jpayne@69: #pragma GCC diagnostic pop jpayne@69: #endif jpayne@69: const int is_unsigned = neg_one > const_zero; jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: if (likely(PyInt_Check(x))) { jpayne@69: if ((sizeof(int32_t) < sizeof(long))) { jpayne@69: __PYX_VERIFY_RETURN_INT(int32_t, long, PyInt_AS_LONG(x)) jpayne@69: } else { jpayne@69: long val = PyInt_AS_LONG(x); jpayne@69: if (is_unsigned && unlikely(val < 0)) { jpayne@69: goto raise_neg_overflow; jpayne@69: } jpayne@69: return (int32_t) val; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: if (unlikely(!PyLong_Check(x))) { jpayne@69: int32_t val; jpayne@69: PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); jpayne@69: if (!tmp) return (int32_t) -1; jpayne@69: val = __Pyx_PyInt_As_int32_t(tmp); jpayne@69: Py_DECREF(tmp); jpayne@69: return val; jpayne@69: } jpayne@69: if (is_unsigned) { jpayne@69: #if CYTHON_USE_PYLONG_INTERNALS jpayne@69: if (unlikely(__Pyx_PyLong_IsNeg(x))) { jpayne@69: goto raise_neg_overflow; jpayne@69: } else if (__Pyx_PyLong_IsCompact(x)) { jpayne@69: __PYX_VERIFY_RETURN_INT(int32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) jpayne@69: } else { jpayne@69: const digit* digits = __Pyx_PyLong_Digits(x); jpayne@69: assert(__Pyx_PyLong_DigitCount(x) > 1); jpayne@69: switch (__Pyx_PyLong_DigitCount(x)) { jpayne@69: case 2: jpayne@69: if ((8 * sizeof(int32_t) > 1 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { jpayne@69: __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) jpayne@69: } else if ((8 * sizeof(int32_t) >= 2 * PyLong_SHIFT)) { jpayne@69: return (int32_t) (((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: case 3: jpayne@69: if ((8 * sizeof(int32_t) > 2 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { jpayne@69: __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) jpayne@69: } else if ((8 * sizeof(int32_t) >= 3 * PyLong_SHIFT)) { jpayne@69: return (int32_t) (((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: case 4: jpayne@69: if ((8 * sizeof(int32_t) > 3 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { jpayne@69: __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) jpayne@69: } else if ((8 * sizeof(int32_t) >= 4 * PyLong_SHIFT)) { jpayne@69: return (int32_t) (((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 jpayne@69: if (unlikely(Py_SIZE(x) < 0)) { jpayne@69: goto raise_neg_overflow; jpayne@69: } jpayne@69: #else jpayne@69: { jpayne@69: int result = PyObject_RichCompareBool(x, Py_False, Py_LT); jpayne@69: if (unlikely(result < 0)) jpayne@69: return (int32_t) -1; jpayne@69: if (unlikely(result == 1)) jpayne@69: goto raise_neg_overflow; jpayne@69: } jpayne@69: #endif jpayne@69: if ((sizeof(int32_t) <= sizeof(unsigned long))) { jpayne@69: __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned long, PyLong_AsUnsignedLong(x)) jpayne@69: #ifdef HAVE_LONG_LONG jpayne@69: } else if ((sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG))) { jpayne@69: __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) jpayne@69: #endif jpayne@69: } jpayne@69: } else { jpayne@69: #if CYTHON_USE_PYLONG_INTERNALS jpayne@69: if (__Pyx_PyLong_IsCompact(x)) { jpayne@69: __PYX_VERIFY_RETURN_INT(int32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) jpayne@69: } else { jpayne@69: const digit* digits = __Pyx_PyLong_Digits(x); jpayne@69: assert(__Pyx_PyLong_DigitCount(x) > 1); jpayne@69: switch (__Pyx_PyLong_SignedDigitCount(x)) { jpayne@69: case -2: jpayne@69: if ((8 * sizeof(int32_t) - 1 > 1 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { jpayne@69: __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) jpayne@69: } else if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) { jpayne@69: return (int32_t) (((int32_t)-1)*(((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: case 2: jpayne@69: if ((8 * sizeof(int32_t) > 1 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { jpayne@69: __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) jpayne@69: } else if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) { jpayne@69: return (int32_t) ((((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: case -3: jpayne@69: if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { jpayne@69: __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) jpayne@69: } else if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) { jpayne@69: return (int32_t) (((int32_t)-1)*(((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: case 3: jpayne@69: if ((8 * sizeof(int32_t) > 2 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { jpayne@69: __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) jpayne@69: } else if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) { jpayne@69: return (int32_t) ((((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: case -4: jpayne@69: if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { jpayne@69: __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) jpayne@69: } else if ((8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT)) { jpayne@69: return (int32_t) (((int32_t)-1)*(((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: case 4: jpayne@69: if ((8 * sizeof(int32_t) > 3 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { jpayne@69: __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) jpayne@69: } else if ((8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT)) { jpayne@69: return (int32_t) ((((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: if ((sizeof(int32_t) <= sizeof(long))) { jpayne@69: __PYX_VERIFY_RETURN_INT_EXC(int32_t, long, PyLong_AsLong(x)) jpayne@69: #ifdef HAVE_LONG_LONG jpayne@69: } else if ((sizeof(int32_t) <= sizeof(PY_LONG_LONG))) { jpayne@69: __PYX_VERIFY_RETURN_INT_EXC(int32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) jpayne@69: #endif jpayne@69: } jpayne@69: } jpayne@69: { jpayne@69: int32_t val; jpayne@69: int ret = -1; jpayne@69: #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API jpayne@69: Py_ssize_t bytes_copied = PyLong_AsNativeBytes( jpayne@69: x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); jpayne@69: if (unlikely(bytes_copied == -1)) { jpayne@69: } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { jpayne@69: goto raise_overflow; jpayne@69: } else { jpayne@69: ret = 0; jpayne@69: } jpayne@69: #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) jpayne@69: int one = 1; int is_little = (int)*(unsigned char *)&one; jpayne@69: unsigned char *bytes = (unsigned char *)&val; jpayne@69: ret = _PyLong_AsByteArray((PyLongObject *)x, jpayne@69: bytes, sizeof(val), jpayne@69: is_little, !is_unsigned); jpayne@69: #else jpayne@69: PyObject *v; jpayne@69: PyObject *stepval = NULL, *mask = NULL, *shift = NULL; jpayne@69: int bits, remaining_bits, is_negative = 0; jpayne@69: int chunk_size = (sizeof(long) < 8) ? 30 : 62; jpayne@69: if (likely(PyLong_CheckExact(x))) { jpayne@69: v = __Pyx_NewRef(x); jpayne@69: } else { jpayne@69: v = PyNumber_Long(x); jpayne@69: if (unlikely(!v)) return (int32_t) -1; jpayne@69: assert(PyLong_CheckExact(v)); jpayne@69: } jpayne@69: { jpayne@69: int result = PyObject_RichCompareBool(v, Py_False, Py_LT); jpayne@69: if (unlikely(result < 0)) { jpayne@69: Py_DECREF(v); jpayne@69: return (int32_t) -1; jpayne@69: } jpayne@69: is_negative = result == 1; jpayne@69: } jpayne@69: if (is_unsigned && unlikely(is_negative)) { jpayne@69: Py_DECREF(v); jpayne@69: goto raise_neg_overflow; jpayne@69: } else if (is_negative) { jpayne@69: stepval = PyNumber_Invert(v); jpayne@69: Py_DECREF(v); jpayne@69: if (unlikely(!stepval)) jpayne@69: return (int32_t) -1; jpayne@69: } else { jpayne@69: stepval = v; jpayne@69: } jpayne@69: v = NULL; jpayne@69: val = (int32_t) 0; jpayne@69: mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; jpayne@69: shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; jpayne@69: for (bits = 0; bits < (int) sizeof(int32_t) * 8 - chunk_size; bits += chunk_size) { jpayne@69: PyObject *tmp, *digit; jpayne@69: long idigit; jpayne@69: digit = PyNumber_And(stepval, mask); jpayne@69: if (unlikely(!digit)) goto done; jpayne@69: idigit = PyLong_AsLong(digit); jpayne@69: Py_DECREF(digit); jpayne@69: if (unlikely(idigit < 0)) goto done; jpayne@69: val |= ((int32_t) idigit) << bits; jpayne@69: tmp = PyNumber_Rshift(stepval, shift); jpayne@69: if (unlikely(!tmp)) goto done; jpayne@69: Py_DECREF(stepval); stepval = tmp; jpayne@69: } jpayne@69: Py_DECREF(shift); shift = NULL; jpayne@69: Py_DECREF(mask); mask = NULL; jpayne@69: { jpayne@69: long idigit = PyLong_AsLong(stepval); jpayne@69: if (unlikely(idigit < 0)) goto done; jpayne@69: remaining_bits = ((int) sizeof(int32_t) * 8) - bits - (is_unsigned ? 0 : 1); jpayne@69: if (unlikely(idigit >= (1L << remaining_bits))) jpayne@69: goto raise_overflow; jpayne@69: val |= ((int32_t) idigit) << bits; jpayne@69: } jpayne@69: if (!is_unsigned) { jpayne@69: if (unlikely(val & (((int32_t) 1) << (sizeof(int32_t) * 8 - 1)))) jpayne@69: goto raise_overflow; jpayne@69: if (is_negative) jpayne@69: val = ~val; jpayne@69: } jpayne@69: ret = 0; jpayne@69: done: jpayne@69: Py_XDECREF(shift); jpayne@69: Py_XDECREF(mask); jpayne@69: Py_XDECREF(stepval); jpayne@69: #endif jpayne@69: if (unlikely(ret)) jpayne@69: return (int32_t) -1; jpayne@69: return val; jpayne@69: } jpayne@69: raise_overflow: jpayne@69: PyErr_SetString(PyExc_OverflowError, jpayne@69: "value too large to convert to int32_t"); jpayne@69: return (int32_t) -1; jpayne@69: raise_neg_overflow: jpayne@69: PyErr_SetString(PyExc_OverflowError, jpayne@69: "can't convert negative value to int32_t"); jpayne@69: return (int32_t) -1; jpayne@69: } jpayne@69: jpayne@69: /* CIntToPy */ jpayne@69: static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { jpayne@69: #ifdef __Pyx_HAS_GCC_DIAGNOSTIC jpayne@69: #pragma GCC diagnostic push jpayne@69: #pragma GCC diagnostic ignored "-Wconversion" jpayne@69: #endif jpayne@69: const long neg_one = (long) -1, const_zero = (long) 0; jpayne@69: #ifdef __Pyx_HAS_GCC_DIAGNOSTIC jpayne@69: #pragma GCC diagnostic pop jpayne@69: #endif jpayne@69: const int is_unsigned = neg_one > const_zero; jpayne@69: if (is_unsigned) { jpayne@69: if (sizeof(long) < sizeof(long)) { jpayne@69: return PyInt_FromLong((long) value); jpayne@69: } else if (sizeof(long) <= sizeof(unsigned long)) { jpayne@69: return PyLong_FromUnsignedLong((unsigned long) value); jpayne@69: #ifdef HAVE_LONG_LONG jpayne@69: } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { jpayne@69: return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); jpayne@69: #endif jpayne@69: } jpayne@69: } else { jpayne@69: if (sizeof(long) <= sizeof(long)) { jpayne@69: return PyInt_FromLong((long) value); jpayne@69: #ifdef HAVE_LONG_LONG jpayne@69: } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { jpayne@69: return PyLong_FromLongLong((PY_LONG_LONG) value); jpayne@69: #endif jpayne@69: } jpayne@69: } jpayne@69: { jpayne@69: unsigned char *bytes = (unsigned char *)&value; jpayne@69: #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 jpayne@69: if (is_unsigned) { jpayne@69: return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); jpayne@69: } else { jpayne@69: return PyLong_FromNativeBytes(bytes, sizeof(value), -1); jpayne@69: } jpayne@69: #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 jpayne@69: int one = 1; int little = (int)*(unsigned char *)&one; jpayne@69: return _PyLong_FromByteArray(bytes, sizeof(long), jpayne@69: little, !is_unsigned); jpayne@69: #else jpayne@69: int one = 1; int little = (int)*(unsigned char *)&one; jpayne@69: PyObject *from_bytes, *result = NULL; jpayne@69: PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; jpayne@69: from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); jpayne@69: if (!from_bytes) return NULL; jpayne@69: py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); jpayne@69: if (!py_bytes) goto limited_bad; jpayne@69: order_str = PyUnicode_FromString(little ? "little" : "big"); jpayne@69: if (!order_str) goto limited_bad; jpayne@69: arg_tuple = PyTuple_Pack(2, py_bytes, order_str); jpayne@69: if (!arg_tuple) goto limited_bad; jpayne@69: if (!is_unsigned) { jpayne@69: kwds = PyDict_New(); jpayne@69: if (!kwds) goto limited_bad; jpayne@69: if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; jpayne@69: } jpayne@69: result = PyObject_Call(from_bytes, arg_tuple, kwds); jpayne@69: limited_bad: jpayne@69: Py_XDECREF(kwds); jpayne@69: Py_XDECREF(arg_tuple); jpayne@69: Py_XDECREF(order_str); jpayne@69: Py_XDECREF(py_bytes); jpayne@69: Py_XDECREF(from_bytes); jpayne@69: return result; jpayne@69: #endif jpayne@69: } jpayne@69: } jpayne@69: jpayne@69: /* CIntToPy */ jpayne@69: static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) { jpayne@69: #ifdef __Pyx_HAS_GCC_DIAGNOSTIC jpayne@69: #pragma GCC diagnostic push jpayne@69: #pragma GCC diagnostic ignored "-Wconversion" jpayne@69: #endif jpayne@69: const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; jpayne@69: #ifdef __Pyx_HAS_GCC_DIAGNOSTIC jpayne@69: #pragma GCC diagnostic pop jpayne@69: #endif jpayne@69: const int is_unsigned = neg_one > const_zero; jpayne@69: if (is_unsigned) { jpayne@69: if (sizeof(int32_t) < sizeof(long)) { jpayne@69: return PyInt_FromLong((long) value); jpayne@69: } else if (sizeof(int32_t) <= sizeof(unsigned long)) { jpayne@69: return PyLong_FromUnsignedLong((unsigned long) value); jpayne@69: #ifdef HAVE_LONG_LONG jpayne@69: } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) { jpayne@69: return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); jpayne@69: #endif jpayne@69: } jpayne@69: } else { jpayne@69: if (sizeof(int32_t) <= sizeof(long)) { jpayne@69: return PyInt_FromLong((long) value); jpayne@69: #ifdef HAVE_LONG_LONG jpayne@69: } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) { jpayne@69: return PyLong_FromLongLong((PY_LONG_LONG) value); jpayne@69: #endif jpayne@69: } jpayne@69: } jpayne@69: { jpayne@69: unsigned char *bytes = (unsigned char *)&value; jpayne@69: #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 jpayne@69: if (is_unsigned) { jpayne@69: return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); jpayne@69: } else { jpayne@69: return PyLong_FromNativeBytes(bytes, sizeof(value), -1); jpayne@69: } jpayne@69: #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 jpayne@69: int one = 1; int little = (int)*(unsigned char *)&one; jpayne@69: return _PyLong_FromByteArray(bytes, sizeof(int32_t), jpayne@69: little, !is_unsigned); jpayne@69: #else jpayne@69: int one = 1; int little = (int)*(unsigned char *)&one; jpayne@69: PyObject *from_bytes, *result = NULL; jpayne@69: PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; jpayne@69: from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); jpayne@69: if (!from_bytes) return NULL; jpayne@69: py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int32_t)); jpayne@69: if (!py_bytes) goto limited_bad; jpayne@69: order_str = PyUnicode_FromString(little ? "little" : "big"); jpayne@69: if (!order_str) goto limited_bad; jpayne@69: arg_tuple = PyTuple_Pack(2, py_bytes, order_str); jpayne@69: if (!arg_tuple) goto limited_bad; jpayne@69: if (!is_unsigned) { jpayne@69: kwds = PyDict_New(); jpayne@69: if (!kwds) goto limited_bad; jpayne@69: if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; jpayne@69: } jpayne@69: result = PyObject_Call(from_bytes, arg_tuple, kwds); jpayne@69: limited_bad: jpayne@69: Py_XDECREF(kwds); jpayne@69: Py_XDECREF(arg_tuple); jpayne@69: Py_XDECREF(order_str); jpayne@69: Py_XDECREF(py_bytes); jpayne@69: Py_XDECREF(from_bytes); jpayne@69: return result; jpayne@69: #endif jpayne@69: } jpayne@69: } jpayne@69: jpayne@69: /* FormatTypeName */ jpayne@69: #if CYTHON_COMPILING_IN_LIMITED_API jpayne@69: static __Pyx_TypeName jpayne@69: __Pyx_PyType_GetName(PyTypeObject* tp) jpayne@69: { jpayne@69: PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, jpayne@69: __pyx_n_s_name_2); jpayne@69: if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { jpayne@69: PyErr_Clear(); jpayne@69: Py_XDECREF(name); jpayne@69: name = __Pyx_NewRef(__pyx_n_s__33); jpayne@69: } jpayne@69: return name; jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: /* CIntFromPy */ jpayne@69: static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { jpayne@69: #ifdef __Pyx_HAS_GCC_DIAGNOSTIC jpayne@69: #pragma GCC diagnostic push jpayne@69: #pragma GCC diagnostic ignored "-Wconversion" jpayne@69: #endif jpayne@69: const long neg_one = (long) -1, const_zero = (long) 0; jpayne@69: #ifdef __Pyx_HAS_GCC_DIAGNOSTIC jpayne@69: #pragma GCC diagnostic pop jpayne@69: #endif jpayne@69: const int is_unsigned = neg_one > const_zero; jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: if (likely(PyInt_Check(x))) { jpayne@69: if ((sizeof(long) < sizeof(long))) { jpayne@69: __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) jpayne@69: } else { jpayne@69: long val = PyInt_AS_LONG(x); jpayne@69: if (is_unsigned && unlikely(val < 0)) { jpayne@69: goto raise_neg_overflow; jpayne@69: } jpayne@69: return (long) val; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: if (unlikely(!PyLong_Check(x))) { jpayne@69: long val; jpayne@69: PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); jpayne@69: if (!tmp) return (long) -1; jpayne@69: val = __Pyx_PyInt_As_long(tmp); jpayne@69: Py_DECREF(tmp); jpayne@69: return val; jpayne@69: } jpayne@69: if (is_unsigned) { jpayne@69: #if CYTHON_USE_PYLONG_INTERNALS jpayne@69: if (unlikely(__Pyx_PyLong_IsNeg(x))) { jpayne@69: goto raise_neg_overflow; jpayne@69: } else if (__Pyx_PyLong_IsCompact(x)) { jpayne@69: __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) jpayne@69: } else { jpayne@69: const digit* digits = __Pyx_PyLong_Digits(x); jpayne@69: assert(__Pyx_PyLong_DigitCount(x) > 1); jpayne@69: switch (__Pyx_PyLong_DigitCount(x)) { jpayne@69: case 2: jpayne@69: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { jpayne@69: __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) jpayne@69: } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { jpayne@69: return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: case 3: jpayne@69: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { jpayne@69: __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) jpayne@69: } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { jpayne@69: return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: case 4: jpayne@69: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { jpayne@69: __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]))) jpayne@69: } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { jpayne@69: return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 jpayne@69: if (unlikely(Py_SIZE(x) < 0)) { jpayne@69: goto raise_neg_overflow; jpayne@69: } jpayne@69: #else jpayne@69: { jpayne@69: int result = PyObject_RichCompareBool(x, Py_False, Py_LT); jpayne@69: if (unlikely(result < 0)) jpayne@69: return (long) -1; jpayne@69: if (unlikely(result == 1)) jpayne@69: goto raise_neg_overflow; jpayne@69: } jpayne@69: #endif jpayne@69: if ((sizeof(long) <= sizeof(unsigned long))) { jpayne@69: __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) jpayne@69: #ifdef HAVE_LONG_LONG jpayne@69: } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { jpayne@69: __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) jpayne@69: #endif jpayne@69: } jpayne@69: } else { jpayne@69: #if CYTHON_USE_PYLONG_INTERNALS jpayne@69: if (__Pyx_PyLong_IsCompact(x)) { jpayne@69: __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) jpayne@69: } else { jpayne@69: const digit* digits = __Pyx_PyLong_Digits(x); jpayne@69: assert(__Pyx_PyLong_DigitCount(x) > 1); jpayne@69: switch (__Pyx_PyLong_SignedDigitCount(x)) { jpayne@69: case -2: jpayne@69: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { jpayne@69: __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) jpayne@69: } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { jpayne@69: return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: case 2: jpayne@69: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { jpayne@69: __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) jpayne@69: } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { jpayne@69: return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: case -3: jpayne@69: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { jpayne@69: __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) jpayne@69: } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { jpayne@69: return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: case 3: jpayne@69: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { jpayne@69: __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) jpayne@69: } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { jpayne@69: return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: case -4: jpayne@69: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { jpayne@69: __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]))) jpayne@69: } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { jpayne@69: return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: case 4: jpayne@69: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { jpayne@69: if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { jpayne@69: __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]))) jpayne@69: } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { jpayne@69: return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); jpayne@69: } jpayne@69: } jpayne@69: break; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: if ((sizeof(long) <= sizeof(long))) { jpayne@69: __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) jpayne@69: #ifdef HAVE_LONG_LONG jpayne@69: } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { jpayne@69: __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) jpayne@69: #endif jpayne@69: } jpayne@69: } jpayne@69: { jpayne@69: long val; jpayne@69: int ret = -1; jpayne@69: #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API jpayne@69: Py_ssize_t bytes_copied = PyLong_AsNativeBytes( jpayne@69: x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); jpayne@69: if (unlikely(bytes_copied == -1)) { jpayne@69: } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { jpayne@69: goto raise_overflow; jpayne@69: } else { jpayne@69: ret = 0; jpayne@69: } jpayne@69: #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) jpayne@69: int one = 1; int is_little = (int)*(unsigned char *)&one; jpayne@69: unsigned char *bytes = (unsigned char *)&val; jpayne@69: ret = _PyLong_AsByteArray((PyLongObject *)x, jpayne@69: bytes, sizeof(val), jpayne@69: is_little, !is_unsigned); jpayne@69: #else jpayne@69: PyObject *v; jpayne@69: PyObject *stepval = NULL, *mask = NULL, *shift = NULL; jpayne@69: int bits, remaining_bits, is_negative = 0; jpayne@69: int chunk_size = (sizeof(long) < 8) ? 30 : 62; jpayne@69: if (likely(PyLong_CheckExact(x))) { jpayne@69: v = __Pyx_NewRef(x); jpayne@69: } else { jpayne@69: v = PyNumber_Long(x); jpayne@69: if (unlikely(!v)) return (long) -1; jpayne@69: assert(PyLong_CheckExact(v)); jpayne@69: } jpayne@69: { jpayne@69: int result = PyObject_RichCompareBool(v, Py_False, Py_LT); jpayne@69: if (unlikely(result < 0)) { jpayne@69: Py_DECREF(v); jpayne@69: return (long) -1; jpayne@69: } jpayne@69: is_negative = result == 1; jpayne@69: } jpayne@69: if (is_unsigned && unlikely(is_negative)) { jpayne@69: Py_DECREF(v); jpayne@69: goto raise_neg_overflow; jpayne@69: } else if (is_negative) { jpayne@69: stepval = PyNumber_Invert(v); jpayne@69: Py_DECREF(v); jpayne@69: if (unlikely(!stepval)) jpayne@69: return (long) -1; jpayne@69: } else { jpayne@69: stepval = v; jpayne@69: } jpayne@69: v = NULL; jpayne@69: val = (long) 0; jpayne@69: mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; jpayne@69: shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; jpayne@69: for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { jpayne@69: PyObject *tmp, *digit; jpayne@69: long idigit; jpayne@69: digit = PyNumber_And(stepval, mask); jpayne@69: if (unlikely(!digit)) goto done; jpayne@69: idigit = PyLong_AsLong(digit); jpayne@69: Py_DECREF(digit); jpayne@69: if (unlikely(idigit < 0)) goto done; jpayne@69: val |= ((long) idigit) << bits; jpayne@69: tmp = PyNumber_Rshift(stepval, shift); jpayne@69: if (unlikely(!tmp)) goto done; jpayne@69: Py_DECREF(stepval); stepval = tmp; jpayne@69: } jpayne@69: Py_DECREF(shift); shift = NULL; jpayne@69: Py_DECREF(mask); mask = NULL; jpayne@69: { jpayne@69: long idigit = PyLong_AsLong(stepval); jpayne@69: if (unlikely(idigit < 0)) goto done; jpayne@69: remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); jpayne@69: if (unlikely(idigit >= (1L << remaining_bits))) jpayne@69: goto raise_overflow; jpayne@69: val |= ((long) idigit) << bits; jpayne@69: } jpayne@69: if (!is_unsigned) { jpayne@69: if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) jpayne@69: goto raise_overflow; jpayne@69: if (is_negative) jpayne@69: val = ~val; jpayne@69: } jpayne@69: ret = 0; jpayne@69: done: jpayne@69: Py_XDECREF(shift); jpayne@69: Py_XDECREF(mask); jpayne@69: Py_XDECREF(stepval); jpayne@69: #endif jpayne@69: if (unlikely(ret)) jpayne@69: return (long) -1; jpayne@69: return val; jpayne@69: } jpayne@69: raise_overflow: jpayne@69: PyErr_SetString(PyExc_OverflowError, jpayne@69: "value too large to convert to long"); jpayne@69: return (long) -1; jpayne@69: raise_neg_overflow: jpayne@69: PyErr_SetString(PyExc_OverflowError, jpayne@69: "can't convert negative value to long"); jpayne@69: return (long) -1; jpayne@69: } jpayne@69: jpayne@69: /* FastTypeChecks */ jpayne@69: #if CYTHON_COMPILING_IN_CPYTHON jpayne@69: static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { jpayne@69: while (a) { jpayne@69: a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); jpayne@69: if (a == b) jpayne@69: return 1; jpayne@69: } jpayne@69: return b == &PyBaseObject_Type; jpayne@69: } jpayne@69: static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { jpayne@69: PyObject *mro; jpayne@69: if (a == b) return 1; jpayne@69: mro = a->tp_mro; jpayne@69: if (likely(mro)) { jpayne@69: Py_ssize_t i, n; jpayne@69: n = PyTuple_GET_SIZE(mro); jpayne@69: for (i = 0; i < n; i++) { jpayne@69: if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) jpayne@69: return 1; jpayne@69: } jpayne@69: return 0; jpayne@69: } jpayne@69: return __Pyx_InBases(a, b); jpayne@69: } jpayne@69: static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { jpayne@69: PyObject *mro; jpayne@69: if (cls == a || cls == b) return 1; jpayne@69: mro = cls->tp_mro; jpayne@69: if (likely(mro)) { jpayne@69: Py_ssize_t i, n; jpayne@69: n = PyTuple_GET_SIZE(mro); jpayne@69: for (i = 0; i < n; i++) { jpayne@69: PyObject *base = PyTuple_GET_ITEM(mro, i); jpayne@69: if (base == (PyObject *)a || base == (PyObject *)b) jpayne@69: return 1; jpayne@69: } jpayne@69: return 0; jpayne@69: } jpayne@69: return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); jpayne@69: } jpayne@69: #if PY_MAJOR_VERSION == 2 jpayne@69: static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { jpayne@69: PyObject *exception, *value, *tb; jpayne@69: int res; jpayne@69: __Pyx_PyThreadState_declare jpayne@69: __Pyx_PyThreadState_assign jpayne@69: __Pyx_ErrFetch(&exception, &value, &tb); jpayne@69: res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; jpayne@69: if (unlikely(res == -1)) { jpayne@69: PyErr_WriteUnraisable(err); jpayne@69: res = 0; jpayne@69: } jpayne@69: if (!res) { jpayne@69: res = PyObject_IsSubclass(err, exc_type2); jpayne@69: if (unlikely(res == -1)) { jpayne@69: PyErr_WriteUnraisable(err); jpayne@69: res = 0; jpayne@69: } jpayne@69: } jpayne@69: __Pyx_ErrRestore(exception, value, tb); jpayne@69: return res; jpayne@69: } jpayne@69: #else jpayne@69: static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { jpayne@69: if (exc_type1) { jpayne@69: return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); jpayne@69: } else { jpayne@69: return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { jpayne@69: Py_ssize_t i, n; jpayne@69: assert(PyExceptionClass_Check(exc_type)); jpayne@69: n = PyTuple_GET_SIZE(tuple); jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: for (i=0; i= 0x030B00A4 jpayne@69: return Py_Version & ~0xFFUL; jpayne@69: #else jpayne@69: const char* rt_version = Py_GetVersion(); jpayne@69: unsigned long version = 0; jpayne@69: unsigned long factor = 0x01000000UL; jpayne@69: unsigned int digit = 0; jpayne@69: int i = 0; jpayne@69: while (factor) { jpayne@69: while ('0' <= rt_version[i] && rt_version[i] <= '9') { jpayne@69: digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); jpayne@69: ++i; jpayne@69: } jpayne@69: version += factor * digit; jpayne@69: if (rt_version[i] != '.') jpayne@69: break; jpayne@69: digit = 0; jpayne@69: factor >>= 8; jpayne@69: ++i; jpayne@69: } jpayne@69: return version; jpayne@69: #endif jpayne@69: } jpayne@69: static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { jpayne@69: const unsigned long MAJOR_MINOR = 0xFFFF0000UL; jpayne@69: if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) jpayne@69: return 0; jpayne@69: if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) jpayne@69: return 1; jpayne@69: { jpayne@69: char message[200]; jpayne@69: PyOS_snprintf(message, sizeof(message), jpayne@69: "compile time Python version %d.%d " jpayne@69: "of module '%.100s' " jpayne@69: "%s " jpayne@69: "runtime version %d.%d", jpayne@69: (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), jpayne@69: __Pyx_MODULE_NAME, jpayne@69: (allow_newer) ? "was newer than" : "does not match", jpayne@69: (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) jpayne@69: ); jpayne@69: return PyErr_WarnEx(NULL, message, 1); jpayne@69: } jpayne@69: } jpayne@69: jpayne@69: /* FunctionExport */ jpayne@69: static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { jpayne@69: PyObject *d = 0; jpayne@69: PyObject *cobj = 0; jpayne@69: union { jpayne@69: void (*fp)(void); jpayne@69: void *p; jpayne@69: } tmp; jpayne@69: d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); jpayne@69: if (!d) { jpayne@69: PyErr_Clear(); jpayne@69: d = PyDict_New(); jpayne@69: if (!d) jpayne@69: goto bad; jpayne@69: Py_INCREF(d); jpayne@69: if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) jpayne@69: goto bad; jpayne@69: } jpayne@69: tmp.fp = f; jpayne@69: cobj = PyCapsule_New(tmp.p, sig, 0); jpayne@69: if (!cobj) jpayne@69: goto bad; jpayne@69: if (PyDict_SetItemString(d, name, cobj) < 0) jpayne@69: goto bad; jpayne@69: Py_DECREF(cobj); jpayne@69: Py_DECREF(d); jpayne@69: return 0; jpayne@69: bad: jpayne@69: Py_XDECREF(cobj); jpayne@69: Py_XDECREF(d); jpayne@69: return -1; jpayne@69: } jpayne@69: jpayne@69: /* InitStrings */ jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { jpayne@69: if (t.is_unicode | t.is_str) { jpayne@69: if (t.intern) { jpayne@69: *str = PyUnicode_InternFromString(t.s); jpayne@69: } else if (t.encoding) { jpayne@69: *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); jpayne@69: } else { jpayne@69: *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); jpayne@69: } jpayne@69: } else { jpayne@69: *str = PyBytes_FromStringAndSize(t.s, t.n - 1); jpayne@69: } jpayne@69: if (!*str) jpayne@69: return -1; jpayne@69: if (PyObject_Hash(*str) == -1) jpayne@69: return -1; jpayne@69: return 0; jpayne@69: } jpayne@69: #endif jpayne@69: static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { jpayne@69: while (t->p) { jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: __Pyx_InitString(*t, t->p); jpayne@69: #else jpayne@69: if (t->is_unicode) { jpayne@69: *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); jpayne@69: } else if (t->intern) { jpayne@69: *t->p = PyString_InternFromString(t->s); jpayne@69: } else { jpayne@69: *t->p = PyString_FromStringAndSize(t->s, t->n - 1); jpayne@69: } jpayne@69: if (!*t->p) jpayne@69: return -1; jpayne@69: if (PyObject_Hash(*t->p) == -1) jpayne@69: return -1; jpayne@69: #endif jpayne@69: ++t; jpayne@69: } jpayne@69: return 0; jpayne@69: } jpayne@69: jpayne@69: #include jpayne@69: static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { jpayne@69: size_t len = strlen(s); jpayne@69: if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { jpayne@69: PyErr_SetString(PyExc_OverflowError, "byte string is too long"); jpayne@69: return -1; jpayne@69: } jpayne@69: return (Py_ssize_t) len; jpayne@69: } jpayne@69: static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { jpayne@69: Py_ssize_t len = __Pyx_ssize_strlen(c_str); jpayne@69: if (unlikely(len < 0)) return NULL; jpayne@69: return __Pyx_PyUnicode_FromStringAndSize(c_str, len); jpayne@69: } jpayne@69: static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { jpayne@69: Py_ssize_t len = __Pyx_ssize_strlen(c_str); jpayne@69: if (unlikely(len < 0)) return NULL; jpayne@69: return PyByteArray_FromStringAndSize(c_str, len); jpayne@69: } jpayne@69: static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { jpayne@69: Py_ssize_t ignore; jpayne@69: return __Pyx_PyObject_AsStringAndSize(o, &ignore); jpayne@69: } jpayne@69: #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT jpayne@69: #if !CYTHON_PEP393_ENABLED jpayne@69: static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { jpayne@69: char* defenc_c; jpayne@69: PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); jpayne@69: if (!defenc) return NULL; jpayne@69: defenc_c = PyBytes_AS_STRING(defenc); jpayne@69: #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII jpayne@69: { jpayne@69: char* end = defenc_c + PyBytes_GET_SIZE(defenc); jpayne@69: char* c; jpayne@69: for (c = defenc_c; c < end; c++) { jpayne@69: if ((unsigned char) (*c) >= 128) { jpayne@69: PyUnicode_AsASCIIString(o); jpayne@69: return NULL; jpayne@69: } jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: *length = PyBytes_GET_SIZE(defenc); jpayne@69: return defenc_c; jpayne@69: } jpayne@69: #else jpayne@69: static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { jpayne@69: if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; jpayne@69: #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII jpayne@69: if (likely(PyUnicode_IS_ASCII(o))) { jpayne@69: *length = PyUnicode_GET_LENGTH(o); jpayne@69: return PyUnicode_AsUTF8(o); jpayne@69: } else { jpayne@69: PyUnicode_AsASCIIString(o); jpayne@69: return NULL; jpayne@69: } jpayne@69: #else jpayne@69: return PyUnicode_AsUTF8AndSize(o, length); jpayne@69: #endif jpayne@69: } jpayne@69: #endif jpayne@69: #endif jpayne@69: static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { jpayne@69: #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT jpayne@69: if ( jpayne@69: #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII jpayne@69: __Pyx_sys_getdefaultencoding_not_ascii && jpayne@69: #endif jpayne@69: PyUnicode_Check(o)) { jpayne@69: return __Pyx_PyUnicode_AsStringAndSize(o, length); jpayne@69: } else jpayne@69: #endif jpayne@69: #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) jpayne@69: if (PyByteArray_Check(o)) { jpayne@69: *length = PyByteArray_GET_SIZE(o); jpayne@69: return PyByteArray_AS_STRING(o); jpayne@69: } else jpayne@69: #endif jpayne@69: { jpayne@69: char* result; jpayne@69: int r = PyBytes_AsStringAndSize(o, &result, length); jpayne@69: if (unlikely(r < 0)) { jpayne@69: return NULL; jpayne@69: } else { jpayne@69: return result; jpayne@69: } jpayne@69: } jpayne@69: } jpayne@69: static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { jpayne@69: int is_true = x == Py_True; jpayne@69: if (is_true | (x == Py_False) | (x == Py_None)) return is_true; jpayne@69: else return PyObject_IsTrue(x); jpayne@69: } jpayne@69: static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { jpayne@69: int retval; jpayne@69: if (unlikely(!x)) return -1; jpayne@69: retval = __Pyx_PyObject_IsTrue(x); jpayne@69: Py_DECREF(x); jpayne@69: return retval; jpayne@69: } jpayne@69: static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { jpayne@69: __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); jpayne@69: #if PY_MAJOR_VERSION >= 3 jpayne@69: if (PyLong_Check(result)) { jpayne@69: if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, jpayne@69: "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " jpayne@69: "The ability to return an instance of a strict subclass of int is deprecated, " jpayne@69: "and may be removed in a future version of Python.", jpayne@69: result_type_name)) { jpayne@69: __Pyx_DECREF_TypeName(result_type_name); jpayne@69: Py_DECREF(result); jpayne@69: return NULL; jpayne@69: } jpayne@69: __Pyx_DECREF_TypeName(result_type_name); jpayne@69: return result; jpayne@69: } jpayne@69: #endif jpayne@69: PyErr_Format(PyExc_TypeError, jpayne@69: "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", jpayne@69: type_name, type_name, result_type_name); jpayne@69: __Pyx_DECREF_TypeName(result_type_name); jpayne@69: Py_DECREF(result); jpayne@69: return NULL; jpayne@69: } jpayne@69: static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { jpayne@69: #if CYTHON_USE_TYPE_SLOTS jpayne@69: PyNumberMethods *m; jpayne@69: #endif jpayne@69: const char *name = NULL; jpayne@69: PyObject *res = NULL; jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: if (likely(PyInt_Check(x) || PyLong_Check(x))) jpayne@69: #else jpayne@69: if (likely(PyLong_Check(x))) jpayne@69: #endif jpayne@69: return __Pyx_NewRef(x); jpayne@69: #if CYTHON_USE_TYPE_SLOTS jpayne@69: m = Py_TYPE(x)->tp_as_number; jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: if (m && m->nb_int) { jpayne@69: name = "int"; jpayne@69: res = m->nb_int(x); jpayne@69: } jpayne@69: else if (m && m->nb_long) { jpayne@69: name = "long"; jpayne@69: res = m->nb_long(x); jpayne@69: } jpayne@69: #else jpayne@69: if (likely(m && m->nb_int)) { jpayne@69: name = "int"; jpayne@69: res = m->nb_int(x); jpayne@69: } jpayne@69: #endif jpayne@69: #else jpayne@69: if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { jpayne@69: res = PyNumber_Int(x); jpayne@69: } jpayne@69: #endif jpayne@69: if (likely(res)) { jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { jpayne@69: #else jpayne@69: if (unlikely(!PyLong_CheckExact(res))) { jpayne@69: #endif jpayne@69: return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); jpayne@69: } jpayne@69: } jpayne@69: else if (!PyErr_Occurred()) { jpayne@69: PyErr_SetString(PyExc_TypeError, jpayne@69: "an integer is required"); jpayne@69: } jpayne@69: return res; jpayne@69: } jpayne@69: static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { jpayne@69: Py_ssize_t ival; jpayne@69: PyObject *x; jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: if (likely(PyInt_CheckExact(b))) { jpayne@69: if (sizeof(Py_ssize_t) >= sizeof(long)) jpayne@69: return PyInt_AS_LONG(b); jpayne@69: else jpayne@69: return PyInt_AsSsize_t(b); jpayne@69: } jpayne@69: #endif jpayne@69: if (likely(PyLong_CheckExact(b))) { jpayne@69: #if CYTHON_USE_PYLONG_INTERNALS jpayne@69: if (likely(__Pyx_PyLong_IsCompact(b))) { jpayne@69: return __Pyx_PyLong_CompactValue(b); jpayne@69: } else { jpayne@69: const digit* digits = __Pyx_PyLong_Digits(b); jpayne@69: const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); jpayne@69: switch (size) { jpayne@69: case 2: jpayne@69: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { jpayne@69: return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); jpayne@69: } jpayne@69: break; jpayne@69: case -2: jpayne@69: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { jpayne@69: return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); jpayne@69: } jpayne@69: break; jpayne@69: case 3: jpayne@69: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { jpayne@69: return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); jpayne@69: } jpayne@69: break; jpayne@69: case -3: jpayne@69: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { jpayne@69: return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); jpayne@69: } jpayne@69: break; jpayne@69: case 4: jpayne@69: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { jpayne@69: 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])); jpayne@69: } jpayne@69: break; jpayne@69: case -4: jpayne@69: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { jpayne@69: 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])); jpayne@69: } jpayne@69: break; jpayne@69: } jpayne@69: } jpayne@69: #endif jpayne@69: return PyLong_AsSsize_t(b); jpayne@69: } jpayne@69: x = PyNumber_Index(b); jpayne@69: if (!x) return -1; jpayne@69: ival = PyInt_AsSsize_t(x); jpayne@69: Py_DECREF(x); jpayne@69: return ival; jpayne@69: } jpayne@69: static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { jpayne@69: if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { jpayne@69: return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); jpayne@69: #if PY_MAJOR_VERSION < 3 jpayne@69: } else if (likely(PyInt_CheckExact(o))) { jpayne@69: return PyInt_AS_LONG(o); jpayne@69: #endif jpayne@69: } else { jpayne@69: Py_ssize_t ival; jpayne@69: PyObject *x; jpayne@69: x = PyNumber_Index(o); jpayne@69: if (!x) return -1; jpayne@69: ival = PyInt_AsLong(x); jpayne@69: Py_DECREF(x); jpayne@69: return ival; jpayne@69: } jpayne@69: } jpayne@69: static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { jpayne@69: return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); jpayne@69: } jpayne@69: static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { jpayne@69: return PyInt_FromSize_t(ival); jpayne@69: } jpayne@69: jpayne@69: jpayne@69: /* #### Code section: utility_code_pragmas_end ### */ jpayne@69: #ifdef _MSC_VER jpayne@69: #pragma warning( pop ) jpayne@69: #endif jpayne@69: jpayne@69: jpayne@69: jpayne@69: /* #### Code section: end ### */ jpayne@69: #endif /* Py_PYTHON_H */