diff --git a/modules/miscutil/lib/intbitset.c b/modules/miscutil/lib/intbitset.c index f9ffd5c22..28c6c2c18 100644 --- a/modules/miscutil/lib/intbitset.c +++ b/modules/miscutil/lib/intbitset.c @@ -1,7653 +1,8169 @@ -/* Generated by Cython 0.9.6.11b on Tue Feb 5 16:53:48 2008 */ +/* Generated by Cython 0.9.6.12 on Tue Feb 26 17:44:52 2008 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #include "structmember.h" #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #if PY_VERSION_HEX < 0x02050000 typedef int Py_ssize_t; #define PY_SSIZE_T_MAX INT_MAX #define PY_SSIZE_T_MIN INT_MIN #define PyInt_FromSsize_t(z) PyInt_FromLong(z) #define PyInt_AsSsize_t(o) PyInt_AsLong(o) #define PyNumber_Index(o) PyNumber_Int(o) #define PyIndex_Check(o) PyNumber_Check(o) #endif #if PY_VERSION_HEX < 0x02040000 #define METH_COEXIST 0 #endif #ifndef WIN32 #define __stdcall #define __cdecl #endif #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #include #include "intbitset.h" #ifdef __GNUC__ #define INLINE __inline__ #elif _WIN32 #define INLINE __inline #else #define INLINE #endif typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/ typedef struct {PyObject **p; char *s; long n; int is_unicode;} __Pyx_StringTabEntry; /*proto*/ static int __pyx_skip_dispatch = 0; /* Type Conversion Predeclarations */ #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) static INLINE int __Pyx_PyObject_IsTrue(PyObject* x); static INLINE PY_LONG_LONG __pyx_PyInt_AsLongLong(PyObject* x); static INLINE unsigned PY_LONG_LONG __pyx_PyInt_AsUnsignedLongLong(PyObject* x); static INLINE Py_ssize_t __pyx_PyIndex_AsSsize_t(PyObject* b); #define __pyx_PyInt_AsLong(x) (PyInt_CheckExact(x) ? PyInt_AS_LONG(x) : PyInt_AsLong(x)) #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) static INLINE unsigned char __pyx_PyInt_unsigned_char(PyObject* x); static INLINE unsigned short __pyx_PyInt_unsigned_short(PyObject* x); static INLINE char __pyx_PyInt_char(PyObject* x); static INLINE short __pyx_PyInt_short(PyObject* x); static INLINE int __pyx_PyInt_int(PyObject* x); static INLINE long __pyx_PyInt_long(PyObject* x); static INLINE signed char __pyx_PyInt_signed_char(PyObject* x); static INLINE signed short __pyx_PyInt_signed_short(PyObject* x); static INLINE signed int __pyx_PyInt_signed_int(PyObject* x); static INLINE signed long __pyx_PyInt_signed_long(PyObject* x); static INLINE long double __pyx_PyInt_long_double(PyObject* x); #ifdef __GNUC__ /* Test for GCC > 2.95 */ #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* __GNUC__ > 2 ... */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ > 2 ... */ #else /* __GNUC__ */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static int __pyx_lineno; static char *__pyx_filename; static char **__pyx_f; static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ static PyObject *__Pyx_UnpackItem(PyObject *); /*proto*/ static int __Pyx_EndUnpack(PyObject *); /*proto*/ static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ static void __Pyx_AddTraceback(char *funcname); /*proto*/ /* Declarations from intbitset */ /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":96 * __maxelem__ = maxelem * * cdef class intbitset: # <<<<<<<<<<<<<< * """ * Defines an intbitset data object to hold unordered sets of */ struct __pyx_obj_9intbitset_intbitset { PyObject_HEAD IntBitSet *bitset; int sanity_checks; }; -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":686 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":743 * return self.extract_finite_list() * * cdef class intbitset_iterator: # <<<<<<<<<<<<<< * cdef int last * cdef IntBitSet *bitset */ struct __pyx_obj_9intbitset_intbitset_iterator { PyObject_HEAD int last; IntBitSet *bitset; }; /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":96 * __maxelem__ = maxelem * * cdef class intbitset: # <<<<<<<<<<<<<< * """ * Defines an intbitset data object to hold unordered sets of */ -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":686 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":743 * return self.extract_finite_list() * * cdef class intbitset_iterator: # <<<<<<<<<<<<<< * cdef int last * cdef IntBitSet *bitset */ static PyTypeObject *__pyx_ptype_9intbitset_intbitset = 0; static PyTypeObject *__pyx_ptype_9intbitset_intbitset_iterator = 0; -static PyObject *__pyx_k_8; -static int __pyx_k_9; -static int __pyx_k_10; -static int __pyx_k_11; -static int __pyx_k_12; -static int __pyx_k_13; +static int __pyx_k_8; /* Implementation of intbitset */ static char __pyx_k_1[] = "$Id$"; static char __pyx_k_5[] = "invenio.config"; static PyObject *__pyx_num_0; static PyObject *__pyx_n___cinit__; static PyObject *__pyx_n___dealloc__; static PyObject *__pyx_n___contains__; static PyObject *__pyx_n___cmp__; static PyObject *__pyx_n___richcmp__; static PyObject *__pyx_n___len__; static PyObject *__pyx_n___hash__; static PyObject *__pyx_n___nonzero__; static PyObject *__pyx_n___iadd__; static PyObject *__pyx_n___isub__; static PyObject *__pyx_n___deepcopy__; static PyObject *__pyx_n___del__; static PyObject *__pyx_n___and__; static PyObject *__pyx_n___or__; static PyObject *__pyx_n___xor__; static PyObject *__pyx_n___sub__; static PyObject *__pyx_n___iand__; static PyObject *__pyx_n___ior__; static PyObject *__pyx_n___ixor__; static PyObject *__pyx_n___repr__; static PyObject *__pyx_n___str__; static PyObject *__pyx_n___iter__; static PyObject *__pyx_n_add; static PyObject *__pyx_n_clear; static PyObject *__pyx_n_difference; static PyObject *__pyx_n_difference_update; static PyObject *__pyx_n_discard; static PyObject *__pyx_n_intersection; static PyObject *__pyx_n_intersection_update; static PyObject *__pyx_n_union; static PyObject *__pyx_n_union_update; static PyObject *__pyx_n_issubset; static PyObject *__pyx_n_issuperset; static PyObject *__pyx_n_symmetric_difference; static PyObject *__pyx_n_symmetric_difference_update; static PyObject *__pyx_n_fastdump; static PyObject *__pyx_n_fastload; static PyObject *__pyx_n_copy; static PyObject *__pyx_n_pop; static PyObject *__pyx_n_remove; static PyObject *__pyx_n_strbits; static PyObject *__pyx_n_update_with_signs; static PyObject *__pyx_n_get_size; static PyObject *__pyx_n_get_allocated; static PyObject *__pyx_n_get_sorted_element; static PyObject *__pyx_n_to_sorted_list; static PyObject *__pyx_n_is_infinite; static PyObject *__pyx_n_extract_finite_list; static PyObject *__pyx_n_get_wordbitsize; static PyObject *__pyx_n_get_wordbytsize; static PyObject *__pyx_n_tolist; static PyObject *__pyx_n___next__; static PyObject *__pyx_n___revision__; static PyObject *__pyx_n___apilevel__; static PyObject *__pyx_n_zlib; static PyObject *__pyx_n_array; static PyObject *__pyx_n_CFG_INTBITSET_ENABLE_SANITY_CHECKS; static PyObject *__pyx_n_intbitset; static PyObject *__pyx_n___all__; static PyObject *__pyx_n___maxelem__; static PyObject *__pyx_k_1p; static PyObject *__pyx_k_5p; -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":114 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":137 * cdef bint sanity_checks * * def __cinit__(self, rhs=0, int preallocate=-1, int trailing_bits=0, bint sanity_checks=CFG_INTBITSET_ENABLE_SANITY_CHECKS, int no_allocate=0): # <<<<<<<<<<<<<< * """ * Initialize intbitset. */ static PyObject *__pyx_n_Error; static PyObject *__pyx_n_ValueError; static PyObject *__pyx_n_tostring; static PyObject *__pyx_n_decompress; static PyObject *__pyx_n_Exception; static PyObject *__pyx_n_max; static PyObject *__pyx_n_OverflowError; static PyObject *__pyx_n_TypeError; +static PyObject *__pyx_k_10p; +static PyObject *__pyx_k_11p; +static PyObject *__pyx_k_12p; +static PyObject *__pyx_k_14p; static PyObject *__pyx_k_15p; static PyObject *__pyx_k_16p; static PyObject *__pyx_k_17p; +static PyObject *__pyx_k_18p; static PyObject *__pyx_k_19p; static PyObject *__pyx_k_20p; static PyObject *__pyx_k_21p; static PyObject *__pyx_k_22p; static PyObject *__pyx_k_23p; static PyObject *__pyx_k_24p; -static PyObject *__pyx_k_25p; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_Exception; static PyObject *__pyx_builtin_max; static PyObject *__pyx_builtin_OverflowError; static PyObject *__pyx_builtin_TypeError; -static char __pyx_k_15[] = "rhs can't be negative"; -static char __pyx_k_16[] = "Buffer error!!!"; -static char __pyx_k_17[] = "rhs is corrupted: %s"; -static char __pyx_k_19[] = "Can't integers bigger than %s"; -static char __pyx_k_20[] = "Negative numbers, not allowed"; -static char __pyx_k_21[] = "Elements must be <= %s"; -static char __pyx_k_22[] = "Negative numbers, not allowed"; -static char __pyx_k_23[] = "Elements must be <= %s"; -static char __pyx_k_24[] = "retrieving integers from rhs is impossible: %s"; -static char __pyx_k_25[] = "rhs is of unknown type %s"; +static char __pyx_k_10[] = "rhs can't be negative"; +static char __pyx_k_11[] = "Buffer error!!!"; +static char __pyx_k_12[] = "rhs is corrupted: %s"; +static char __pyx_k_14[] = "Can't integers bigger than %s"; +static char __pyx_k_15[] = "Negative numbers, not allowed"; +static char __pyx_k_16[] = "Elements must be <= %s"; +static char __pyx_k_17[] = "Negative numbers, not allowed"; +static char __pyx_k_18[] = "Elements must be <= %s"; +static char __pyx_k_19[] = "Negative numbers, not allowed"; +static char __pyx_k_20[] = "Elements must be <= %s"; +static char __pyx_k_21[] = "Negative numbers, not allowed"; +static char __pyx_k_22[] = "Elements must be <= %s"; +static char __pyx_k_23[] = "retrieving integers from rhs is impossible: %s"; +static char __pyx_k_24[] = "rhs is of unknown type %s"; static int __pyx_pf_9intbitset_9intbitset___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_9intbitset_9intbitset___cinit__[] = "\n Initialize intbitset.\n * rhs can be:\n - int/long for creating allocating empty intbitset that will hold at least\n rhs elements, before being resized\n - intbitset for cloning\n - str for retrieving an intbitset that was dumped into a string\n - array for retrieving an intbitset that was dumped into a string stored\n in an array\n - sequence made of integers for copying all the elements from the\n sequence. If minsize is specified than it is initially allocated\n enough space to hold up to minsize integers, otherwise the biggest\n element of the sequence will be used.\n * preallocate is a suggested initial upper bound on the numbers that will be\n stored, by looking at rhs a sequence of number.\n * trailing_bits is 1, then the set will contain \"all\" the positive integers\n * no_allocate is used internally and should never be set.\n after the biggest one added with rhs.\n "; static int __pyx_pf_9intbitset_9intbitset___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_rhs = 0; int __pyx_v_preallocate; int __pyx_v_trailing_bits; int __pyx_v_sanity_checks; int __pyx_v_no_allocate; Py_ssize_t __pyx_v_size; void *__pyx_v_buf; int __pyx_v_elem; int __pyx_v_last; int __pyx_v_remelem; + int __pyx_v_tuple_of_tuples; PyObject *__pyx_v_msg; PyObject *__pyx_v_tmp; + PyObject *__pyx_v_tmp_tuple; int __pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; int __pyx_4; PyObject *__pyx_5 = 0; PyObject *__pyx_6 = 0; int __pyx_7; - Py_ssize_t __pyx_8; + Py_ssize_t __pyx_8 = 0; static char *__pyx_argnames[] = {"rhs","preallocate","trailing_bits","sanity_checks","no_allocate",0}; - __pyx_v_rhs = __pyx_k_8; - __pyx_v_preallocate = __pyx_k_9; - __pyx_v_trailing_bits = __pyx_k_10; - __pyx_v_sanity_checks = __pyx_k_11; - __pyx_v_no_allocate = __pyx_k_12; - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|Oiiii", __pyx_argnames, &__pyx_v_rhs, &__pyx_v_preallocate, &__pyx_v_trailing_bits, &__pyx_v_sanity_checks, &__pyx_v_no_allocate))) return -1; + __pyx_v_rhs = __pyx_num_0; + __pyx_v_preallocate = -1; + __pyx_v_trailing_bits = 0; + __pyx_v_sanity_checks = __pyx_k_8; + __pyx_v_no_allocate = 0; + if (likely(!__pyx_kwds) && likely(0 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 5)) { + if (PyTuple_GET_SIZE(__pyx_args) > 0) { + __pyx_v_rhs = PyTuple_GET_ITEM(__pyx_args, 0); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_preallocate = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_preallocate == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; goto __pyx_L2;} + if (PyTuple_GET_SIZE(__pyx_args) > 2) { + __pyx_v_trailing_bits = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_trailing_bits == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; goto __pyx_L2;} + if (PyTuple_GET_SIZE(__pyx_args) > 3) { + __pyx_v_sanity_checks = __Pyx_PyObject_IsTrue(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely((__pyx_v_sanity_checks == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; goto __pyx_L2;} + if (PyTuple_GET_SIZE(__pyx_args) > 4) { + __pyx_v_no_allocate = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 4)); if (unlikely((__pyx_v_no_allocate == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; goto __pyx_L2;} + } + } + } + } + } + } + else { + if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|Oiiii", __pyx_argnames, &__pyx_v_rhs, &__pyx_v_preallocate, &__pyx_v_trailing_bits, &__pyx_v_sanity_checks, &__pyx_v_no_allocate))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; goto __pyx_L2;} + } + goto __pyx_L3; + __pyx_L2:; + return -1; + __pyx_L3:; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_rhs); __pyx_v_msg = Py_None; Py_INCREF(Py_None); __pyx_v_tmp = Py_None; Py_INCREF(Py_None); + __pyx_v_tmp_tuple = Py_None; Py_INCREF(Py_None); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":140 - * cdef int last + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":164 * cdef int remelem + * cdef bint tuple_of_tuples * self.sanity_checks = sanity_checks # <<<<<<<<<<<<<< * msg = "Error" * self.bitset = NULL */ ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->sanity_checks = __pyx_v_sanity_checks; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":141 - * cdef int remelem + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":165 + * cdef bint tuple_of_tuples * self.sanity_checks = sanity_checks * msg = "Error" # <<<<<<<<<<<<<< * self.bitset = NULL * if no_allocate: */ Py_INCREF(__pyx_n_Error); Py_DECREF(__pyx_v_msg); __pyx_v_msg = __pyx_n_Error; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":142 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":166 * self.sanity_checks = sanity_checks * msg = "Error" * self.bitset = NULL # <<<<<<<<<<<<<< * if no_allocate: * self.bitset = intBitSetCreateNoAllocate() */ ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset = NULL; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":143 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":167 * msg = "Error" * self.bitset = NULL * if no_allocate: # <<<<<<<<<<<<<< * self.bitset = intBitSetCreateNoAllocate() * return */ __pyx_1 = __pyx_v_no_allocate; if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":144 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":168 * self.bitset = NULL * if no_allocate: * self.bitset = intBitSetCreateNoAllocate() # <<<<<<<<<<<<<< * return * if type(rhs) in (int, long): */ ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset = intBitSetCreateNoAllocate(); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":145 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":169 * if no_allocate: * self.bitset = intBitSetCreateNoAllocate() * return # <<<<<<<<<<<<<< * if type(rhs) in (int, long): * if rhs < 0: */ __pyx_r = 0; goto __pyx_L0; - goto __pyx_L2; + goto __pyx_L4; } - __pyx_L2:; + __pyx_L4:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":146 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":170 * self.bitset = intBitSetCreateNoAllocate() * return * if type(rhs) in (int, long): # <<<<<<<<<<<<<< * if rhs < 0: * raise ValueError, "rhs can't be negative" */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; goto __pyx_L1;} Py_INCREF(__pyx_v_rhs); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_rhs); - __pyx_3 = PyObject_Call(((PyObject*)&PyType_Type), __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L1;} + __pyx_3 = PyObject_Call(((PyObject*)&PyType_Type), __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; goto __pyx_L1;} Py_INCREF(((PyObject*)&PyInt_Type)); PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject*)&PyInt_Type)); Py_INCREF(((PyObject*)&PyLong_Type)); PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject*)&PyLong_Type)); - __pyx_4 = (PySequence_Contains(__pyx_2, __pyx_3)); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L1;} + __pyx_4 = (PySequence_Contains(__pyx_2, __pyx_3)); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_4) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":147 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":171 * return * if type(rhs) in (int, long): * if rhs < 0: # <<<<<<<<<<<<<< * raise ValueError, "rhs can't be negative" * self.bitset = intBitSetCreate(rhs, trailing_bits) */ - __pyx_3 = PyObject_RichCompare(__pyx_v_rhs, __pyx_num_0, Py_LT); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;} - __pyx_4 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;} + __pyx_3 = PyObject_RichCompare(__pyx_v_rhs, __pyx_num_0, Py_LT); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; goto __pyx_L1;} + __pyx_4 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_4) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":148 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":172 * if type(rhs) in (int, long): * if rhs < 0: * raise ValueError, "rhs can't be negative" # <<<<<<<<<<<<<< * self.bitset = intBitSetCreate(rhs, trailing_bits) * elif type(rhs) is intbitset: */ - __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_15p, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; goto __pyx_L1;} - goto __pyx_L4; + __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_10p, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; goto __pyx_L1;} + goto __pyx_L6; } - __pyx_L4:; + __pyx_L6:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":149 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":173 * if rhs < 0: * raise ValueError, "rhs can't be negative" * self.bitset = intBitSetCreate(rhs, trailing_bits) # <<<<<<<<<<<<<< * elif type(rhs) is intbitset: * self.bitset = intBitSetClone((rhs).bitset) */ - __pyx_1 = __pyx_PyInt_int(__pyx_v_rhs); if (unlikely((__pyx_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; goto __pyx_L1;} - ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset = intBitSetCreate(__pyx_1,__pyx_v_trailing_bits); - goto __pyx_L3; + __pyx_1 = __pyx_PyInt_int(__pyx_v_rhs); if (unlikely((__pyx_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; goto __pyx_L1;} + ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset = intBitSetCreate(__pyx_1, __pyx_v_trailing_bits); + goto __pyx_L5; } - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":150 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":174 * raise ValueError, "rhs can't be negative" * self.bitset = intBitSetCreate(rhs, trailing_bits) * elif type(rhs) is intbitset: # <<<<<<<<<<<<<< * self.bitset = intBitSetClone((rhs).bitset) * elif type(rhs) in (str, array): */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;} Py_INCREF(__pyx_v_rhs); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_rhs); - __pyx_3 = PyObject_Call(((PyObject*)&PyType_Type), __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;} + __pyx_3 = PyObject_Call(((PyObject*)&PyType_Type), __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_4 = (__pyx_3 == ((PyObject*)__pyx_ptype_9intbitset_intbitset)); Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_4) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":151 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":175 * self.bitset = intBitSetCreate(rhs, trailing_bits) * elif type(rhs) is intbitset: * self.bitset = intBitSetClone((rhs).bitset) # <<<<<<<<<<<<<< * elif type(rhs) in (str, array): * try: */ ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset = intBitSetClone(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_rhs)->bitset); - goto __pyx_L3; + goto __pyx_L5; } - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":152 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":176 * elif type(rhs) is intbitset: * self.bitset = intBitSetClone((rhs).bitset) * elif type(rhs) in (str, array): # <<<<<<<<<<<<<< * try: * if type(rhs) is array: */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;} Py_INCREF(__pyx_v_rhs); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_rhs); - __pyx_3 = PyObject_Call(((PyObject*)&PyType_Type), __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; goto __pyx_L1;} + __pyx_3 = PyObject_Call(((PyObject*)&PyType_Type), __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_array); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_array); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;} Py_INCREF(((PyObject*)&PyString_Type)); PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject*)&PyString_Type)); PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); __pyx_2 = 0; - __pyx_4 = (PySequence_Contains(__pyx_5, __pyx_3)); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; goto __pyx_L1;} + __pyx_4 = (PySequence_Contains(__pyx_5, __pyx_3)); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_4) { /*try:*/ { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":154 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":178 * elif type(rhs) in (str, array): * try: * if type(rhs) is array: # <<<<<<<<<<<<<< * rhs = rhs.tostring() * tmp = zlib.decompress(rhs) */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; goto __pyx_L5;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L7;} Py_INCREF(__pyx_v_rhs); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_rhs); - __pyx_3 = PyObject_Call(((PyObject*)&PyType_Type), __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; goto __pyx_L5;} + __pyx_3 = PyObject_Call(((PyObject*)&PyType_Type), __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L7;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_array); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; goto __pyx_L5;} + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_array); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L7;} __pyx_4 = (__pyx_3 == __pyx_5); Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_4) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":155 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":179 * try: * if type(rhs) is array: * rhs = rhs.tostring() # <<<<<<<<<<<<<< * tmp = zlib.decompress(rhs) * if PyObject_AsReadBuffer(tmp, &buf, &size) < 0: */ - __pyx_2 = PyObject_GetAttr(__pyx_v_rhs, __pyx_n_tostring); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; goto __pyx_L5;} - __pyx_3 = PyObject_Call(__pyx_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; goto __pyx_L5;} + __pyx_2 = PyObject_GetAttr(__pyx_v_rhs, __pyx_n_tostring); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L7;} + __pyx_3 = PyObject_Call(__pyx_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L7;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_v_rhs); __pyx_v_rhs = __pyx_3; __pyx_3 = 0; - goto __pyx_L7; + goto __pyx_L9; } - __pyx_L7:; + __pyx_L9:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":156 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":180 * if type(rhs) is array: * rhs = rhs.tostring() * tmp = zlib.decompress(rhs) # <<<<<<<<<<<<<< * if PyObject_AsReadBuffer(tmp, &buf, &size) < 0: * raise Exception, "Buffer error!!!" */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_zlib); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; goto __pyx_L5;} - __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_decompress); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; goto __pyx_L5;} + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_zlib); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L7;} + __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_decompress); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L7;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; goto __pyx_L5;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L7;} Py_INCREF(__pyx_v_rhs); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_rhs); - __pyx_5 = PyObject_Call(__pyx_2, __pyx_3, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; goto __pyx_L5;} + __pyx_5 = PyObject_Call(__pyx_2, __pyx_3, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L7;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_v_tmp); __pyx_v_tmp = __pyx_5; __pyx_5 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":157 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":181 * rhs = rhs.tostring() * tmp = zlib.decompress(rhs) * if PyObject_AsReadBuffer(tmp, &buf, &size) < 0: # <<<<<<<<<<<<<< * raise Exception, "Buffer error!!!" * self.bitset = intBitSetCreateFromBuffer(buf, size) */ - __pyx_4 = (PyObject_AsReadBuffer(__pyx_v_tmp,(&__pyx_v_buf),(&__pyx_v_size)) < 0); + __pyx_4 = (PyObject_AsReadBuffer(__pyx_v_tmp, (&__pyx_v_buf), (&__pyx_v_size)) < 0); if (__pyx_4) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":158 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":182 * tmp = zlib.decompress(rhs) * if PyObject_AsReadBuffer(tmp, &buf, &size) < 0: * raise Exception, "Buffer error!!!" # <<<<<<<<<<<<<< * self.bitset = intBitSetCreateFromBuffer(buf, size) * except Exception, msg: */ - __Pyx_Raise(__pyx_builtin_Exception, __pyx_k_16p, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; goto __pyx_L5;} - goto __pyx_L8; + __Pyx_Raise(__pyx_builtin_Exception, __pyx_k_11p, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L7;} + goto __pyx_L10; } - __pyx_L8:; + __pyx_L10:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":159 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":183 * if PyObject_AsReadBuffer(tmp, &buf, &size) < 0: * raise Exception, "Buffer error!!!" * self.bitset = intBitSetCreateFromBuffer(buf, size) # <<<<<<<<<<<<<< * except Exception, msg: * raise ValueError, "rhs is corrupted: %s" % msg */ - ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset = intBitSetCreateFromBuffer(__pyx_v_buf,__pyx_v_size); + ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset = intBitSetCreateFromBuffer(__pyx_v_buf, __pyx_v_size); } - goto __pyx_L6; - __pyx_L5:; + goto __pyx_L8; + __pyx_L7:; Py_XDECREF(__pyx_2); __pyx_2 = 0; Py_XDECREF(__pyx_3); __pyx_3 = 0; Py_XDECREF(__pyx_5); __pyx_5 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":160 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":184 * raise Exception, "Buffer error!!!" * self.bitset = intBitSetCreateFromBuffer(buf, size) * except Exception, msg: # <<<<<<<<<<<<<< * raise ValueError, "rhs is corrupted: %s" % msg * elif hasattr(rhs, '__iter__'): */ __pyx_1 = PyErr_ExceptionMatches(__pyx_builtin_Exception); if (__pyx_1) { __Pyx_AddTraceback("intbitset.__cinit__"); - if (__Pyx_GetException(&__pyx_2, &__pyx_3, &__pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; goto __pyx_L1;} + if (__Pyx_GetException(&__pyx_2, &__pyx_3, &__pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; goto __pyx_L1;} Py_INCREF(__pyx_3); Py_DECREF(__pyx_v_msg); __pyx_v_msg = __pyx_3; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":161 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":185 * self.bitset = intBitSetCreateFromBuffer(buf, size) * except Exception, msg: * raise ValueError, "rhs is corrupted: %s" % msg # <<<<<<<<<<<<<< * elif hasattr(rhs, '__iter__'): - * try: + * tuple_of_tuples = rhs and type(rhs[0]) is tuple */ - __pyx_6 = PyNumber_Remainder(__pyx_k_17p, __pyx_v_msg); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; goto __pyx_L1;} + __pyx_6 = PyNumber_Remainder(__pyx_k_12p, __pyx_v_msg); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; goto __pyx_L1;} __Pyx_Raise(__pyx_builtin_ValueError, __pyx_6, 0); Py_DECREF(__pyx_6); __pyx_6 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - goto __pyx_L6; + goto __pyx_L8; } goto __pyx_L1; - __pyx_L6:; - goto __pyx_L3; + __pyx_L8:; + goto __pyx_L5; } - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":162 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":186 * except Exception, msg: * raise ValueError, "rhs is corrupted: %s" % msg * elif hasattr(rhs, '__iter__'): # <<<<<<<<<<<<<< + * tuple_of_tuples = rhs and type(rhs[0]) is tuple * try: - * if preallocate < 0: */ - __pyx_4 = PyObject_HasAttr(__pyx_v_rhs,__pyx_n___iter__); if (unlikely(__pyx_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; goto __pyx_L1;} + __pyx_4 = PyObject_HasAttr(__pyx_v_rhs, __pyx_n___iter__); if (unlikely(__pyx_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;} if (__pyx_4) { - /*try:*/ { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":164 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":187 + * raise ValueError, "rhs is corrupted: %s" % msg * elif hasattr(rhs, '__iter__'): + * tuple_of_tuples = rhs and type(rhs[0]) is tuple # <<<<<<<<<<<<<< + * try: + * if preallocate < 0: + */ + __pyx_6 = __pyx_v_rhs; + Py_INCREF(__pyx_6); + __pyx_4 = __Pyx_PyObject_IsTrue(__pyx_6); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;} + if (__pyx_4) { + Py_DECREF(__pyx_6); __pyx_6 = 0; + if (PyList_CheckExact(__pyx_v_rhs) && 0 <= 0 && 0 < PyList_GET_SIZE(__pyx_v_rhs)) { + __pyx_3 = PyList_GET_ITEM(__pyx_v_rhs, 0); Py_INCREF(__pyx_3); + } else if (PyTuple_CheckExact(__pyx_v_rhs) && 0 <= 0 && 0 < PyTuple_GET_SIZE(__pyx_v_rhs)) { + __pyx_3 = PyTuple_GET_ITEM(__pyx_v_rhs, 0); Py_INCREF(__pyx_3); + } else { + __pyx_2 = PyInt_FromLong(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;} + __pyx_3 = PyObject_GetItem(__pyx_v_rhs, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + } + __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_5, 0, __pyx_3); + __pyx_3 = 0; + __pyx_2 = PyObject_Call(((PyObject*)&PyType_Type), __pyx_5, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_4 = (__pyx_2 == ((PyObject*)&PyTuple_Type)); + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_6 = __Pyx_PyBool_FromLong(__pyx_4); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;} + } + __pyx_4 = __Pyx_PyObject_IsTrue(__pyx_6); if (unlikely((__pyx_4 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;} + Py_DECREF(__pyx_6); __pyx_6 = 0; + __pyx_v_tuple_of_tuples = __pyx_4; + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":188 + * elif hasattr(rhs, '__iter__'): + * tuple_of_tuples = rhs and type(rhs[0]) is tuple + * try: # <<<<<<<<<<<<<< + * if preallocate < 0: + * if rhs and type(rhs[0]) is int: + */ + /*try:*/ { + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":189 + * tuple_of_tuples = rhs and type(rhs[0]) is tuple * try: * if preallocate < 0: # <<<<<<<<<<<<<< - * if rhs: + * if rhs and type(rhs[0]) is int: * preallocate = max(rhs) */ __pyx_4 = (__pyx_v_preallocate < 0); if (__pyx_4) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":165 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":190 * try: * if preallocate < 0: - * if rhs: # <<<<<<<<<<<<<< + * if rhs and type(rhs[0]) is int: # <<<<<<<<<<<<<< * preallocate = max(rhs) * else: */ - __pyx_4 = __Pyx_PyObject_IsTrue(__pyx_v_rhs); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L9;} + __pyx_3 = __pyx_v_rhs; + Py_INCREF(__pyx_3); + __pyx_4 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; goto __pyx_L11;} + if (__pyx_4) { + Py_DECREF(__pyx_3); __pyx_3 = 0; + if (PyList_CheckExact(__pyx_v_rhs) && 0 <= 0 && 0 < PyList_GET_SIZE(__pyx_v_rhs)) { + __pyx_2 = PyList_GET_ITEM(__pyx_v_rhs, 0); Py_INCREF(__pyx_2); + } else if (PyTuple_CheckExact(__pyx_v_rhs) && 0 <= 0 && 0 < PyTuple_GET_SIZE(__pyx_v_rhs)) { + __pyx_2 = PyTuple_GET_ITEM(__pyx_v_rhs, 0); Py_INCREF(__pyx_2); + } else { + __pyx_5 = PyInt_FromLong(0); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; goto __pyx_L11;} + __pyx_2 = PyObject_GetItem(__pyx_v_rhs, __pyx_5); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; goto __pyx_L11;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + } + __pyx_6 = PyTuple_New(1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; goto __pyx_L11;} + PyTuple_SET_ITEM(__pyx_6, 0, __pyx_2); + __pyx_2 = 0; + __pyx_5 = PyObject_Call(((PyObject*)&PyType_Type), __pyx_6, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; goto __pyx_L11;} + Py_DECREF(__pyx_6); __pyx_6 = 0; + __pyx_4 = (__pyx_5 == ((PyObject*)&PyInt_Type)); + Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_3 = __Pyx_PyBool_FromLong(__pyx_4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; goto __pyx_L11;} + } + __pyx_4 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; goto __pyx_L11;} + Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_4) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":166 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":191 * if preallocate < 0: - * if rhs: + * if rhs and type(rhs[0]) is int: * preallocate = max(rhs) # <<<<<<<<<<<<<< * else: * preallocate = 0 */ - __pyx_6 = PyTuple_New(1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L9;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; goto __pyx_L11;} Py_INCREF(__pyx_v_rhs); - PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_rhs); - __pyx_2 = PyObject_Call(__pyx_builtin_max, __pyx_6, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L9;} - Py_DECREF(__pyx_6); __pyx_6 = 0; - __pyx_1 = __pyx_PyInt_int(__pyx_2); if (unlikely((__pyx_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L9;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_rhs); + __pyx_6 = PyObject_Call(__pyx_builtin_max, __pyx_2, NULL); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; goto __pyx_L11;} Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_1 = __pyx_PyInt_int(__pyx_6); if (unlikely((__pyx_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; goto __pyx_L11;} + Py_DECREF(__pyx_6); __pyx_6 = 0; __pyx_v_preallocate = __pyx_1; - goto __pyx_L12; + goto __pyx_L14; } /*else*/ { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":168 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":193 * preallocate = max(rhs) * else: * preallocate = 0 # <<<<<<<<<<<<<< * if self.sanity_checks: * if not (0 <= preallocate < maxelem): */ __pyx_v_preallocate = 0; } - __pyx_L12:; - goto __pyx_L11; + __pyx_L14:; + goto __pyx_L13; } - __pyx_L11:; + __pyx_L13:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":169 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":194 * else: * preallocate = 0 * if self.sanity_checks: # <<<<<<<<<<<<<< * if not (0 <= preallocate < maxelem): * raise OverflowError, "Can't integers bigger than %s" % maxelem */ __pyx_4 = ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->sanity_checks; if (__pyx_4) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":170 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":195 * preallocate = 0 * if self.sanity_checks: * if not (0 <= preallocate < maxelem): # <<<<<<<<<<<<<< * raise OverflowError, "Can't integers bigger than %s" % maxelem * self.bitset = intBitSetCreate(preallocate, trailing_bits) */ __pyx_4 = (0 <= __pyx_v_preallocate); if (__pyx_4) { __pyx_4 = (__pyx_v_preallocate < maxelem); } __pyx_7 = (!__pyx_4); if (__pyx_7) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":171 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":196 * if self.sanity_checks: * if not (0 <= preallocate < maxelem): * raise OverflowError, "Can't integers bigger than %s" % maxelem # <<<<<<<<<<<<<< * self.bitset = intBitSetCreate(preallocate, trailing_bits) * if trailing_bits: */ - __pyx_3 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; goto __pyx_L9;} - __pyx_5 = PyNumber_Remainder(__pyx_k_19p, __pyx_3); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; goto __pyx_L9;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_5, 0); + __pyx_5 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L11;} + __pyx_3 = PyNumber_Remainder(__pyx_k_14p, __pyx_5); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L11;} Py_DECREF(__pyx_5); __pyx_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; goto __pyx_L9;} - goto __pyx_L14; + __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_3, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L11;} + goto __pyx_L16; } - __pyx_L14:; - goto __pyx_L13; + __pyx_L16:; + goto __pyx_L15; } - __pyx_L13:; + __pyx_L15:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":172 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":197 * if not (0 <= preallocate < maxelem): * raise OverflowError, "Can't integers bigger than %s" % maxelem * self.bitset = intBitSetCreate(preallocate, trailing_bits) # <<<<<<<<<<<<<< * if trailing_bits: * last = 0 */ - ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset = intBitSetCreate(__pyx_v_preallocate,__pyx_v_trailing_bits); + ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset = intBitSetCreate(__pyx_v_preallocate, __pyx_v_trailing_bits); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":173 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":198 * raise OverflowError, "Can't integers bigger than %s" % maxelem * self.bitset = intBitSetCreate(preallocate, trailing_bits) * if trailing_bits: # <<<<<<<<<<<<<< * last = 0 * if self.sanity_checks: */ __pyx_1 = __pyx_v_trailing_bits; if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":174 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":199 * self.bitset = intBitSetCreate(preallocate, trailing_bits) * if trailing_bits: * last = 0 # <<<<<<<<<<<<<< * if self.sanity_checks: - * for elem in rhs: + * if tuple_of_tuples: */ __pyx_v_last = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":175 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":200 * if trailing_bits: * last = 0 * if self.sanity_checks: # <<<<<<<<<<<<<< - * for elem in rhs: - * if elem < 0: + * if tuple_of_tuples: + * for tmp_tuple in rhs: */ __pyx_4 = ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->sanity_checks; if (__pyx_4) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":176 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":201 * last = 0 * if self.sanity_checks: - * for elem in rhs: # <<<<<<<<<<<<<< - * if elem < 0: - * raise ValueError, "Negative numbers, not allowed" - */ - if (PyList_CheckExact(__pyx_v_rhs)) { __pyx_8 = 0; __pyx_6 = __pyx_v_rhs; Py_INCREF(__pyx_6); } - else { __pyx_6 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L9;} } - for (;;) { - if (PyList_CheckExact(__pyx_6)) { if (__pyx_8 >= PyList_GET_SIZE(__pyx_6)) break; __pyx_2 = PyList_GET_ITEM(__pyx_6, __pyx_8++); Py_INCREF(__pyx_2); } - else { - __pyx_2 = PyIter_Next(__pyx_6); - if (!__pyx_2) { - break; - } - } - __pyx_1 = __pyx_PyInt_int(__pyx_2); if (unlikely((__pyx_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L9;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_v_elem = __pyx_1; + * if tuple_of_tuples: # <<<<<<<<<<<<<< + * for tmp_tuple in rhs: + * elem = tmp_tuple[0] + */ + __pyx_7 = __pyx_v_tuple_of_tuples; + if (__pyx_7) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":177 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":202 * if self.sanity_checks: - * for elem in rhs: - * if elem < 0: # <<<<<<<<<<<<<< - * raise ValueError, "Negative numbers, not allowed" - * elif elem > maxelem: - */ - __pyx_7 = (__pyx_v_elem < 0); - if (__pyx_7) { - - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":178 - * for elem in rhs: - * if elem < 0: - * raise ValueError, "Negative numbers, not allowed" # <<<<<<<<<<<<<< - * elif elem > maxelem: - * raise OverflowError, "Elements must be <= %s" % maxelem - */ - __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_20p, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L9;} - goto __pyx_L19; - } - - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":179 - * if elem < 0: - * raise ValueError, "Negative numbers, not allowed" - * elif elem > maxelem: # <<<<<<<<<<<<<< - * raise OverflowError, "Elements must be <= %s" % maxelem - * for remelem from last <= remelem < elem: - */ - __pyx_4 = (__pyx_v_elem > maxelem); - if (__pyx_4) { - - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":180 - * raise ValueError, "Negative numbers, not allowed" - * elif elem > maxelem: - * raise OverflowError, "Elements must be <= %s" % maxelem # <<<<<<<<<<<<<< - * for remelem from last <= remelem < elem: - * intBitSetDelElem(self.bitset, remelem) - */ - __pyx_3 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L9;} - __pyx_5 = PyNumber_Remainder(__pyx_k_21p, __pyx_3); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L9;} + * if tuple_of_tuples: + * for tmp_tuple in rhs: # <<<<<<<<<<<<<< + * elem = tmp_tuple[0] + * if elem < 0: + */ + if (PyList_CheckExact(__pyx_v_rhs)) { __pyx_8 = 0; __pyx_2 = __pyx_v_rhs; Py_INCREF(__pyx_2); } + else { __pyx_2 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; goto __pyx_L11;} } + for (;;) { + if (PyList_CheckExact(__pyx_2)) { if (__pyx_8 >= PyList_GET_SIZE(__pyx_2)) break; __pyx_6 = PyList_GET_ITEM(__pyx_2, __pyx_8++); Py_INCREF(__pyx_6); } + else { + __pyx_6 = PyIter_Next(__pyx_2); + if (!__pyx_6) { + break; + } + } + Py_DECREF(__pyx_v_tmp_tuple); + __pyx_v_tmp_tuple = __pyx_6; + __pyx_6 = 0; + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":203 + * if tuple_of_tuples: + * for tmp_tuple in rhs: + * elem = tmp_tuple[0] # <<<<<<<<<<<<<< + * if elem < 0: + * raise ValueError, "Negative numbers, not allowed" + */ + if (PyList_CheckExact(__pyx_v_tmp_tuple) && 0 <= 0 && 0 < PyList_GET_SIZE(__pyx_v_tmp_tuple)) { + __pyx_3 = PyList_GET_ITEM(__pyx_v_tmp_tuple, 0); Py_INCREF(__pyx_3); + } else if (PyTuple_CheckExact(__pyx_v_tmp_tuple) && 0 <= 0 && 0 < PyTuple_GET_SIZE(__pyx_v_tmp_tuple)) { + __pyx_3 = PyTuple_GET_ITEM(__pyx_v_tmp_tuple, 0); Py_INCREF(__pyx_3); + } else { + __pyx_5 = PyInt_FromLong(0); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L11;} + __pyx_3 = PyObject_GetItem(__pyx_v_tmp_tuple, __pyx_5); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L11;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + } + __pyx_1 = __pyx_PyInt_int(__pyx_3); if (unlikely((__pyx_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L11;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_5, 0); - Py_DECREF(__pyx_5); __pyx_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L9;} - goto __pyx_L19; + __pyx_v_elem = __pyx_1; + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":204 + * for tmp_tuple in rhs: + * elem = tmp_tuple[0] + * if elem < 0: # <<<<<<<<<<<<<< + * raise ValueError, "Negative numbers, not allowed" + * elif elem > maxelem: + */ + __pyx_4 = (__pyx_v_elem < 0); + if (__pyx_4) { + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":205 + * elem = tmp_tuple[0] + * if elem < 0: + * raise ValueError, "Negative numbers, not allowed" # <<<<<<<<<<<<<< + * elif elem > maxelem: + * raise OverflowError, "Elements must be <= %s" % maxelem + */ + __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_15p, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; goto __pyx_L11;} + goto __pyx_L22; + } + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":206 + * if elem < 0: + * raise ValueError, "Negative numbers, not allowed" + * elif elem > maxelem: # <<<<<<<<<<<<<< + * raise OverflowError, "Elements must be <= %s" % maxelem + * for remelem from last <= remelem < elem: + */ + __pyx_7 = (__pyx_v_elem > maxelem); + if (__pyx_7) { + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":207 + * raise ValueError, "Negative numbers, not allowed" + * elif elem > maxelem: + * raise OverflowError, "Elements must be <= %s" % maxelem # <<<<<<<<<<<<<< + * for remelem from last <= remelem < elem: + * intBitSetDelElem(self.bitset, remelem) + */ + __pyx_6 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; goto __pyx_L11;} + __pyx_5 = PyNumber_Remainder(__pyx_k_16p, __pyx_6); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; goto __pyx_L11;} + Py_DECREF(__pyx_6); __pyx_6 = 0; + __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_5, 0); + Py_DECREF(__pyx_5); __pyx_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; goto __pyx_L11;} + goto __pyx_L22; + } + __pyx_L22:; + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":208 + * elif elem > maxelem: + * raise OverflowError, "Elements must be <= %s" % maxelem + * for remelem from last <= remelem < elem: # <<<<<<<<<<<<<< + * intBitSetDelElem(self.bitset, remelem) + * last = elem + 1 + */ + for (__pyx_v_remelem = __pyx_v_last; __pyx_v_remelem < __pyx_v_elem; __pyx_v_remelem++) { + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":209 + * raise OverflowError, "Elements must be <= %s" % maxelem + * for remelem from last <= remelem < elem: + * intBitSetDelElem(self.bitset, remelem) # <<<<<<<<<<<<<< + * last = elem + 1 + * else: + */ + intBitSetDelElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_remelem); + } + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":210 + * for remelem from last <= remelem < elem: + * intBitSetDelElem(self.bitset, remelem) + * last = elem + 1 # <<<<<<<<<<<<<< + * else: + * for elem in rhs: + */ + __pyx_v_last = (__pyx_v_elem + 1); } - __pyx_L19:; - - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":181 - * elif elem > maxelem: - * raise OverflowError, "Elements must be <= %s" % maxelem - * for remelem from last <= remelem < elem: # <<<<<<<<<<<<<< - * intBitSetDelElem(self.bitset, remelem) - * last = elem + 1 - */ - for (__pyx_v_remelem = __pyx_v_last; __pyx_v_remelem < __pyx_v_elem; __pyx_v_remelem++) { - - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":182 - * raise OverflowError, "Elements must be <= %s" % maxelem - * for remelem from last <= remelem < elem: - * intBitSetDelElem(self.bitset, remelem) # <<<<<<<<<<<<<< - * last = elem + 1 + Py_DECREF(__pyx_2); __pyx_2 = 0; + goto __pyx_L19; + } + /*else*/ { + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":212 + * last = elem + 1 + * else: + * for elem in rhs: # <<<<<<<<<<<<<< + * if elem < 0: + * raise ValueError, "Negative numbers, not allowed" + */ + if (PyList_CheckExact(__pyx_v_rhs)) { __pyx_8 = 0; __pyx_3 = __pyx_v_rhs; Py_INCREF(__pyx_3); } + else { __pyx_3 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L11;} } + for (;;) { + if (PyList_CheckExact(__pyx_3)) { if (__pyx_8 >= PyList_GET_SIZE(__pyx_3)) break; __pyx_6 = PyList_GET_ITEM(__pyx_3, __pyx_8++); Py_INCREF(__pyx_6); } + else { + __pyx_6 = PyIter_Next(__pyx_3); + if (!__pyx_6) { + break; + } + } + __pyx_1 = __pyx_PyInt_int(__pyx_6); if (unlikely((__pyx_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L11;} + Py_DECREF(__pyx_6); __pyx_6 = 0; + __pyx_v_elem = __pyx_1; + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":213 + * else: + * for elem in rhs: + * if elem < 0: # <<<<<<<<<<<<<< + * raise ValueError, "Negative numbers, not allowed" + * elif elem > maxelem: + */ + __pyx_4 = (__pyx_v_elem < 0); + if (__pyx_4) { + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":214 + * for elem in rhs: + * if elem < 0: + * raise ValueError, "Negative numbers, not allowed" # <<<<<<<<<<<<<< + * elif elem > maxelem: + * raise OverflowError, "Elements must be <= %s" % maxelem + */ + __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_17p, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L11;} + goto __pyx_L27; + } + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":215 + * if elem < 0: + * raise ValueError, "Negative numbers, not allowed" + * elif elem > maxelem: # <<<<<<<<<<<<<< + * raise OverflowError, "Elements must be <= %s" % maxelem + * for remelem from last <= remelem < elem: + */ + __pyx_7 = (__pyx_v_elem > maxelem); + if (__pyx_7) { + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":216 + * raise ValueError, "Negative numbers, not allowed" + * elif elem > maxelem: + * raise OverflowError, "Elements must be <= %s" % maxelem # <<<<<<<<<<<<<< + * for remelem from last <= remelem < elem: + * intBitSetDelElem(self.bitset, remelem) + */ + __pyx_5 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; goto __pyx_L11;} + __pyx_2 = PyNumber_Remainder(__pyx_k_18p, __pyx_5); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; goto __pyx_L11;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_2, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; goto __pyx_L11;} + goto __pyx_L27; + } + __pyx_L27:; + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":217 + * elif elem > maxelem: + * raise OverflowError, "Elements must be <= %s" % maxelem + * for remelem from last <= remelem < elem: # <<<<<<<<<<<<<< + * intBitSetDelElem(self.bitset, remelem) + * last = elem + 1 + */ + for (__pyx_v_remelem = __pyx_v_last; __pyx_v_remelem < __pyx_v_elem; __pyx_v_remelem++) { + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":218 + * raise OverflowError, "Elements must be <= %s" % maxelem + * for remelem from last <= remelem < elem: + * intBitSetDelElem(self.bitset, remelem) # <<<<<<<<<<<<<< + * last = elem + 1 * else: */ - intBitSetDelElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,__pyx_v_remelem); - } + intBitSetDelElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_remelem); + } - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":183 - * for remelem from last <= remelem < elem: - * intBitSetDelElem(self.bitset, remelem) - * last = elem + 1 # <<<<<<<<<<<<<< + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":219 + * for remelem from last <= remelem < elem: + * intBitSetDelElem(self.bitset, remelem) + * last = elem + 1 # <<<<<<<<<<<<<< * else: - * for elem in rhs: + * if tuple_of_tuples: */ - __pyx_v_last = (__pyx_v_elem + 1); + __pyx_v_last = (__pyx_v_elem + 1); + } + Py_DECREF(__pyx_3); __pyx_3 = 0; } - Py_DECREF(__pyx_6); __pyx_6 = 0; - goto __pyx_L16; + __pyx_L19:; + goto __pyx_L18; } /*else*/ { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":185 - * last = elem + 1 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":221 + * last = elem + 1 * else: - * for elem in rhs: # <<<<<<<<<<<<<< - * for remelem from last <= remelem < elem: - * intBitSetDelElem(self.bitset, remelem) - */ - if (PyList_CheckExact(__pyx_v_rhs)) { __pyx_8 = 0; __pyx_2 = __pyx_v_rhs; Py_INCREF(__pyx_2); } - else { __pyx_2 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; goto __pyx_L9;} } - for (;;) { - if (PyList_CheckExact(__pyx_2)) { if (__pyx_8 >= PyList_GET_SIZE(__pyx_2)) break; __pyx_3 = PyList_GET_ITEM(__pyx_2, __pyx_8++); Py_INCREF(__pyx_3); } - else { - __pyx_3 = PyIter_Next(__pyx_2); - if (!__pyx_3) { - break; + * if tuple_of_tuples: # <<<<<<<<<<<<<< + * for tmp_tuple in rhs: + * elem = tmp_tuple[0] + */ + __pyx_4 = __pyx_v_tuple_of_tuples; + if (__pyx_4) { + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":222 + * else: + * if tuple_of_tuples: + * for tmp_tuple in rhs: # <<<<<<<<<<<<<< + * elem = tmp_tuple[0] + * for remelem from last <= remelem < elem: + */ + if (PyList_CheckExact(__pyx_v_rhs)) { __pyx_8 = 0; __pyx_6 = __pyx_v_rhs; Py_INCREF(__pyx_6); } + else { __pyx_6 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; goto __pyx_L11;} } + for (;;) { + if (PyList_CheckExact(__pyx_6)) { if (__pyx_8 >= PyList_GET_SIZE(__pyx_6)) break; __pyx_5 = PyList_GET_ITEM(__pyx_6, __pyx_8++); Py_INCREF(__pyx_5); } + else { + __pyx_5 = PyIter_Next(__pyx_6); + if (!__pyx_5) { + break; + } + } + Py_DECREF(__pyx_v_tmp_tuple); + __pyx_v_tmp_tuple = __pyx_5; + __pyx_5 = 0; + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":223 + * if tuple_of_tuples: + * for tmp_tuple in rhs: + * elem = tmp_tuple[0] # <<<<<<<<<<<<<< + * for remelem from last <= remelem < elem: + * intBitSetDelElem(self.bitset, remelem) + */ + if (PyList_CheckExact(__pyx_v_tmp_tuple) && 0 <= 0 && 0 < PyList_GET_SIZE(__pyx_v_tmp_tuple)) { + __pyx_3 = PyList_GET_ITEM(__pyx_v_tmp_tuple, 0); Py_INCREF(__pyx_3); + } else if (PyTuple_CheckExact(__pyx_v_tmp_tuple) && 0 <= 0 && 0 < PyTuple_GET_SIZE(__pyx_v_tmp_tuple)) { + __pyx_3 = PyTuple_GET_ITEM(__pyx_v_tmp_tuple, 0); Py_INCREF(__pyx_3); + } else { + __pyx_2 = PyInt_FromLong(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; goto __pyx_L11;} + __pyx_3 = PyObject_GetItem(__pyx_v_tmp_tuple, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; goto __pyx_L11;} + Py_DECREF(__pyx_2); __pyx_2 = 0; } + __pyx_1 = __pyx_PyInt_int(__pyx_3); if (unlikely((__pyx_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; goto __pyx_L11;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_v_elem = __pyx_1; + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":224 + * for tmp_tuple in rhs: + * elem = tmp_tuple[0] + * for remelem from last <= remelem < elem: # <<<<<<<<<<<<<< + * intBitSetDelElem(self.bitset, remelem) + * last = elem + 1 + */ + for (__pyx_v_remelem = __pyx_v_last; __pyx_v_remelem < __pyx_v_elem; __pyx_v_remelem++) { + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":225 + * elem = tmp_tuple[0] + * for remelem from last <= remelem < elem: + * intBitSetDelElem(self.bitset, remelem) # <<<<<<<<<<<<<< + * last = elem + 1 + * else: + */ + intBitSetDelElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_remelem); + } + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":226 + * for remelem from last <= remelem < elem: + * intBitSetDelElem(self.bitset, remelem) + * last = elem + 1 # <<<<<<<<<<<<<< + * else: + * for elem in rhs: + */ + __pyx_v_last = (__pyx_v_elem + 1); } - __pyx_1 = __pyx_PyInt_int(__pyx_3); if (unlikely((__pyx_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; goto __pyx_L9;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_v_elem = __pyx_1; + Py_DECREF(__pyx_6); __pyx_6 = 0; + goto __pyx_L30; + } + /*else*/ { + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":228 + * last = elem + 1 + * else: + * for elem in rhs: # <<<<<<<<<<<<<< + * for remelem from last <= remelem < elem: + * intBitSetDelElem(self.bitset, remelem) + */ + if (PyList_CheckExact(__pyx_v_rhs)) { __pyx_8 = 0; __pyx_5 = __pyx_v_rhs; Py_INCREF(__pyx_5); } + else { __pyx_5 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L11;} } + for (;;) { + if (PyList_CheckExact(__pyx_5)) { if (__pyx_8 >= PyList_GET_SIZE(__pyx_5)) break; __pyx_2 = PyList_GET_ITEM(__pyx_5, __pyx_8++); Py_INCREF(__pyx_2); } + else { + __pyx_2 = PyIter_Next(__pyx_5); + if (!__pyx_2) { + break; + } + } + __pyx_1 = __pyx_PyInt_int(__pyx_2); if (unlikely((__pyx_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L11;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_v_elem = __pyx_1; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":186 - * else: - * for elem in rhs: - * for remelem from last <= remelem < elem: # <<<<<<<<<<<<<< - * intBitSetDelElem(self.bitset, remelem) - * last = elem + 1 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":229 + * else: + * for elem in rhs: + * for remelem from last <= remelem < elem: # <<<<<<<<<<<<<< + * intBitSetDelElem(self.bitset, remelem) + * last = elem + 1 */ - for (__pyx_v_remelem = __pyx_v_last; __pyx_v_remelem < __pyx_v_elem; __pyx_v_remelem++) { + for (__pyx_v_remelem = __pyx_v_last; __pyx_v_remelem < __pyx_v_elem; __pyx_v_remelem++) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":187 - * for elem in rhs: - * for remelem from last <= remelem < elem: - * intBitSetDelElem(self.bitset, remelem) # <<<<<<<<<<<<<< - * last = elem + 1 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":230 + * for elem in rhs: + * for remelem from last <= remelem < elem: + * intBitSetDelElem(self.bitset, remelem) # <<<<<<<<<<<<<< + * last = elem + 1 * */ - intBitSetDelElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,__pyx_v_remelem); - } + intBitSetDelElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_remelem); + } - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":188 - * for remelem from last <= remelem < elem: - * intBitSetDelElem(self.bitset, remelem) - * last = elem + 1 # <<<<<<<<<<<<<< + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":231 + * for remelem from last <= remelem < elem: + * intBitSetDelElem(self.bitset, remelem) + * last = elem + 1 # <<<<<<<<<<<<<< * * else: */ - __pyx_v_last = (__pyx_v_elem + 1); + __pyx_v_last = (__pyx_v_elem + 1); + } + Py_DECREF(__pyx_5); __pyx_5 = 0; } - Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_L30:; } - __pyx_L16:; - goto __pyx_L15; + __pyx_L18:; + goto __pyx_L17; } /*else*/ { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":191 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":234 * * else: * if self.sanity_checks: # <<<<<<<<<<<<<< - * for elem in rhs: - * if elem < 0: + * if tuple_of_tuples: + * for tmp_tuple in rhs: */ __pyx_7 = ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->sanity_checks; if (__pyx_7) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":192 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":235 * else: * if self.sanity_checks: - * for elem in rhs: # <<<<<<<<<<<<<< - * if elem < 0: - * raise ValueError, "Negative numbers, not allowed" - */ - if (PyList_CheckExact(__pyx_v_rhs)) { __pyx_8 = 0; __pyx_5 = __pyx_v_rhs; Py_INCREF(__pyx_5); } - else { __pyx_5 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L9;} } - for (;;) { - if (PyList_CheckExact(__pyx_5)) { if (__pyx_8 >= PyList_GET_SIZE(__pyx_5)) break; __pyx_6 = PyList_GET_ITEM(__pyx_5, __pyx_8++); Py_INCREF(__pyx_6); } - else { - __pyx_6 = PyIter_Next(__pyx_5); - if (!__pyx_6) { - break; - } - } - __pyx_1 = __pyx_PyInt_int(__pyx_6); if (unlikely((__pyx_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L9;} - Py_DECREF(__pyx_6); __pyx_6 = 0; - __pyx_v_elem = __pyx_1; + * if tuple_of_tuples: # <<<<<<<<<<<<<< + * for tmp_tuple in rhs: + * elem = tmp_tuple[0] + */ + __pyx_4 = __pyx_v_tuple_of_tuples; + if (__pyx_4) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":193 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":236 * if self.sanity_checks: - * for elem in rhs: - * if elem < 0: # <<<<<<<<<<<<<< - * raise ValueError, "Negative numbers, not allowed" - * elif elem > maxelem: - */ - __pyx_4 = (__pyx_v_elem < 0); - if (__pyx_4) { - - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":194 - * for elem in rhs: - * if elem < 0: - * raise ValueError, "Negative numbers, not allowed" # <<<<<<<<<<<<<< - * elif elem > maxelem: - * raise OverflowError, "Elements must be <= %s" % maxelem - */ - __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_22p, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L9;} - goto __pyx_L29; + * if tuple_of_tuples: + * for tmp_tuple in rhs: # <<<<<<<<<<<<<< + * elem = tmp_tuple[0] + * if elem < 0: + */ + if (PyList_CheckExact(__pyx_v_rhs)) { __pyx_8 = 0; __pyx_3 = __pyx_v_rhs; Py_INCREF(__pyx_3); } + else { __pyx_3 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; goto __pyx_L11;} } + for (;;) { + if (PyList_CheckExact(__pyx_3)) { if (__pyx_8 >= PyList_GET_SIZE(__pyx_3)) break; __pyx_6 = PyList_GET_ITEM(__pyx_3, __pyx_8++); Py_INCREF(__pyx_6); } + else { + __pyx_6 = PyIter_Next(__pyx_3); + if (!__pyx_6) { + break; + } + } + Py_DECREF(__pyx_v_tmp_tuple); + __pyx_v_tmp_tuple = __pyx_6; + __pyx_6 = 0; + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":237 + * if tuple_of_tuples: + * for tmp_tuple in rhs: + * elem = tmp_tuple[0] # <<<<<<<<<<<<<< + * if elem < 0: + * raise ValueError, "Negative numbers, not allowed" + */ + if (PyList_CheckExact(__pyx_v_tmp_tuple) && 0 <= 0 && 0 < PyList_GET_SIZE(__pyx_v_tmp_tuple)) { + __pyx_5 = PyList_GET_ITEM(__pyx_v_tmp_tuple, 0); Py_INCREF(__pyx_5); + } else if (PyTuple_CheckExact(__pyx_v_tmp_tuple) && 0 <= 0 && 0 < PyTuple_GET_SIZE(__pyx_v_tmp_tuple)) { + __pyx_5 = PyTuple_GET_ITEM(__pyx_v_tmp_tuple, 0); Py_INCREF(__pyx_5); + } else { + __pyx_2 = PyInt_FromLong(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; goto __pyx_L11;} + __pyx_5 = PyObject_GetItem(__pyx_v_tmp_tuple, __pyx_2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; goto __pyx_L11;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + } + __pyx_1 = __pyx_PyInt_int(__pyx_5); if (unlikely((__pyx_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; goto __pyx_L11;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_v_elem = __pyx_1; + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":238 + * for tmp_tuple in rhs: + * elem = tmp_tuple[0] + * if elem < 0: # <<<<<<<<<<<<<< + * raise ValueError, "Negative numbers, not allowed" + * elif elem > maxelem: + */ + __pyx_7 = (__pyx_v_elem < 0); + if (__pyx_7) { + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":239 + * elem = tmp_tuple[0] + * if elem < 0: + * raise ValueError, "Negative numbers, not allowed" # <<<<<<<<<<<<<< + * elif elem > maxelem: + * raise OverflowError, "Elements must be <= %s" % maxelem + */ + __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_19p, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; goto __pyx_L11;} + goto __pyx_L43; + } + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":240 + * if elem < 0: + * raise ValueError, "Negative numbers, not allowed" + * elif elem > maxelem: # <<<<<<<<<<<<<< + * raise OverflowError, "Elements must be <= %s" % maxelem + * intBitSetAddElem(self.bitset, elem) + */ + __pyx_4 = (__pyx_v_elem > maxelem); + if (__pyx_4) { + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":241 + * raise ValueError, "Negative numbers, not allowed" + * elif elem > maxelem: + * raise OverflowError, "Elements must be <= %s" % maxelem # <<<<<<<<<<<<<< + * intBitSetAddElem(self.bitset, elem) + * else: + */ + __pyx_6 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; goto __pyx_L11;} + __pyx_2 = PyNumber_Remainder(__pyx_k_20p, __pyx_6); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; goto __pyx_L11;} + Py_DECREF(__pyx_6); __pyx_6 = 0; + __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_2, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; goto __pyx_L11;} + goto __pyx_L43; + } + __pyx_L43:; + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":242 + * elif elem > maxelem: + * raise OverflowError, "Elements must be <= %s" % maxelem + * intBitSetAddElem(self.bitset, elem) # <<<<<<<<<<<<<< + * else: + * for elem in rhs: + */ + intBitSetAddElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_elem); } + Py_DECREF(__pyx_3); __pyx_3 = 0; + goto __pyx_L40; + } + /*else*/ { + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":244 + * intBitSetAddElem(self.bitset, elem) + * else: + * for elem in rhs: # <<<<<<<<<<<<<< + * if elem < 0: + * raise ValueError, "Negative numbers, not allowed" + */ + if (PyList_CheckExact(__pyx_v_rhs)) { __pyx_8 = 0; __pyx_5 = __pyx_v_rhs; Py_INCREF(__pyx_5); } + else { __pyx_5 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L11;} } + for (;;) { + if (PyList_CheckExact(__pyx_5)) { if (__pyx_8 >= PyList_GET_SIZE(__pyx_5)) break; __pyx_6 = PyList_GET_ITEM(__pyx_5, __pyx_8++); Py_INCREF(__pyx_6); } + else { + __pyx_6 = PyIter_Next(__pyx_5); + if (!__pyx_6) { + break; + } + } + __pyx_1 = __pyx_PyInt_int(__pyx_6); if (unlikely((__pyx_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L11;} + Py_DECREF(__pyx_6); __pyx_6 = 0; + __pyx_v_elem = __pyx_1; + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":245 + * else: + * for elem in rhs: + * if elem < 0: # <<<<<<<<<<<<<< + * raise ValueError, "Negative numbers, not allowed" + * elif elem > maxelem: + */ + __pyx_7 = (__pyx_v_elem < 0); + if (__pyx_7) { + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":246 + * for elem in rhs: + * if elem < 0: + * raise ValueError, "Negative numbers, not allowed" # <<<<<<<<<<<<<< + * elif elem > maxelem: + * raise OverflowError, "Elements must be <= %s" % maxelem + */ + __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_21p, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; goto __pyx_L11;} + goto __pyx_L46; + } - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":195 - * if elem < 0: - * raise ValueError, "Negative numbers, not allowed" - * elif elem > maxelem: # <<<<<<<<<<<<<< - * raise OverflowError, "Elements must be <= %s" % maxelem - * intBitSetAddElem(self.bitset, elem) - */ - __pyx_7 = (__pyx_v_elem > maxelem); - if (__pyx_7) { - - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":196 - * raise ValueError, "Negative numbers, not allowed" - * elif elem > maxelem: - * raise OverflowError, "Elements must be <= %s" % maxelem # <<<<<<<<<<<<<< - * intBitSetAddElem(self.bitset, elem) + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":247 + * if elem < 0: + * raise ValueError, "Negative numbers, not allowed" + * elif elem > maxelem: # <<<<<<<<<<<<<< + * raise OverflowError, "Elements must be <= %s" % maxelem + * intBitSetAddElem(self.bitset, elem) + */ + __pyx_4 = (__pyx_v_elem > maxelem); + if (__pyx_4) { + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":248 + * raise ValueError, "Negative numbers, not allowed" + * elif elem > maxelem: + * raise OverflowError, "Elements must be <= %s" % maxelem # <<<<<<<<<<<<<< + * intBitSetAddElem(self.bitset, elem) * else: */ - __pyx_3 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L9;} - __pyx_2 = PyNumber_Remainder(__pyx_k_23p, __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L9;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_2, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L9;} - goto __pyx_L29; - } - __pyx_L29:; + __pyx_2 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; goto __pyx_L11;} + __pyx_3 = PyNumber_Remainder(__pyx_k_22p, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; goto __pyx_L11;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_3, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; goto __pyx_L11;} + goto __pyx_L46; + } + __pyx_L46:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":197 - * elif elem > maxelem: - * raise OverflowError, "Elements must be <= %s" % maxelem - * intBitSetAddElem(self.bitset, elem) # <<<<<<<<<<<<<< + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":249 + * elif elem > maxelem: + * raise OverflowError, "Elements must be <= %s" % maxelem + * intBitSetAddElem(self.bitset, elem) # <<<<<<<<<<<<<< * else: - * for elem in rhs: + * if tuple_of_tuples: */ - intBitSetAddElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,__pyx_v_elem); + intBitSetAddElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_elem); + } + Py_DECREF(__pyx_5); __pyx_5 = 0; } - Py_DECREF(__pyx_5); __pyx_5 = 0; - goto __pyx_L26; + __pyx_L40:; + goto __pyx_L39; } /*else*/ { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":199 - * intBitSetAddElem(self.bitset, elem) + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":251 + * intBitSetAddElem(self.bitset, elem) * else: - * for elem in rhs: # <<<<<<<<<<<<<< - * intBitSetAddElem(self.bitset, elem) - * except Exception, msg: + * if tuple_of_tuples: # <<<<<<<<<<<<<< + * for tmp_tuple in rhs: + * elem = tmp_tuple[0] */ - if (PyList_CheckExact(__pyx_v_rhs)) { __pyx_8 = 0; __pyx_6 = __pyx_v_rhs; Py_INCREF(__pyx_6); } - else { __pyx_6 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L9;} } - for (;;) { - if (PyList_CheckExact(__pyx_6)) { if (__pyx_8 >= PyList_GET_SIZE(__pyx_6)) break; __pyx_3 = PyList_GET_ITEM(__pyx_6, __pyx_8++); Py_INCREF(__pyx_3); } - else { - __pyx_3 = PyIter_Next(__pyx_6); - if (!__pyx_3) { - break; + __pyx_7 = __pyx_v_tuple_of_tuples; + if (__pyx_7) { + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":252 + * else: + * if tuple_of_tuples: + * for tmp_tuple in rhs: # <<<<<<<<<<<<<< + * elem = tmp_tuple[0] + * intBitSetAddElem(self.bitset, elem) + */ + if (PyList_CheckExact(__pyx_v_rhs)) { __pyx_8 = 0; __pyx_6 = __pyx_v_rhs; Py_INCREF(__pyx_6); } + else { __pyx_6 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; goto __pyx_L11;} } + for (;;) { + if (PyList_CheckExact(__pyx_6)) { if (__pyx_8 >= PyList_GET_SIZE(__pyx_6)) break; __pyx_2 = PyList_GET_ITEM(__pyx_6, __pyx_8++); Py_INCREF(__pyx_2); } + else { + __pyx_2 = PyIter_Next(__pyx_6); + if (!__pyx_2) { + break; + } } + Py_DECREF(__pyx_v_tmp_tuple); + __pyx_v_tmp_tuple = __pyx_2; + __pyx_2 = 0; + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":253 + * if tuple_of_tuples: + * for tmp_tuple in rhs: + * elem = tmp_tuple[0] # <<<<<<<<<<<<<< + * intBitSetAddElem(self.bitset, elem) + * else: + */ + if (PyList_CheckExact(__pyx_v_tmp_tuple) && 0 <= 0 && 0 < PyList_GET_SIZE(__pyx_v_tmp_tuple)) { + __pyx_5 = PyList_GET_ITEM(__pyx_v_tmp_tuple, 0); Py_INCREF(__pyx_5); + } else if (PyTuple_CheckExact(__pyx_v_tmp_tuple) && 0 <= 0 && 0 < PyTuple_GET_SIZE(__pyx_v_tmp_tuple)) { + __pyx_5 = PyTuple_GET_ITEM(__pyx_v_tmp_tuple, 0); Py_INCREF(__pyx_5); + } else { + __pyx_3 = PyInt_FromLong(0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; goto __pyx_L11;} + __pyx_5 = PyObject_GetItem(__pyx_v_tmp_tuple, __pyx_3); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; goto __pyx_L11;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + } + __pyx_1 = __pyx_PyInt_int(__pyx_5); if (unlikely((__pyx_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; goto __pyx_L11;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_v_elem = __pyx_1; + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":254 + * for tmp_tuple in rhs: + * elem = tmp_tuple[0] + * intBitSetAddElem(self.bitset, elem) # <<<<<<<<<<<<<< + * else: + * for elem in rhs: + */ + intBitSetAddElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_elem); } - __pyx_1 = __pyx_PyInt_int(__pyx_3); if (unlikely((__pyx_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L9;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_v_elem = __pyx_1; + Py_DECREF(__pyx_6); __pyx_6 = 0; + goto __pyx_L47; + } + /*else*/ { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":200 - * else: - * for elem in rhs: - * intBitSetAddElem(self.bitset, elem) # <<<<<<<<<<<<<< + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":256 + * intBitSetAddElem(self.bitset, elem) + * else: + * for elem in rhs: # <<<<<<<<<<<<<< + * intBitSetAddElem(self.bitset, elem) + * except Exception, msg: + */ + if (PyList_CheckExact(__pyx_v_rhs)) { __pyx_8 = 0; __pyx_2 = __pyx_v_rhs; Py_INCREF(__pyx_2); } + else { __pyx_2 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; goto __pyx_L11;} } + for (;;) { + if (PyList_CheckExact(__pyx_2)) { if (__pyx_8 >= PyList_GET_SIZE(__pyx_2)) break; __pyx_3 = PyList_GET_ITEM(__pyx_2, __pyx_8++); Py_INCREF(__pyx_3); } + else { + __pyx_3 = PyIter_Next(__pyx_2); + if (!__pyx_3) { + break; + } + } + __pyx_1 = __pyx_PyInt_int(__pyx_3); if (unlikely((__pyx_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; goto __pyx_L11;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_v_elem = __pyx_1; + + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":257 + * else: + * for elem in rhs: + * intBitSetAddElem(self.bitset, elem) # <<<<<<<<<<<<<< * except Exception, msg: * raise ValueError, "retrieving integers from rhs is impossible: %s" % msg */ - intBitSetAddElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,__pyx_v_elem); + intBitSetAddElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_elem); + } + Py_DECREF(__pyx_2); __pyx_2 = 0; } - Py_DECREF(__pyx_6); __pyx_6 = 0; + __pyx_L47:; } - __pyx_L26:; + __pyx_L39:; } - __pyx_L15:; + __pyx_L17:; } - goto __pyx_L10; - __pyx_L9:; - Py_XDECREF(__pyx_2); __pyx_2 = 0; + goto __pyx_L12; + __pyx_L11:; Py_XDECREF(__pyx_5); __pyx_5 = 0; - Py_XDECREF(__pyx_3); __pyx_3 = 0; Py_XDECREF(__pyx_6); __pyx_6 = 0; + Py_XDECREF(__pyx_3); __pyx_3 = 0; + Py_XDECREF(__pyx_2); __pyx_2 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":201 - * for elem in rhs: - * intBitSetAddElem(self.bitset, elem) + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":258 + * for elem in rhs: + * intBitSetAddElem(self.bitset, elem) * except Exception, msg: # <<<<<<<<<<<<<< * raise ValueError, "retrieving integers from rhs is impossible: %s" % msg * else: */ __pyx_1 = PyErr_ExceptionMatches(__pyx_builtin_Exception); if (__pyx_1) { __Pyx_AddTraceback("intbitset.__cinit__"); - if (__Pyx_GetException(&__pyx_2, &__pyx_5, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; goto __pyx_L1;} - Py_INCREF(__pyx_5); + if (__Pyx_GetException(&__pyx_5, &__pyx_6, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; goto __pyx_L1;} + Py_INCREF(__pyx_6); Py_DECREF(__pyx_v_msg); - __pyx_v_msg = __pyx_5; + __pyx_v_msg = __pyx_6; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":202 - * intBitSetAddElem(self.bitset, elem) + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":259 + * intBitSetAddElem(self.bitset, elem) * except Exception, msg: * raise ValueError, "retrieving integers from rhs is impossible: %s" % msg # <<<<<<<<<<<<<< * else: * raise TypeError, "rhs is of unknown type %s" % type(rhs) */ - __pyx_6 = PyNumber_Remainder(__pyx_k_24p, __pyx_v_msg); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; goto __pyx_L1;} - __Pyx_Raise(__pyx_builtin_ValueError, __pyx_6, 0); - Py_DECREF(__pyx_6); __pyx_6 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; goto __pyx_L1;} + __pyx_2 = PyNumber_Remainder(__pyx_k_23p, __pyx_v_msg); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; goto __pyx_L1;} + __Pyx_Raise(__pyx_builtin_ValueError, __pyx_2, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; + Py_DECREF(__pyx_6); __pyx_6 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - goto __pyx_L10; + goto __pyx_L12; } goto __pyx_L1; - __pyx_L10:; - goto __pyx_L3; + __pyx_L12:; + goto __pyx_L5; } /*else*/ { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":204 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":261 * raise ValueError, "retrieving integers from rhs is impossible: %s" % msg * else: * raise TypeError, "rhs is of unknown type %s" % type(rhs) # <<<<<<<<<<<<<< * * def __dealloc__(self): */ - __pyx_6 = PyTuple_New(1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; goto __pyx_L1;} Py_INCREF(__pyx_v_rhs); - PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_rhs); - __pyx_2 = PyObject_Call(((PyObject*)&PyType_Type), __pyx_6, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; goto __pyx_L1;} - Py_DECREF(__pyx_6); __pyx_6 = 0; - __pyx_5 = PyNumber_Remainder(__pyx_k_25p, __pyx_2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_rhs); + __pyx_5 = PyObject_Call(((PyObject*)&PyType_Type), __pyx_2, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_builtin_TypeError, __pyx_5, 0); + __pyx_6 = PyNumber_Remainder(__pyx_k_24p, __pyx_5); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; goto __pyx_L1;} + __Pyx_Raise(__pyx_builtin_TypeError, __pyx_6, 0); + Py_DECREF(__pyx_6); __pyx_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; goto __pyx_L1;} } - __pyx_L3:; + __pyx_L5:; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_5); Py_XDECREF(__pyx_6); __Pyx_AddTraceback("intbitset.intbitset.__cinit__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_msg); Py_DECREF(__pyx_v_tmp); + Py_DECREF(__pyx_v_tmp_tuple); Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_rhs); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":206 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":263 * raise TypeError, "rhs is of unknown type %s" % type(rhs) * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.bitset: * intBitSetDestroy(self.bitset) */ static void __pyx_pf_9intbitset_9intbitset___dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pf_9intbitset_9intbitset___dealloc__(PyObject *__pyx_v_self) { int __pyx_1; Py_INCREF(__pyx_v_self); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":207 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":264 * * def __dealloc__(self): * if self.bitset: # <<<<<<<<<<<<<< * intBitSetDestroy(self.bitset) * */ __pyx_1 = (((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset != 0); if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":208 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":265 * def __dealloc__(self): * if self.bitset: * intBitSetDestroy(self.bitset) # <<<<<<<<<<<<<< * * def __contains__(self, int elem): */ intBitSetDestroy(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset); goto __pyx_L2; } __pyx_L2:; Py_DECREF(__pyx_v_self); } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":210 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":267 * intBitSetDestroy(self.bitset) * * def __contains__(self, int elem): # <<<<<<<<<<<<<< * if self.sanity_checks: * if elem < 0: */ +static PyObject *__pyx_k_25p; static PyObject *__pyx_k_26p; -static PyObject *__pyx_k_27p; -static char __pyx_k_26[] = "Negative numbers, not allowed"; -static char __pyx_k_27[] = "Element must be <= %s"; +static char __pyx_k_25[] = "Negative numbers, not allowed"; +static char __pyx_k_26[] = "Element must be <= %s"; static int __pyx_pf_9intbitset_9intbitset___contains__(PyObject *__pyx_v_self, PyObject *__pyx_arg_elem); /*proto*/ static int __pyx_pf_9intbitset_9intbitset___contains__(PyObject *__pyx_v_self, PyObject *__pyx_arg_elem) { int __pyx_v_elem; int __pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; - Py_INCREF(__pyx_v_self); assert(__pyx_arg_elem); { - __pyx_v_elem = __pyx_PyInt_int(__pyx_arg_elem); if (unlikely((__pyx_v_elem == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; goto __pyx_L1;} + __pyx_v_elem = __pyx_PyInt_int(__pyx_arg_elem); if (unlikely((__pyx_v_elem == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; goto __pyx_L1;} } + Py_INCREF(__pyx_v_self); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":211 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":268 * * def __contains__(self, int elem): * if self.sanity_checks: # <<<<<<<<<<<<<< * if elem < 0: * raise ValueError, "Negative numbers, not allowed" */ __pyx_1 = ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->sanity_checks; if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":212 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":269 * def __contains__(self, int elem): * if self.sanity_checks: * if elem < 0: # <<<<<<<<<<<<<< * raise ValueError, "Negative numbers, not allowed" * elif elem > maxelem: */ __pyx_1 = (__pyx_v_elem < 0); if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":213 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":270 * if self.sanity_checks: * if elem < 0: * raise ValueError, "Negative numbers, not allowed" # <<<<<<<<<<<<<< * elif elem > maxelem: * raise OverflowError, "Element must be <= %s" % maxelem */ - __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_26p, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; goto __pyx_L1;} + __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_25p, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; goto __pyx_L1;} goto __pyx_L3; } - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":214 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":271 * if elem < 0: * raise ValueError, "Negative numbers, not allowed" * elif elem > maxelem: # <<<<<<<<<<<<<< * raise OverflowError, "Element must be <= %s" % maxelem * return intBitSetIsInElem(self.bitset, elem) != 0 */ __pyx_1 = (__pyx_v_elem > maxelem); if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":215 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":272 * raise ValueError, "Negative numbers, not allowed" * elif elem > maxelem: * raise OverflowError, "Element must be <= %s" % maxelem # <<<<<<<<<<<<<< * return intBitSetIsInElem(self.bitset, elem) != 0 * */ - __pyx_2 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; goto __pyx_L1;} - __pyx_3 = PyNumber_Remainder(__pyx_k_27p, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; goto __pyx_L1;} + __pyx_3 = PyNumber_Remainder(__pyx_k_26p, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_3, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; goto __pyx_L2; } __pyx_L2:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":216 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":273 * elif elem > maxelem: * raise OverflowError, "Element must be <= %s" % maxelem * return intBitSetIsInElem(self.bitset, elem) != 0 # <<<<<<<<<<<<<< * * def __cmp__(self, intbitset rhs not None): */ - __pyx_r = (intBitSetIsInElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,__pyx_v_elem) != 0); + __pyx_r = (intBitSetIsInElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_elem) != 0); goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("intbitset.intbitset.__contains__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":218 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":275 * return intBitSetIsInElem(self.bitset, elem) != 0 * * def __cmp__(self, intbitset rhs not None): # <<<<<<<<<<<<<< * raise TypeError, "cannot compare intbitset using cmp()" * */ -static PyObject *__pyx_k_28p; +static PyObject *__pyx_k_27p; -static char __pyx_k_28[] = "cannot compare intbitset using cmp()"; +static char __pyx_k_27[] = "cannot compare intbitset using cmp()"; static int __pyx_pf_9intbitset_9intbitset___cmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static int __pyx_pf_9intbitset_9intbitset___cmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { int __pyx_r; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_rhs); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9intbitset_intbitset, 0, "rhs"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; goto __pyx_L1;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9intbitset_intbitset, 0, "rhs"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;} - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":219 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":276 * * def __cmp__(self, intbitset rhs not None): * raise TypeError, "cannot compare intbitset using cmp()" # <<<<<<<<<<<<<< * * def __richcmp__(self, intbitset rhs not None, int op): */ - __Pyx_Raise(__pyx_builtin_TypeError, __pyx_k_28p, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; goto __pyx_L1;} + __Pyx_Raise(__pyx_builtin_TypeError, __pyx_k_27p, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; goto __pyx_L1;} __pyx_r = 0; goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("intbitset.intbitset.__cmp__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_rhs); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":221 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":278 * raise TypeError, "cannot compare intbitset using cmp()" * * def __richcmp__(self, intbitset rhs not None, int op): # <<<<<<<<<<<<<< * cdef short unsigned int tmp * tmp = intBitSetCmp((self).bitset, rhs.bitset) */ static PyObject *__pyx_num_2; static PyObject *__pyx_pf_9intbitset_9intbitset___richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs, int __pyx_v_op); /*proto*/ static PyObject *__pyx_pf_9intbitset_9intbitset___richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs, int __pyx_v_op) { unsigned short __pyx_v_tmp; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_rhs); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9intbitset_intbitset, 0, "rhs"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; goto __pyx_L1;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9intbitset_intbitset, 0, "rhs"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;} - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":223 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":280 * def __richcmp__(self, intbitset rhs not None, int op): * cdef short unsigned int tmp * tmp = intBitSetCmp((self).bitset, rhs.bitset) # <<<<<<<<<<<<<< * if op == 0: # < * return tmp == 1 */ - __pyx_v_tmp = intBitSetCmp(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_rhs)->bitset); + __pyx_v_tmp = intBitSetCmp(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_rhs)->bitset); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":224 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":281 * cdef short unsigned int tmp * tmp = intBitSetCmp((self).bitset, rhs.bitset) * if op == 0: # < # <<<<<<<<<<<<<< * return tmp == 1 * if op == 1: # <= */ __pyx_1 = (__pyx_v_op == 0); if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":225 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":282 * tmp = intBitSetCmp((self).bitset, rhs.bitset) * if op == 0: # < * return tmp == 1 # <<<<<<<<<<<<<< * if op == 1: # <= * return tmp <= 1 */ - __pyx_2 = __Pyx_PyBool_FromLong((__pyx_v_tmp == 1)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} + __pyx_2 = __Pyx_PyBool_FromLong((__pyx_v_tmp == 1)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; goto __pyx_L2; } __pyx_L2:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":226 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":283 * if op == 0: # < * return tmp == 1 * if op == 1: # <= # <<<<<<<<<<<<<< * return tmp <= 1 * if op == 2: # == */ __pyx_1 = (__pyx_v_op == 1); if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":227 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":284 * return tmp == 1 * if op == 1: # <= * return tmp <= 1 # <<<<<<<<<<<<<< * if op == 2: # == * return tmp == 0 */ - __pyx_2 = __Pyx_PyBool_FromLong((__pyx_v_tmp <= 1)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;} + __pyx_2 = __Pyx_PyBool_FromLong((__pyx_v_tmp <= 1)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; goto __pyx_L3; } __pyx_L3:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":228 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":285 * if op == 1: # <= * return tmp <= 1 * if op == 2: # == # <<<<<<<<<<<<<< * return tmp == 0 * if op == 3: # != */ __pyx_1 = (__pyx_v_op == 2); if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":229 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":286 * return tmp <= 1 * if op == 2: # == * return tmp == 0 # <<<<<<<<<<<<<< * if op == 3: # != * return tmp > 0 */ - __pyx_2 = __Pyx_PyBool_FromLong((__pyx_v_tmp == 0)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} + __pyx_2 = __Pyx_PyBool_FromLong((__pyx_v_tmp == 0)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; goto __pyx_L4; } __pyx_L4:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":230 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":287 * if op == 2: # == * return tmp == 0 * if op == 3: # != # <<<<<<<<<<<<<< * return tmp > 0 * if op == 4: # > */ __pyx_1 = (__pyx_v_op == 3); if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":231 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":288 * return tmp == 0 * if op == 3: # != * return tmp > 0 # <<<<<<<<<<<<<< * if op == 4: # > * return tmp == 2 */ - __pyx_2 = __Pyx_PyBool_FromLong((__pyx_v_tmp > 0)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;} + __pyx_2 = __Pyx_PyBool_FromLong((__pyx_v_tmp > 0)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; goto __pyx_L5; } __pyx_L5:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":232 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":289 * if op == 3: # != * return tmp > 0 * if op == 4: # > # <<<<<<<<<<<<<< * return tmp == 2 * if op == 5: # >= */ __pyx_1 = (__pyx_v_op == 4); if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":233 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":290 * return tmp > 0 * if op == 4: # > * return tmp == 2 # <<<<<<<<<<<<<< * if op == 5: # >= * return tmp in (0, 2) */ - __pyx_2 = __Pyx_PyBool_FromLong((__pyx_v_tmp == 2)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; goto __pyx_L1;} + __pyx_2 = __Pyx_PyBool_FromLong((__pyx_v_tmp == 2)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; goto __pyx_L6; } __pyx_L6:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":234 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":291 * if op == 4: # > * return tmp == 2 * if op == 5: # >= # <<<<<<<<<<<<<< * return tmp in (0, 2) * */ __pyx_1 = (__pyx_v_op == 5); if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":235 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":292 * return tmp == 2 * if op == 5: # >= * return tmp in (0, 2) # <<<<<<<<<<<<<< * * def __len__(self): */ - __pyx_2 = PyInt_FromLong(__pyx_v_tmp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; goto __pyx_L1;} - __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(__pyx_v_tmp); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; goto __pyx_L1;} Py_INCREF(__pyx_num_0); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_num_0); Py_INCREF(__pyx_num_2); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_num_2); - __pyx_1 = (PySequence_Contains(__pyx_3, __pyx_2)); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; goto __pyx_L1;} + __pyx_1 = (PySequence_Contains(__pyx_3, __pyx_2)); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_2 = __Pyx_PyBool_FromLong(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; goto __pyx_L1;} + __pyx_2 = __Pyx_PyBool_FromLong(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; goto __pyx_L7; } __pyx_L7:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("intbitset.intbitset.__richcmp__"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_rhs); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":237 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":294 * return tmp in (0, 2) * * def __len__(self): # <<<<<<<<<<<<<< * return intBitSetGetTot(self.bitset) * */ static Py_ssize_t __pyx_pf_9intbitset_9intbitset___len__(PyObject *__pyx_v_self); /*proto*/ static Py_ssize_t __pyx_pf_9intbitset_9intbitset___len__(PyObject *__pyx_v_self) { Py_ssize_t __pyx_r; Py_INCREF(__pyx_v_self); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":238 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":295 * * def __len__(self): * return intBitSetGetTot(self.bitset) # <<<<<<<<<<<<<< * * def __hash__(self): */ __pyx_r = intBitSetGetTot(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset); goto __pyx_L0; __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":240 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":297 * return intBitSetGetTot(self.bitset) * * def __hash__(self): # <<<<<<<<<<<<<< * return hash(PyString_FromStringAndSize(self.bitset.bitset, wordbytesize * (intBitSetGetTot(self.bitset) / wordbitsize + 1))) * */ static long __pyx_pf_9intbitset_9intbitset___hash__(PyObject *__pyx_v_self); /*proto*/ static long __pyx_pf_9intbitset_9intbitset___hash__(PyObject *__pyx_v_self) { long __pyx_r; PyObject *__pyx_1 = 0; long __pyx_2; Py_INCREF(__pyx_v_self); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":241 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":298 * * def __hash__(self): * return hash(PyString_FromStringAndSize(self.bitset.bitset, wordbytesize * (intBitSetGetTot(self.bitset) / wordbitsize + 1))) # <<<<<<<<<<<<<< * * def __nonzero__(self): */ - __pyx_1 = PyString_FromStringAndSize(((char *)((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset->bitset),(wordbytesize * ((intBitSetGetTot(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset) / wordbitsize) + 1))); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; goto __pyx_L1;} - __pyx_2 = PyObject_Hash(__pyx_1); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; goto __pyx_L1;} + __pyx_1 = PyString_FromStringAndSize(((char *)((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset->bitset), (wordbytesize * ((intBitSetGetTot(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset) / wordbitsize) + 1))); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; goto __pyx_L1;} + __pyx_2 = PyObject_Hash(__pyx_1); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_r = __pyx_2; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("intbitset.intbitset.__hash__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":243 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":300 * return hash(PyString_FromStringAndSize(self.bitset.bitset, wordbytesize * (intBitSetGetTot(self.bitset) / wordbitsize + 1))) * * def __nonzero__(self): # <<<<<<<<<<<<<< * return not intBitSetEmpty(self.bitset) * */ static int __pyx_pf_9intbitset_9intbitset___nonzero__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pf_9intbitset_9intbitset___nonzero__(PyObject *__pyx_v_self) { int __pyx_r; Py_INCREF(__pyx_v_self); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":244 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":301 * * def __nonzero__(self): * return not intBitSetEmpty(self.bitset) # <<<<<<<<<<<<<< * * def __iadd__(self, rhs): */ __pyx_r = (!intBitSetEmpty(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset)); goto __pyx_L0; __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":246 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":303 * return not intBitSetEmpty(self.bitset) * * def __iadd__(self, rhs): # <<<<<<<<<<<<<< * cdef int elem * if isinstance(rhs, (int, long)): */ +static PyObject *__pyx_k_28p; static PyObject *__pyx_k_29p; static PyObject *__pyx_k_30p; static PyObject *__pyx_k_31p; static PyObject *__pyx_k_32p; static PyObject *__pyx_k_33p; -static PyObject *__pyx_k_34p; -static char __pyx_k_29[] = "Negative numbers, not allowed"; -static char __pyx_k_30[] = "rhs must be <= %s"; -static char __pyx_k_31[] = "Negative numbers, not allowed"; -static char __pyx_k_32[] = "Elements must be <= %s"; -static char __pyx_k_33[] = "Negative numbers, not allowed"; -static char __pyx_k_34[] = "Elements must be <= %s"; +static char __pyx_k_28[] = "Negative numbers, not allowed"; +static char __pyx_k_29[] = "rhs must be <= %s"; +static char __pyx_k_30[] = "Negative numbers, not allowed"; +static char __pyx_k_31[] = "Elements must be <= %s"; +static char __pyx_k_32[] = "Negative numbers, not allowed"; +static char __pyx_k_33[] = "Elements must be <= %s"; static PyObject *__pyx_pf_9intbitset_9intbitset___iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pf_9intbitset_9intbitset___iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { int __pyx_v_elem; PyObject *__pyx_r; PyObject *__pyx_1 = 0; int __pyx_2; PyObject *__pyx_3 = 0; int __pyx_4; - Py_ssize_t __pyx_5; + Py_ssize_t __pyx_5 = 0; PyObject *__pyx_6 = 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_rhs); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":248 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":305 * def __iadd__(self, rhs): * cdef int elem * if isinstance(rhs, (int, long)): # <<<<<<<<<<<<<< * if self.sanity_checks: * if rhs < 0: */ - __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; goto __pyx_L1;} + __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; goto __pyx_L1;} Py_INCREF(((PyObject*)&PyInt_Type)); PyTuple_SET_ITEM(__pyx_1, 0, ((PyObject*)&PyInt_Type)); Py_INCREF(((PyObject*)&PyLong_Type)); PyTuple_SET_ITEM(__pyx_1, 1, ((PyObject*)&PyLong_Type)); - __pyx_2 = PyObject_IsInstance(__pyx_v_rhs,__pyx_1); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; goto __pyx_L1;} + __pyx_2 = PyObject_IsInstance(__pyx_v_rhs, __pyx_1); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_2) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":249 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":306 * cdef int elem * if isinstance(rhs, (int, long)): * if self.sanity_checks: # <<<<<<<<<<<<<< * if rhs < 0: * raise ValueError, "Negative numbers, not allowed" */ __pyx_2 = ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->sanity_checks; if (__pyx_2) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":250 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":307 * if isinstance(rhs, (int, long)): * if self.sanity_checks: * if rhs < 0: # <<<<<<<<<<<<<< * raise ValueError, "Negative numbers, not allowed" * elif rhs > maxelem: */ - __pyx_1 = PyObject_RichCompare(__pyx_v_rhs, __pyx_num_0, Py_LT); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;} - __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;} + __pyx_1 = PyObject_RichCompare(__pyx_v_rhs, __pyx_num_0, Py_LT); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; goto __pyx_L1;} + __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_2) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":251 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":308 * if self.sanity_checks: * if rhs < 0: * raise ValueError, "Negative numbers, not allowed" # <<<<<<<<<<<<<< * elif rhs > maxelem: * raise OverflowError, "rhs must be <= %s" % maxelem */ - __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_29p, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; goto __pyx_L1;} + __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_28p, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; goto __pyx_L1;} goto __pyx_L4; } - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":252 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":309 * if rhs < 0: * raise ValueError, "Negative numbers, not allowed" * elif rhs > maxelem: # <<<<<<<<<<<<<< * raise OverflowError, "rhs must be <= %s" % maxelem * intBitSetAddElem(self.bitset, rhs) */ - __pyx_1 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; goto __pyx_L1;} - __pyx_3 = PyObject_RichCompare(__pyx_v_rhs, __pyx_1, Py_GT); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; goto __pyx_L1;} + __pyx_1 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;} + __pyx_3 = PyObject_RichCompare(__pyx_v_rhs, __pyx_1, Py_GT); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; goto __pyx_L1;} + __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_2) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":253 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":310 * raise ValueError, "Negative numbers, not allowed" * elif rhs > maxelem: * raise OverflowError, "rhs must be <= %s" % maxelem # <<<<<<<<<<<<<< * intBitSetAddElem(self.bitset, rhs) * elif isinstance(rhs, intbitset): */ - __pyx_1 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; goto __pyx_L1;} - __pyx_3 = PyNumber_Remainder(__pyx_k_30p, __pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; goto __pyx_L1;} + __pyx_1 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; goto __pyx_L1;} + __pyx_3 = PyNumber_Remainder(__pyx_k_29p, __pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_3, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; goto __pyx_L3; } __pyx_L3:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":254 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":311 * elif rhs > maxelem: * raise OverflowError, "rhs must be <= %s" % maxelem * intBitSetAddElem(self.bitset, rhs) # <<<<<<<<<<<<<< * elif isinstance(rhs, intbitset): * intBitSetIUnion(self.bitset, ( rhs).bitset) */ - __pyx_4 = __pyx_PyInt_int(__pyx_v_rhs); if (unlikely((__pyx_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; goto __pyx_L1;} - intBitSetAddElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,__pyx_4); + __pyx_4 = __pyx_PyInt_int(__pyx_v_rhs); if (unlikely((__pyx_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; goto __pyx_L1;} + intBitSetAddElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_4); goto __pyx_L2; } - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":255 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":312 * raise OverflowError, "rhs must be <= %s" % maxelem * intBitSetAddElem(self.bitset, rhs) * elif isinstance(rhs, intbitset): # <<<<<<<<<<<<<< * intBitSetIUnion(self.bitset, ( rhs).bitset) * else: */ - __pyx_2 = PyObject_IsInstance(__pyx_v_rhs,((PyObject*)__pyx_ptype_9intbitset_intbitset)); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; goto __pyx_L1;} + __pyx_2 = PyObject_IsInstance(__pyx_v_rhs, ((PyObject*)__pyx_ptype_9intbitset_intbitset)); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; goto __pyx_L1;} if (__pyx_2) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":256 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":313 * intBitSetAddElem(self.bitset, rhs) * elif isinstance(rhs, intbitset): * intBitSetIUnion(self.bitset, ( rhs).bitset) # <<<<<<<<<<<<<< * else: * if self.sanity_checks: */ - intBitSetIUnion(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_rhs)->bitset); + intBitSetIUnion(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_rhs)->bitset); goto __pyx_L2; } /*else*/ { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":258 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":315 * intBitSetIUnion(self.bitset, ( rhs).bitset) * else: * if self.sanity_checks: # <<<<<<<<<<<<<< * for elem in rhs: * if elem < 0: */ __pyx_2 = ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->sanity_checks; if (__pyx_2) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":259 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":316 * else: * if self.sanity_checks: * for elem in rhs: # <<<<<<<<<<<<<< * if elem < 0: * raise ValueError, "Negative numbers, not allowed" */ if (PyList_CheckExact(__pyx_v_rhs)) { __pyx_5 = 0; __pyx_1 = __pyx_v_rhs; Py_INCREF(__pyx_1); } - else { __pyx_1 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; goto __pyx_L1;} } + else { __pyx_1 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; goto __pyx_L1;} } for (;;) { if (PyList_CheckExact(__pyx_1)) { if (__pyx_5 >= PyList_GET_SIZE(__pyx_1)) break; __pyx_3 = PyList_GET_ITEM(__pyx_1, __pyx_5++); Py_INCREF(__pyx_3); } else { __pyx_3 = PyIter_Next(__pyx_1); if (!__pyx_3) { break; } } - __pyx_4 = __pyx_PyInt_int(__pyx_3); if (unlikely((__pyx_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; goto __pyx_L1;} + __pyx_4 = __pyx_PyInt_int(__pyx_3); if (unlikely((__pyx_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_v_elem = __pyx_4; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":260 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":317 * if self.sanity_checks: * for elem in rhs: * if elem < 0: # <<<<<<<<<<<<<< * raise ValueError, "Negative numbers, not allowed" * elif elem > maxelem: */ __pyx_2 = (__pyx_v_elem < 0); if (__pyx_2) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":261 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":318 * for elem in rhs: * if elem < 0: * raise ValueError, "Negative numbers, not allowed" # <<<<<<<<<<<<<< * elif elem > maxelem: * raise OverflowError, "Elements must be <= %s" % maxelem */ - __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_31p, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; goto __pyx_L1;} + __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_30p, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;} goto __pyx_L8; } - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":262 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":319 * if elem < 0: * raise ValueError, "Negative numbers, not allowed" * elif elem > maxelem: # <<<<<<<<<<<<<< * raise OverflowError, "Elements must be <= %s" % maxelem * intBitSetAddElem(self.bitset, elem) */ __pyx_2 = (__pyx_v_elem > maxelem); if (__pyx_2) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":263 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":320 * raise ValueError, "Negative numbers, not allowed" * elif elem > maxelem: * raise OverflowError, "Elements must be <= %s" % maxelem # <<<<<<<<<<<<<< * intBitSetAddElem(self.bitset, elem) * else: */ - __pyx_3 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; goto __pyx_L1;} - __pyx_6 = PyNumber_Remainder(__pyx_k_32p, __pyx_3); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;} + __pyx_6 = PyNumber_Remainder(__pyx_k_31p, __pyx_3); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_6, 0); Py_DECREF(__pyx_6); __pyx_6 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;} goto __pyx_L8; } __pyx_L8:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":264 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":321 * elif elem > maxelem: * raise OverflowError, "Elements must be <= %s" % maxelem * intBitSetAddElem(self.bitset, elem) # <<<<<<<<<<<<<< * else: * for elem in rhs: */ - intBitSetAddElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,__pyx_v_elem); + intBitSetAddElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_elem); } Py_DECREF(__pyx_1); __pyx_1 = 0; goto __pyx_L5; } /*else*/ { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":266 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":323 * intBitSetAddElem(self.bitset, elem) * else: * for elem in rhs: # <<<<<<<<<<<<<< * if elem < 0: * raise ValueError, "Negative numbers, not allowed" */ if (PyList_CheckExact(__pyx_v_rhs)) { __pyx_5 = 0; __pyx_3 = __pyx_v_rhs; Py_INCREF(__pyx_3); } - else { __pyx_3 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; goto __pyx_L1;} } + else { __pyx_3 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; goto __pyx_L1;} } for (;;) { if (PyList_CheckExact(__pyx_3)) { if (__pyx_5 >= PyList_GET_SIZE(__pyx_3)) break; __pyx_6 = PyList_GET_ITEM(__pyx_3, __pyx_5++); Py_INCREF(__pyx_6); } else { __pyx_6 = PyIter_Next(__pyx_3); if (!__pyx_6) { break; } } - __pyx_4 = __pyx_PyInt_int(__pyx_6); if (unlikely((__pyx_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; goto __pyx_L1;} + __pyx_4 = __pyx_PyInt_int(__pyx_6); if (unlikely((__pyx_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; __pyx_v_elem = __pyx_4; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":267 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":324 * else: * for elem in rhs: * if elem < 0: # <<<<<<<<<<<<<< * raise ValueError, "Negative numbers, not allowed" * elif elem > maxelem: */ __pyx_2 = (__pyx_v_elem < 0); if (__pyx_2) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":268 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":325 * for elem in rhs: * if elem < 0: * raise ValueError, "Negative numbers, not allowed" # <<<<<<<<<<<<<< * elif elem > maxelem: * raise OverflowError, "Elements must be <= %s" % maxelem */ - __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_33p, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; goto __pyx_L1;} + __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_32p, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; goto __pyx_L1;} goto __pyx_L11; } - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":269 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":326 * if elem < 0: * raise ValueError, "Negative numbers, not allowed" * elif elem > maxelem: # <<<<<<<<<<<<<< * raise OverflowError, "Elements must be <= %s" % maxelem * intBitSetAddElem(self.bitset, elem) */ __pyx_2 = (__pyx_v_elem > maxelem); if (__pyx_2) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":270 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":327 * raise ValueError, "Negative numbers, not allowed" * elif elem > maxelem: * raise OverflowError, "Elements must be <= %s" % maxelem # <<<<<<<<<<<<<< * intBitSetAddElem(self.bitset, elem) * return self */ - __pyx_1 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; goto __pyx_L1;} - __pyx_6 = PyNumber_Remainder(__pyx_k_34p, __pyx_1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; goto __pyx_L1;} + __pyx_1 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; goto __pyx_L1;} + __pyx_6 = PyNumber_Remainder(__pyx_k_33p, __pyx_1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_6, 0); Py_DECREF(__pyx_6); __pyx_6 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; goto __pyx_L1;} goto __pyx_L11; } __pyx_L11:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":271 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":328 * elif elem > maxelem: * raise OverflowError, "Elements must be <= %s" % maxelem * intBitSetAddElem(self.bitset, elem) # <<<<<<<<<<<<<< * return self * */ - intBitSetAddElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,__pyx_v_elem); + intBitSetAddElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_elem); } Py_DECREF(__pyx_3); __pyx_3 = 0; } __pyx_L5:; } __pyx_L2:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":272 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":329 * raise OverflowError, "Elements must be <= %s" % maxelem * intBitSetAddElem(self.bitset, elem) * return self # <<<<<<<<<<<<<< * * def __isub__(self, rhs): */ Py_INCREF(__pyx_v_self); __pyx_r = __pyx_v_self; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_6); __Pyx_AddTraceback("intbitset.intbitset.__iadd__"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_rhs); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":274 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":331 * return self * * def __isub__(self, rhs): # <<<<<<<<<<<<<< * cdef int elem * if isinstance(rhs, (int, long)): */ +static PyObject *__pyx_k_34p; static PyObject *__pyx_k_35p; static PyObject *__pyx_k_36p; static PyObject *__pyx_k_37p; -static PyObject *__pyx_k_38p; -static char __pyx_k_35[] = "Negative numbers, not allowed"; -static char __pyx_k_36[] = "rhs must be <= %s"; -static char __pyx_k_37[] = "Negative numbers, not allowed"; -static char __pyx_k_38[] = "Elements must be <= %s"; +static char __pyx_k_34[] = "Negative numbers, not allowed"; +static char __pyx_k_35[] = "rhs must be <= %s"; +static char __pyx_k_36[] = "Negative numbers, not allowed"; +static char __pyx_k_37[] = "Elements must be <= %s"; static PyObject *__pyx_pf_9intbitset_9intbitset___isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pf_9intbitset_9intbitset___isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { int __pyx_v_elem; PyObject *__pyx_r; PyObject *__pyx_1 = 0; int __pyx_2; PyObject *__pyx_3 = 0; int __pyx_4; - Py_ssize_t __pyx_5; + Py_ssize_t __pyx_5 = 0; PyObject *__pyx_6 = 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_rhs); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":276 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":333 * def __isub__(self, rhs): * cdef int elem * if isinstance(rhs, (int, long)): # <<<<<<<<<<<<<< * if self.sanity_checks: * if rhs < 0: */ - __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; goto __pyx_L1;} + __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; goto __pyx_L1;} Py_INCREF(((PyObject*)&PyInt_Type)); PyTuple_SET_ITEM(__pyx_1, 0, ((PyObject*)&PyInt_Type)); Py_INCREF(((PyObject*)&PyLong_Type)); PyTuple_SET_ITEM(__pyx_1, 1, ((PyObject*)&PyLong_Type)); - __pyx_2 = PyObject_IsInstance(__pyx_v_rhs,__pyx_1); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; goto __pyx_L1;} + __pyx_2 = PyObject_IsInstance(__pyx_v_rhs, __pyx_1); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_2) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":277 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":334 * cdef int elem * if isinstance(rhs, (int, long)): * if self.sanity_checks: # <<<<<<<<<<<<<< * if rhs < 0: * raise ValueError, "Negative numbers, not allowed" */ __pyx_2 = ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->sanity_checks; if (__pyx_2) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":278 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":335 * if isinstance(rhs, (int, long)): * if self.sanity_checks: * if rhs < 0: # <<<<<<<<<<<<<< * raise ValueError, "Negative numbers, not allowed" * elif rhs > maxelem: */ - __pyx_1 = PyObject_RichCompare(__pyx_v_rhs, __pyx_num_0, Py_LT); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;} - __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;} + __pyx_1 = PyObject_RichCompare(__pyx_v_rhs, __pyx_num_0, Py_LT); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;} + __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_2) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":279 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":336 * if self.sanity_checks: * if rhs < 0: * raise ValueError, "Negative numbers, not allowed" # <<<<<<<<<<<<<< * elif rhs > maxelem: * raise OverflowError, "rhs must be <= %s" % maxelem */ - __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_35p, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; goto __pyx_L1;} + __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_34p, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; goto __pyx_L1;} goto __pyx_L4; } - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":280 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":337 * if rhs < 0: * raise ValueError, "Negative numbers, not allowed" * elif rhs > maxelem: # <<<<<<<<<<<<<< * raise OverflowError, "rhs must be <= %s" % maxelem * intBitSetDelElem(self.bitset, rhs) */ - __pyx_1 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; goto __pyx_L1;} - __pyx_3 = PyObject_RichCompare(__pyx_v_rhs, __pyx_1, Py_GT); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; goto __pyx_L1;} + __pyx_1 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;} + __pyx_3 = PyObject_RichCompare(__pyx_v_rhs, __pyx_1, Py_GT); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; goto __pyx_L1;} + __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_2) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":281 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":338 * raise ValueError, "Negative numbers, not allowed" * elif rhs > maxelem: * raise OverflowError, "rhs must be <= %s" % maxelem # <<<<<<<<<<<<<< * intBitSetDelElem(self.bitset, rhs) * elif isinstance(rhs, intbitset): */ - __pyx_1 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; goto __pyx_L1;} - __pyx_3 = PyNumber_Remainder(__pyx_k_36p, __pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; goto __pyx_L1;} + __pyx_1 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;} + __pyx_3 = PyNumber_Remainder(__pyx_k_35p, __pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_3, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; goto __pyx_L3; } __pyx_L3:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":282 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":339 * elif rhs > maxelem: * raise OverflowError, "rhs must be <= %s" % maxelem * intBitSetDelElem(self.bitset, rhs) # <<<<<<<<<<<<<< * elif isinstance(rhs, intbitset): * intBitSetISub(self.bitset, ( rhs).bitset) */ - __pyx_4 = __pyx_PyInt_int(__pyx_v_rhs); if (unlikely((__pyx_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; goto __pyx_L1;} - intBitSetDelElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,__pyx_4); + __pyx_4 = __pyx_PyInt_int(__pyx_v_rhs); if (unlikely((__pyx_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; goto __pyx_L1;} + intBitSetDelElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_4); goto __pyx_L2; } - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":283 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":340 * raise OverflowError, "rhs must be <= %s" % maxelem * intBitSetDelElem(self.bitset, rhs) * elif isinstance(rhs, intbitset): # <<<<<<<<<<<<<< * intBitSetISub(self.bitset, ( rhs).bitset) * else: */ - __pyx_2 = PyObject_IsInstance(__pyx_v_rhs,((PyObject*)__pyx_ptype_9intbitset_intbitset)); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; goto __pyx_L1;} + __pyx_2 = PyObject_IsInstance(__pyx_v_rhs, ((PyObject*)__pyx_ptype_9intbitset_intbitset)); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; goto __pyx_L1;} if (__pyx_2) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":284 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":341 * intBitSetDelElem(self.bitset, rhs) * elif isinstance(rhs, intbitset): * intBitSetISub(self.bitset, ( rhs).bitset) # <<<<<<<<<<<<<< * else: * if self.sanity_checks: */ - intBitSetISub(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_rhs)->bitset); + intBitSetISub(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_rhs)->bitset); goto __pyx_L2; } /*else*/ { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":286 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":343 * intBitSetISub(self.bitset, ( rhs).bitset) * else: * if self.sanity_checks: # <<<<<<<<<<<<<< * for elem in rhs: * if elem < 0: */ __pyx_2 = ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->sanity_checks; if (__pyx_2) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":287 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":344 * else: * if self.sanity_checks: * for elem in rhs: # <<<<<<<<<<<<<< * if elem < 0: * raise ValueError, "Negative numbers, not allowed" */ if (PyList_CheckExact(__pyx_v_rhs)) { __pyx_5 = 0; __pyx_1 = __pyx_v_rhs; Py_INCREF(__pyx_1); } - else { __pyx_1 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; goto __pyx_L1;} } + else { __pyx_1 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; goto __pyx_L1;} } for (;;) { if (PyList_CheckExact(__pyx_1)) { if (__pyx_5 >= PyList_GET_SIZE(__pyx_1)) break; __pyx_3 = PyList_GET_ITEM(__pyx_1, __pyx_5++); Py_INCREF(__pyx_3); } else { __pyx_3 = PyIter_Next(__pyx_1); if (!__pyx_3) { break; } } - __pyx_4 = __pyx_PyInt_int(__pyx_3); if (unlikely((__pyx_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; goto __pyx_L1;} + __pyx_4 = __pyx_PyInt_int(__pyx_3); if (unlikely((__pyx_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_v_elem = __pyx_4; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":288 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":345 * if self.sanity_checks: * for elem in rhs: * if elem < 0: # <<<<<<<<<<<<<< * raise ValueError, "Negative numbers, not allowed" * elif elem > maxelem: */ __pyx_2 = (__pyx_v_elem < 0); if (__pyx_2) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":289 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":346 * for elem in rhs: * if elem < 0: * raise ValueError, "Negative numbers, not allowed" # <<<<<<<<<<<<<< * elif elem > maxelem: * raise OverflowError, "Elements must be <= %s" % maxelem */ - __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_37p, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;} + __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_36p, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; goto __pyx_L1;} goto __pyx_L8; } - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":290 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":347 * if elem < 0: * raise ValueError, "Negative numbers, not allowed" * elif elem > maxelem: # <<<<<<<<<<<<<< * raise OverflowError, "Elements must be <= %s" % maxelem * intBitSetDelElem(self.bitset, elem) */ __pyx_2 = (__pyx_v_elem > maxelem); if (__pyx_2) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":291 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":348 * raise ValueError, "Negative numbers, not allowed" * elif elem > maxelem: * raise OverflowError, "Elements must be <= %s" % maxelem # <<<<<<<<<<<<<< * intBitSetDelElem(self.bitset, elem) * else: */ - __pyx_3 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; goto __pyx_L1;} - __pyx_6 = PyNumber_Remainder(__pyx_k_38p, __pyx_3); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;} + __pyx_6 = PyNumber_Remainder(__pyx_k_37p, __pyx_3); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_6, 0); Py_DECREF(__pyx_6); __pyx_6 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;} goto __pyx_L8; } __pyx_L8:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":292 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":349 * elif elem > maxelem: * raise OverflowError, "Elements must be <= %s" % maxelem * intBitSetDelElem(self.bitset, elem) # <<<<<<<<<<<<<< * else: * for elem in rhs: */ - intBitSetDelElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,__pyx_v_elem); + intBitSetDelElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_elem); } Py_DECREF(__pyx_1); __pyx_1 = 0; goto __pyx_L5; } /*else*/ { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":294 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":351 * intBitSetDelElem(self.bitset, elem) * else: * for elem in rhs: # <<<<<<<<<<<<<< * intBitSetDelElem(self.bitset, elem) * return self */ if (PyList_CheckExact(__pyx_v_rhs)) { __pyx_5 = 0; __pyx_3 = __pyx_v_rhs; Py_INCREF(__pyx_3); } - else { __pyx_3 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; goto __pyx_L1;} } + else { __pyx_3 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; goto __pyx_L1;} } for (;;) { if (PyList_CheckExact(__pyx_3)) { if (__pyx_5 >= PyList_GET_SIZE(__pyx_3)) break; __pyx_6 = PyList_GET_ITEM(__pyx_3, __pyx_5++); Py_INCREF(__pyx_6); } else { __pyx_6 = PyIter_Next(__pyx_3); if (!__pyx_6) { break; } } - __pyx_4 = __pyx_PyInt_int(__pyx_6); if (unlikely((__pyx_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; goto __pyx_L1;} + __pyx_4 = __pyx_PyInt_int(__pyx_6); if (unlikely((__pyx_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; __pyx_v_elem = __pyx_4; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":295 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":352 * else: * for elem in rhs: * intBitSetDelElem(self.bitset, elem) # <<<<<<<<<<<<<< * return self * */ - intBitSetDelElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,__pyx_v_elem); + intBitSetDelElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_elem); } Py_DECREF(__pyx_3); __pyx_3 = 0; } __pyx_L5:; } __pyx_L2:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":296 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":353 * for elem in rhs: * intBitSetDelElem(self.bitset, elem) * return self # <<<<<<<<<<<<<< * * def __deepcopy__(self, memo): */ Py_INCREF(__pyx_v_self); __pyx_r = __pyx_v_self; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_6); __Pyx_AddTraceback("intbitset.intbitset.__isub__"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_rhs); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":298 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":355 * return self * * def __deepcopy__(self, memo): # <<<<<<<<<<<<<< * return intbitset(self) * */ static PyObject *__pyx_pf_9intbitset_9intbitset___deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo); /*proto*/ static PyObject *__pyx_pf_9intbitset_9intbitset___deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_memo); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":299 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":356 * * def __deepcopy__(self, memo): * return intbitset(self) # <<<<<<<<<<<<<< * * def __del__(self, int elem): */ - __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; goto __pyx_L1;} + __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; goto __pyx_L1;} Py_INCREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self); - __pyx_2 = PyObject_Call(((PyObject*)__pyx_ptype_9intbitset_intbitset), __pyx_1, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; goto __pyx_L1;} + __pyx_2 = PyObject_Call(((PyObject*)__pyx_ptype_9intbitset_intbitset), __pyx_1, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("intbitset.intbitset.__deepcopy__"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_memo); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":301 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":358 * return intbitset(self) * * def __del__(self, int elem): # <<<<<<<<<<<<<< * if self.sanity_checks: * if elem < 0: */ +static PyObject *__pyx_k_38p; static PyObject *__pyx_k_39p; -static PyObject *__pyx_k_40p; -static char __pyx_k_39[] = "Negative numbers, not allowed"; -static char __pyx_k_40[] = "Element must be <= %s"; +static char __pyx_k_38[] = "Negative numbers, not allowed"; +static char __pyx_k_39[] = "Element must be <= %s"; static PyObject *__pyx_pf_9intbitset_9intbitset___del__(PyObject *__pyx_v_self, PyObject *__pyx_arg_elem); /*proto*/ static PyObject *__pyx_pf_9intbitset_9intbitset___del__(PyObject *__pyx_v_self, PyObject *__pyx_arg_elem) { int __pyx_v_elem; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; - Py_INCREF(__pyx_v_self); assert(__pyx_arg_elem); { - __pyx_v_elem = __pyx_PyInt_int(__pyx_arg_elem); if (unlikely((__pyx_v_elem == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; goto __pyx_L1;} + __pyx_v_elem = __pyx_PyInt_int(__pyx_arg_elem); if (unlikely((__pyx_v_elem == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; goto __pyx_L1;} } + Py_INCREF(__pyx_v_self); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":302 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":359 * * def __del__(self, int elem): * if self.sanity_checks: # <<<<<<<<<<<<<< * if elem < 0: * raise ValueError, "Negative numbers, not allowed" */ __pyx_1 = ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->sanity_checks; if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":303 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":360 * def __del__(self, int elem): * if self.sanity_checks: * if elem < 0: # <<<<<<<<<<<<<< * raise ValueError, "Negative numbers, not allowed" * elif elem > maxelem: */ __pyx_1 = (__pyx_v_elem < 0); if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":304 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":361 * if self.sanity_checks: * if elem < 0: * raise ValueError, "Negative numbers, not allowed" # <<<<<<<<<<<<<< * elif elem > maxelem: * raise OverflowError, "Element must be <= %s" % maxelem */ - __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_39p, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; goto __pyx_L1;} + __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_38p, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; goto __pyx_L1;} goto __pyx_L3; } - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":305 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":362 * if elem < 0: * raise ValueError, "Negative numbers, not allowed" * elif elem > maxelem: # <<<<<<<<<<<<<< * raise OverflowError, "Element must be <= %s" % maxelem * intBitSetDelElem(self.bitset, elem) */ __pyx_1 = (__pyx_v_elem > maxelem); if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":306 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":363 * raise ValueError, "Negative numbers, not allowed" * elif elem > maxelem: * raise OverflowError, "Element must be <= %s" % maxelem # <<<<<<<<<<<<<< * intBitSetDelElem(self.bitset, elem) * */ - __pyx_2 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; goto __pyx_L1;} - __pyx_3 = PyNumber_Remainder(__pyx_k_40p, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; goto __pyx_L1;} + __pyx_3 = PyNumber_Remainder(__pyx_k_39p, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_3, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; goto __pyx_L2; } __pyx_L2:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":307 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":364 * elif elem > maxelem: * raise OverflowError, "Element must be <= %s" % maxelem * intBitSetDelElem(self.bitset, elem) # <<<<<<<<<<<<<< * * def __and__(self, intbitset rhs not None): */ - intBitSetDelElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,__pyx_v_elem); + intBitSetDelElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_elem); __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("intbitset.intbitset.__del__"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":309 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":366 * intBitSetDelElem(self.bitset, elem) * * def __and__(self, intbitset rhs not None): # <<<<<<<<<<<<<< * ret = intbitset(no_allocate=1) * (ret).bitset = intBitSetIntersection(( self).bitset, rhs.bitset) */ static PyObject *__pyx_num_1; static PyObject *__pyx_n_no_allocate; static PyObject *__pyx_pf_9intbitset_9intbitset___and__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pf_9intbitset_9intbitset___and__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { PyObject *__pyx_v_ret; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_rhs); __pyx_v_ret = Py_None; Py_INCREF(Py_None); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9intbitset_intbitset, 0, "rhs"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9intbitset_intbitset, 0, "rhs"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; goto __pyx_L1;} - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":310 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":367 * * def __and__(self, intbitset rhs not None): * ret = intbitset(no_allocate=1) # <<<<<<<<<<<<<< * (ret).bitset = intBitSetIntersection(( self).bitset, rhs.bitset) * return ret */ - __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; goto __pyx_L1;} - if (PyDict_SetItem(__pyx_1, __pyx_n_no_allocate, __pyx_num_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; goto __pyx_L1;} - __pyx_2 = PyEval_CallObjectWithKeywords(((PyObject*)__pyx_ptype_9intbitset_intbitset), __pyx_empty_tuple, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; goto __pyx_L1;} + __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; goto __pyx_L1;} + if (PyDict_SetItem(__pyx_1, __pyx_n_no_allocate, __pyx_num_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; goto __pyx_L1;} + __pyx_2 = PyEval_CallObjectWithKeywords(((PyObject*)__pyx_ptype_9intbitset_intbitset), __pyx_empty_tuple, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_2; __pyx_2 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":311 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":368 * def __and__(self, intbitset rhs not None): * ret = intbitset(no_allocate=1) * (ret).bitset = intBitSetIntersection(( self).bitset, rhs.bitset) # <<<<<<<<<<<<<< * return ret * */ - ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_ret)->bitset = intBitSetIntersection(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_rhs)->bitset); + ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_ret)->bitset = intBitSetIntersection(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_rhs)->bitset); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":312 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":369 * ret = intbitset(no_allocate=1) * (ret).bitset = intBitSetIntersection(( self).bitset, rhs.bitset) * return ret # <<<<<<<<<<<<<< * * def __or__(self, intbitset rhs not None): */ Py_INCREF(__pyx_v_ret); __pyx_r = __pyx_v_ret; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("intbitset.intbitset.__and__"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_ret); Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_rhs); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":314 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":371 * return ret * * def __or__(self, intbitset rhs not None): # <<<<<<<<<<<<<< * ret = intbitset(no_allocate=1) * (ret).bitset = intBitSetUnion(( self).bitset, rhs.bitset) */ static PyObject *__pyx_pf_9intbitset_9intbitset___or__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pf_9intbitset_9intbitset___or__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { PyObject *__pyx_v_ret; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_rhs); __pyx_v_ret = Py_None; Py_INCREF(Py_None); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9intbitset_intbitset, 0, "rhs"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; goto __pyx_L1;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9intbitset_intbitset, 0, "rhs"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; goto __pyx_L1;} - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":315 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":372 * * def __or__(self, intbitset rhs not None): * ret = intbitset(no_allocate=1) # <<<<<<<<<<<<<< * (ret).bitset = intBitSetUnion(( self).bitset, rhs.bitset) * return ret */ - __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; goto __pyx_L1;} - if (PyDict_SetItem(__pyx_1, __pyx_n_no_allocate, __pyx_num_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; goto __pyx_L1;} - __pyx_2 = PyEval_CallObjectWithKeywords(((PyObject*)__pyx_ptype_9intbitset_intbitset), __pyx_empty_tuple, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; goto __pyx_L1;} + __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; goto __pyx_L1;} + if (PyDict_SetItem(__pyx_1, __pyx_n_no_allocate, __pyx_num_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; goto __pyx_L1;} + __pyx_2 = PyEval_CallObjectWithKeywords(((PyObject*)__pyx_ptype_9intbitset_intbitset), __pyx_empty_tuple, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_2; __pyx_2 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":316 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":373 * def __or__(self, intbitset rhs not None): * ret = intbitset(no_allocate=1) * (ret).bitset = intBitSetUnion(( self).bitset, rhs.bitset) # <<<<<<<<<<<<<< * return ret * */ - ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_ret)->bitset = intBitSetUnion(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_rhs)->bitset); + ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_ret)->bitset = intBitSetUnion(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_rhs)->bitset); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":317 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":374 * ret = intbitset(no_allocate=1) * (ret).bitset = intBitSetUnion(( self).bitset, rhs.bitset) * return ret # <<<<<<<<<<<<<< * * def __xor__(self, intbitset rhs not None): */ Py_INCREF(__pyx_v_ret); __pyx_r = __pyx_v_ret; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("intbitset.intbitset.__or__"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_ret); Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_rhs); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":319 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":376 * return ret * * def __xor__(self, intbitset rhs not None): # <<<<<<<<<<<<<< * ret = intbitset(no_allocate=1) * (ret).bitset = intBitSetXor(( self).bitset, rhs.bitset) */ static PyObject *__pyx_pf_9intbitset_9intbitset___xor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pf_9intbitset_9intbitset___xor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { PyObject *__pyx_v_ret; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_rhs); __pyx_v_ret = Py_None; Py_INCREF(Py_None); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9intbitset_intbitset, 0, "rhs"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; goto __pyx_L1;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9intbitset_intbitset, 0, "rhs"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; goto __pyx_L1;} - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":320 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":377 * * def __xor__(self, intbitset rhs not None): * ret = intbitset(no_allocate=1) # <<<<<<<<<<<<<< * (ret).bitset = intBitSetXor(( self).bitset, rhs.bitset) * return ret */ - __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;} - if (PyDict_SetItem(__pyx_1, __pyx_n_no_allocate, __pyx_num_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;} - __pyx_2 = PyEval_CallObjectWithKeywords(((PyObject*)__pyx_ptype_9intbitset_intbitset), __pyx_empty_tuple, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;} + __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; goto __pyx_L1;} + if (PyDict_SetItem(__pyx_1, __pyx_n_no_allocate, __pyx_num_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; goto __pyx_L1;} + __pyx_2 = PyEval_CallObjectWithKeywords(((PyObject*)__pyx_ptype_9intbitset_intbitset), __pyx_empty_tuple, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_2; __pyx_2 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":321 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":378 * def __xor__(self, intbitset rhs not None): * ret = intbitset(no_allocate=1) * (ret).bitset = intBitSetXor(( self).bitset, rhs.bitset) # <<<<<<<<<<<<<< * return ret * */ - ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_ret)->bitset = intBitSetXor(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_rhs)->bitset); + ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_ret)->bitset = intBitSetXor(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_rhs)->bitset); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":322 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":379 * ret = intbitset(no_allocate=1) * (ret).bitset = intBitSetXor(( self).bitset, rhs.bitset) * return ret # <<<<<<<<<<<<<< * * def __sub__(self, intbitset rhs not None): */ Py_INCREF(__pyx_v_ret); __pyx_r = __pyx_v_ret; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("intbitset.intbitset.__xor__"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_ret); Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_rhs); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":324 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":381 * return ret * * def __sub__(self, intbitset rhs not None): # <<<<<<<<<<<<<< * ret = intbitset(no_allocate=1) * (ret).bitset = intBitSetSub(( self).bitset, rhs.bitset) */ static PyObject *__pyx_pf_9intbitset_9intbitset___sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pf_9intbitset_9intbitset___sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { PyObject *__pyx_v_ret; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_rhs); __pyx_v_ret = Py_None; Py_INCREF(Py_None); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9intbitset_intbitset, 0, "rhs"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; goto __pyx_L1;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9intbitset_intbitset, 0, "rhs"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; goto __pyx_L1;} - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":325 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":382 * * def __sub__(self, intbitset rhs not None): * ret = intbitset(no_allocate=1) # <<<<<<<<<<<<<< * (ret).bitset = intBitSetSub(( self).bitset, rhs.bitset) * return ret */ - __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; goto __pyx_L1;} - if (PyDict_SetItem(__pyx_1, __pyx_n_no_allocate, __pyx_num_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; goto __pyx_L1;} - __pyx_2 = PyEval_CallObjectWithKeywords(((PyObject*)__pyx_ptype_9intbitset_intbitset), __pyx_empty_tuple, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; goto __pyx_L1;} + __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; goto __pyx_L1;} + if (PyDict_SetItem(__pyx_1, __pyx_n_no_allocate, __pyx_num_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; goto __pyx_L1;} + __pyx_2 = PyEval_CallObjectWithKeywords(((PyObject*)__pyx_ptype_9intbitset_intbitset), __pyx_empty_tuple, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_2; __pyx_2 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":326 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":383 * def __sub__(self, intbitset rhs not None): * ret = intbitset(no_allocate=1) * (ret).bitset = intBitSetSub(( self).bitset, rhs.bitset) # <<<<<<<<<<<<<< * return ret * */ - ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_ret)->bitset = intBitSetSub(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_rhs)->bitset); + ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_ret)->bitset = intBitSetSub(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_rhs)->bitset); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":327 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":384 * ret = intbitset(no_allocate=1) * (ret).bitset = intBitSetSub(( self).bitset, rhs.bitset) * return ret # <<<<<<<<<<<<<< * * def __iand__(self, intbitset rhs not None): */ Py_INCREF(__pyx_v_ret); __pyx_r = __pyx_v_ret; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("intbitset.intbitset.__sub__"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_ret); Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_rhs); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":329 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":386 * return ret * * def __iand__(self, intbitset rhs not None): # <<<<<<<<<<<<<< * intBitSetIIntersection(self.bitset, rhs.bitset) * return self */ static PyObject *__pyx_pf_9intbitset_9intbitset___iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pf_9intbitset_9intbitset___iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { PyObject *__pyx_r; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_rhs); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9intbitset_intbitset, 0, "rhs"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; goto __pyx_L1;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9intbitset_intbitset, 0, "rhs"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; goto __pyx_L1;} - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":330 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":387 * * def __iand__(self, intbitset rhs not None): * intBitSetIIntersection(self.bitset, rhs.bitset) # <<<<<<<<<<<<<< * return self * */ - intBitSetIIntersection(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_rhs)->bitset); + intBitSetIIntersection(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_rhs)->bitset); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":331 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":388 * def __iand__(self, intbitset rhs not None): * intBitSetIIntersection(self.bitset, rhs.bitset) * return self # <<<<<<<<<<<<<< * * def __ior__(self, intbitset rhs not None): */ Py_INCREF(__pyx_v_self); __pyx_r = __pyx_v_self; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("intbitset.intbitset.__iand__"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_rhs); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":333 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":390 * return self * * def __ior__(self, intbitset rhs not None): # <<<<<<<<<<<<<< * intBitSetIUnion(self.bitset, rhs.bitset) * return self */ static PyObject *__pyx_pf_9intbitset_9intbitset___ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pf_9intbitset_9intbitset___ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { PyObject *__pyx_r; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_rhs); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9intbitset_intbitset, 0, "rhs"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; goto __pyx_L1;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9intbitset_intbitset, 0, "rhs"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; goto __pyx_L1;} - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":334 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":391 * * def __ior__(self, intbitset rhs not None): * intBitSetIUnion(self.bitset, rhs.bitset) # <<<<<<<<<<<<<< * return self * */ - intBitSetIUnion(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_rhs)->bitset); + intBitSetIUnion(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_rhs)->bitset); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":335 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":392 * def __ior__(self, intbitset rhs not None): * intBitSetIUnion(self.bitset, rhs.bitset) * return self # <<<<<<<<<<<<<< * * def __ixor__(self, intbitset rhs not None): */ Py_INCREF(__pyx_v_self); __pyx_r = __pyx_v_self; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("intbitset.intbitset.__ior__"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_rhs); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":337 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":394 * return self * * def __ixor__(self, intbitset rhs not None): # <<<<<<<<<<<<<< * intBitSetIXor(self.bitset, rhs.bitset) * return self */ static PyObject *__pyx_pf_9intbitset_9intbitset___ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pf_9intbitset_9intbitset___ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { PyObject *__pyx_r; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_rhs); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9intbitset_intbitset, 0, "rhs"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_9intbitset_intbitset, 0, "rhs"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; goto __pyx_L1;} - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":338 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":395 * * def __ixor__(self, intbitset rhs not None): * intBitSetIXor(self.bitset, rhs.bitset) # <<<<<<<<<<<<<< * return self * */ - intBitSetIXor(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_rhs)->bitset); + intBitSetIXor(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_rhs)->bitset); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":339 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":396 * def __ixor__(self, intbitset rhs not None): * intBitSetIXor(self.bitset, rhs.bitset) * return self # <<<<<<<<<<<<<< * * def __repr__(self): */ Py_INCREF(__pyx_v_self); __pyx_r = __pyx_v_self; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("intbitset.intbitset.__ixor__"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_rhs); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":341 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":398 * return self * * def __repr__(self): # <<<<<<<<<<<<<< * cdef int last * cdef int maxelem */ static PyObject *__pyx_n_endswith; +static PyObject *__pyx_k_44p; static PyObject *__pyx_k_45p; static PyObject *__pyx_k_46p; static PyObject *__pyx_k_47p; static PyObject *__pyx_k_48p; static PyObject *__pyx_k_49p; static PyObject *__pyx_k_50p; static PyObject *__pyx_k_51p; -static PyObject *__pyx_k_52p; -static PyObject *__pyx_k_53p; -static char __pyx_k_45[] = "intbitset(["; -static char __pyx_k_46[] = "%i, "; -static char __pyx_k_47[] = ", "; -static char __pyx_k_48[] = "], trailing_bits=True)"; -static char __pyx_k_49[] = "intbitset(["; -static char __pyx_k_50[] = "%i, "; -static char __pyx_k_51[] = "-2, "; -static char __pyx_k_52[] = ", "; -static char __pyx_k_53[] = "])"; +static char __pyx_k_44[] = "intbitset(["; +static char __pyx_k_45[] = "%i, "; +static char __pyx_k_46[] = ", "; +static char __pyx_k_47[] = "], trailing_bits=True)"; +static char __pyx_k_48[] = "intbitset(["; +static char __pyx_k_49[] = "%i, "; +static char __pyx_k_50[] = ", "; +static char __pyx_k_51[] = "])"; static PyObject *__pyx_pf_9intbitset_9intbitset___repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pf_9intbitset_9intbitset___repr__(PyObject *__pyx_v_self) { int __pyx_v_last; int __pyx_v_maxelem; PyObject *__pyx_v_ret; PyObject *__pyx_r; word_t __pyx_1; int __pyx_2; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; PyObject *__pyx_5 = 0; - Py_ssize_t __pyx_6; Py_INCREF(__pyx_v_self); __pyx_v_ret = Py_None; Py_INCREF(Py_None); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":344 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":401 * cdef int last * cdef int maxelem * if self.bitset.trailing_bits: # <<<<<<<<<<<<<< * maxelem = (intBitSetGetSize(self.bitset)) * wordbitsize * ret = "intbitset([" */ __pyx_1 = ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset->trailing_bits; if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":345 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":402 * cdef int maxelem * if self.bitset.trailing_bits: * maxelem = (intBitSetGetSize(self.bitset)) * wordbitsize # <<<<<<<<<<<<<< * ret = "intbitset([" * last = -1 */ __pyx_v_maxelem = (intBitSetGetSize(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset) * wordbitsize); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":346 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":403 * if self.bitset.trailing_bits: * maxelem = (intBitSetGetSize(self.bitset)) * wordbitsize * ret = "intbitset([" # <<<<<<<<<<<<<< * last = -1 * while last < maxelem: */ - Py_INCREF(__pyx_k_45p); + Py_INCREF(__pyx_k_44p); Py_DECREF(__pyx_v_ret); - __pyx_v_ret = __pyx_k_45p; + __pyx_v_ret = __pyx_k_44p; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":347 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":404 * maxelem = (intBitSetGetSize(self.bitset)) * wordbitsize * ret = "intbitset([" * last = -1 # <<<<<<<<<<<<<< * while last < maxelem: * last = intBitSetGetNext(self.bitset, last) */ __pyx_v_last = -1; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":348 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":405 * ret = "intbitset([" * last = -1 * while last < maxelem: # <<<<<<<<<<<<<< * last = intBitSetGetNext(self.bitset, last) * ret = ret + '%i, ' % last */ while (1) { __pyx_2 = (__pyx_v_last < __pyx_v_maxelem); if (!__pyx_2) break; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":349 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":406 * last = -1 * while last < maxelem: * last = intBitSetGetNext(self.bitset, last) # <<<<<<<<<<<<<< * ret = ret + '%i, ' % last * if ret.endswith(", "): */ - __pyx_v_last = intBitSetGetNext(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,__pyx_v_last); + __pyx_v_last = intBitSetGetNext(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_last); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":350 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":407 * while last < maxelem: * last = intBitSetGetNext(self.bitset, last) * ret = ret + '%i, ' % last # <<<<<<<<<<<<<< * if ret.endswith(", "): * ret = ret[:-2] */ - __pyx_3 = PyInt_FromLong(__pyx_v_last); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; goto __pyx_L1;} - __pyx_4 = PyNumber_Remainder(__pyx_k_46p, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(__pyx_v_last); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; goto __pyx_L1;} + __pyx_4 = PyNumber_Remainder(__pyx_k_45p, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyNumber_Add(__pyx_v_ret, __pyx_4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; goto __pyx_L1;} + __pyx_3 = PyNumber_Add(__pyx_v_ret, __pyx_4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_3; __pyx_3 = 0; } - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":351 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":408 * last = intBitSetGetNext(self.bitset, last) * ret = ret + '%i, ' % last * if ret.endswith(", "): # <<<<<<<<<<<<<< * ret = ret[:-2] * ret = ret + '], trailing_bits=True)' */ - __pyx_4 = PyObject_GetAttr(__pyx_v_ret, __pyx_n_endswith); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; goto __pyx_L1;} - Py_INCREF(__pyx_k_47p); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k_47p); - __pyx_5 = PyObject_Call(__pyx_4, __pyx_3, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_v_ret, __pyx_n_endswith); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; goto __pyx_L1;} + Py_INCREF(__pyx_k_46p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k_46p); + __pyx_5 = PyObject_Call(__pyx_4, __pyx_3, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; goto __pyx_L1;} + __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_2) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":352 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":409 * ret = ret + '%i, ' % last * if ret.endswith(", "): * ret = ret[:-2] # <<<<<<<<<<<<<< * ret = ret + '], trailing_bits=True)' * return ret */ - __pyx_4 = PySequence_GetSlice(__pyx_v_ret, 0, -2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; goto __pyx_L1;} + __pyx_4 = PySequence_GetSlice(__pyx_v_ret, 0, -2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; goto __pyx_L1;} Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_4; __pyx_4 = 0; goto __pyx_L5; } __pyx_L5:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":353 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":410 * if ret.endswith(", "): * ret = ret[:-2] * ret = ret + '], trailing_bits=True)' # <<<<<<<<<<<<<< * return ret * else: */ - __pyx_3 = PyNumber_Add(__pyx_v_ret, __pyx_k_48p); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;} + __pyx_3 = PyNumber_Add(__pyx_v_ret, __pyx_k_47p); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; goto __pyx_L1;} Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_3; __pyx_3 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":354 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":411 * ret = ret[:-2] * ret = ret + '], trailing_bits=True)' * return ret # <<<<<<<<<<<<<< * else: * ret = "intbitset([" */ Py_INCREF(__pyx_v_ret); __pyx_r = __pyx_v_ret; goto __pyx_L0; goto __pyx_L2; } /*else*/ { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":356 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":413 * return ret * else: * ret = "intbitset([" # <<<<<<<<<<<<<< * last = -1 * while last >= -1: */ - Py_INCREF(__pyx_k_49p); + Py_INCREF(__pyx_k_48p); Py_DECREF(__pyx_v_ret); - __pyx_v_ret = __pyx_k_49p; + __pyx_v_ret = __pyx_k_48p; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":357 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":414 * else: * ret = "intbitset([" * last = -1 # <<<<<<<<<<<<<< * while last >= -1: * last = intBitSetGetNext(self.bitset, last) */ __pyx_v_last = -1; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":358 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":415 * ret = "intbitset([" * last = -1 * while last >= -1: # <<<<<<<<<<<<<< * last = intBitSetGetNext(self.bitset, last) * ret = ret + '%i, ' % last */ while (1) { __pyx_2 = (__pyx_v_last >= -1); if (!__pyx_2) break; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":359 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":416 * last = -1 * while last >= -1: * last = intBitSetGetNext(self.bitset, last) # <<<<<<<<<<<<<< * ret = ret + '%i, ' % last - * ret = ret[:-len('-2, ')] + * ret = ret[:-4] # -len('-2, ') */ - __pyx_v_last = intBitSetGetNext(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,__pyx_v_last); + __pyx_v_last = intBitSetGetNext(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_last); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":360 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":417 * while last >= -1: * last = intBitSetGetNext(self.bitset, last) * ret = ret + '%i, ' % last # <<<<<<<<<<<<<< - * ret = ret[:-len('-2, ')] + * ret = ret[:-4] # -len('-2, ') * if ret.endswith(', '): */ - __pyx_5 = PyInt_FromLong(__pyx_v_last); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; goto __pyx_L1;} - __pyx_4 = PyNumber_Remainder(__pyx_k_50p, __pyx_5); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; goto __pyx_L1;} + __pyx_5 = PyInt_FromLong(__pyx_v_last); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; goto __pyx_L1;} + __pyx_4 = PyNumber_Remainder(__pyx_k_49p, __pyx_5); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_3 = PyNumber_Add(__pyx_v_ret, __pyx_4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; goto __pyx_L1;} + __pyx_3 = PyNumber_Add(__pyx_v_ret, __pyx_4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_3; __pyx_3 = 0; } - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":361 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":418 * last = intBitSetGetNext(self.bitset, last) * ret = ret + '%i, ' % last - * ret = ret[:-len('-2, ')] # <<<<<<<<<<<<<< + * ret = ret[:-4] # -len('-2, ') # <<<<<<<<<<<<<< * if ret.endswith(', '): * ret = ret[:-2] */ - __pyx_6 = PyObject_Length(__pyx_k_51p); if (unlikely(__pyx_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; goto __pyx_L1;} - __pyx_5 = PySequence_GetSlice(__pyx_v_ret, 0, (-__pyx_6)); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; goto __pyx_L1;} + __pyx_5 = PySequence_GetSlice(__pyx_v_ret, 0, -4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; goto __pyx_L1;} Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_5; __pyx_5 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":362 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":419 * ret = ret + '%i, ' % last - * ret = ret[:-len('-2, ')] + * ret = ret[:-4] # -len('-2, ') * if ret.endswith(', '): # <<<<<<<<<<<<<< * ret = ret[:-2] * ret = ret + '])' */ - __pyx_4 = PyObject_GetAttr(__pyx_v_ret, __pyx_n_endswith); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; goto __pyx_L1;} - Py_INCREF(__pyx_k_52p); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k_52p); - __pyx_5 = PyObject_Call(__pyx_4, __pyx_3, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_v_ret, __pyx_n_endswith); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; goto __pyx_L1;} + Py_INCREF(__pyx_k_50p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k_50p); + __pyx_5 = PyObject_Call(__pyx_4, __pyx_3, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; goto __pyx_L1;} + __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_2) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":363 - * ret = ret[:-len('-2, ')] + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":420 + * ret = ret[:-4] # -len('-2, ') * if ret.endswith(', '): * ret = ret[:-2] # <<<<<<<<<<<<<< * ret = ret + '])' * return ret */ - __pyx_4 = PySequence_GetSlice(__pyx_v_ret, 0, -2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; goto __pyx_L1;} + __pyx_4 = PySequence_GetSlice(__pyx_v_ret, 0, -2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; goto __pyx_L1;} Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_4; __pyx_4 = 0; goto __pyx_L8; } __pyx_L8:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":364 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":421 * if ret.endswith(', '): * ret = ret[:-2] * ret = ret + '])' # <<<<<<<<<<<<<< * return ret * */ - __pyx_3 = PyNumber_Add(__pyx_v_ret, __pyx_k_53p); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; goto __pyx_L1;} + __pyx_3 = PyNumber_Add(__pyx_v_ret, __pyx_k_51p); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; goto __pyx_L1;} Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_3; __pyx_3 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":365 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":422 * ret = ret[:-2] * ret = ret + '])' * return ret # <<<<<<<<<<<<<< * * def __str__(self): */ Py_INCREF(__pyx_v_ret); __pyx_r = __pyx_v_ret; goto __pyx_L0; } __pyx_L2:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); Py_XDECREF(__pyx_5); __Pyx_AddTraceback("intbitset.intbitset.__repr__"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_ret); Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":367 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":424 * return ret * * def __str__(self): # <<<<<<<<<<<<<< * cdef int tot * tot = intBitSetGetTot(self.bitset) */ static PyObject *__pyx_num_10; static PyObject *__pyx_num_5; +static PyObject *__pyx_k_52p; +static PyObject *__pyx_k_53p; static PyObject *__pyx_k_54p; static PyObject *__pyx_k_55p; static PyObject *__pyx_k_56p; static PyObject *__pyx_k_57p; static PyObject *__pyx_k_58p; static PyObject *__pyx_k_59p; -static PyObject *__pyx_k_60p; -static PyObject *__pyx_k_61p; -static char __pyx_k_54[] = "intbitset(["; -static char __pyx_k_55[] = "%i, "; -static char __pyx_k_56[] = "...])"; -static char __pyx_k_57[] = "intbitset(["; +static char __pyx_k_52[] = "intbitset(["; +static char __pyx_k_53[] = "%i, "; +static char __pyx_k_54[] = "...])"; +static char __pyx_k_55[] = "intbitset(["; +static char __pyx_k_56[] = "%i, "; +static char __pyx_k_57[] = "..., "; static char __pyx_k_58[] = "%i, "; -static char __pyx_k_59[] = "..., "; -static char __pyx_k_60[] = "%i, "; -static char __pyx_k_61[] = "])"; +static char __pyx_k_59[] = "])"; static PyObject *__pyx_pf_9intbitset_9intbitset___str__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pf_9intbitset_9intbitset___str__(PyObject *__pyx_v_self) { int __pyx_v_tot; PyObject *__pyx_v_begin_list; PyObject *__pyx_v_ret; PyObject *__pyx_v_n; PyObject *__pyx_v_end_list; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; - Py_ssize_t __pyx_5; + Py_ssize_t __pyx_5 = 0; PyObject *__pyx_6 = 0; Py_INCREF(__pyx_v_self); __pyx_v_begin_list = Py_None; Py_INCREF(Py_None); __pyx_v_ret = Py_None; Py_INCREF(Py_None); __pyx_v_n = Py_None; Py_INCREF(Py_None); __pyx_v_end_list = Py_None; Py_INCREF(Py_None); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":369 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":426 * def __str__(self): * cdef int tot * tot = intBitSetGetTot(self.bitset) # <<<<<<<<<<<<<< * if tot < 0: * begin_list = self.to_sorted_list(0, 10) */ __pyx_v_tot = intBitSetGetTot(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":370 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":427 * cdef int tot * tot = intBitSetGetTot(self.bitset) * if tot < 0: # <<<<<<<<<<<<<< * begin_list = self.to_sorted_list(0, 10) * ret = "intbitset([" */ __pyx_1 = (__pyx_v_tot < 0); if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":371 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":428 * tot = intBitSetGetTot(self.bitset) * if tot < 0: * begin_list = self.to_sorted_list(0, 10) # <<<<<<<<<<<<<< * ret = "intbitset([" * for n in begin_list: */ - __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_to_sorted_list); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; goto __pyx_L1;} - __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_to_sorted_list); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; goto __pyx_L1;} Py_INCREF(__pyx_num_0); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_num_0); Py_INCREF(__pyx_num_10); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_num_10); - __pyx_4 = PyObject_Call(__pyx_2, __pyx_3, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; goto __pyx_L1;} + __pyx_4 = PyObject_Call(__pyx_2, __pyx_3, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_v_begin_list); __pyx_v_begin_list = __pyx_4; __pyx_4 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":372 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":429 * if tot < 0: * begin_list = self.to_sorted_list(0, 10) * ret = "intbitset([" # <<<<<<<<<<<<<< * for n in begin_list: * ret = ret + '%i, ' % n */ - Py_INCREF(__pyx_k_54p); + Py_INCREF(__pyx_k_52p); Py_DECREF(__pyx_v_ret); - __pyx_v_ret = __pyx_k_54p; + __pyx_v_ret = __pyx_k_52p; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":373 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":430 * begin_list = self.to_sorted_list(0, 10) * ret = "intbitset([" * for n in begin_list: # <<<<<<<<<<<<<< * ret = ret + '%i, ' % n * ret = ret + "...])" */ if (PyList_CheckExact(__pyx_v_begin_list)) { __pyx_5 = 0; __pyx_2 = __pyx_v_begin_list; Py_INCREF(__pyx_2); } - else { __pyx_2 = PyObject_GetIter(__pyx_v_begin_list); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; goto __pyx_L1;} } + else { __pyx_2 = PyObject_GetIter(__pyx_v_begin_list); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;} } for (;;) { if (PyList_CheckExact(__pyx_2)) { if (__pyx_5 >= PyList_GET_SIZE(__pyx_2)) break; __pyx_3 = PyList_GET_ITEM(__pyx_2, __pyx_5++); Py_INCREF(__pyx_3); } else { __pyx_3 = PyIter_Next(__pyx_2); if (!__pyx_3) { break; } } Py_DECREF(__pyx_v_n); __pyx_v_n = __pyx_3; __pyx_3 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":374 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":431 * ret = "intbitset([" * for n in begin_list: * ret = ret + '%i, ' % n # <<<<<<<<<<<<<< * ret = ret + "...])" * return ret */ - __pyx_4 = PyNumber_Remainder(__pyx_k_55p, __pyx_v_n); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; goto __pyx_L1;} - __pyx_3 = PyNumber_Add(__pyx_v_ret, __pyx_4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; goto __pyx_L1;} + __pyx_4 = PyNumber_Remainder(__pyx_k_53p, __pyx_v_n); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;} + __pyx_3 = PyNumber_Add(__pyx_v_ret, __pyx_4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_3; __pyx_3 = 0; } Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":375 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":432 * for n in begin_list: * ret = ret + '%i, ' % n * ret = ret + "...])" # <<<<<<<<<<<<<< * return ret * elif tot > 10: */ - __pyx_4 = PyNumber_Add(__pyx_v_ret, __pyx_k_56p); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; goto __pyx_L1;} + __pyx_4 = PyNumber_Add(__pyx_v_ret, __pyx_k_54p); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; goto __pyx_L1;} Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_4; __pyx_4 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":376 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":433 * ret = ret + '%i, ' % n * ret = ret + "...])" * return ret # <<<<<<<<<<<<<< * elif tot > 10: * begin_list = self.to_sorted_list(0, 5) */ Py_INCREF(__pyx_v_ret); __pyx_r = __pyx_v_ret; goto __pyx_L0; goto __pyx_L2; } - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":377 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":434 * ret = ret + "...])" * return ret * elif tot > 10: # <<<<<<<<<<<<<< * begin_list = self.to_sorted_list(0, 5) * end_list = self.to_sorted_list(tot - 5, tot) */ __pyx_1 = (__pyx_v_tot > 10); if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":378 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":435 * return ret * elif tot > 10: * begin_list = self.to_sorted_list(0, 5) # <<<<<<<<<<<<<< * end_list = self.to_sorted_list(tot - 5, tot) * ret = "intbitset([" */ - __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_to_sorted_list); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; goto __pyx_L1;} - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_to_sorted_list); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; goto __pyx_L1;} Py_INCREF(__pyx_num_0); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_num_0); Py_INCREF(__pyx_num_5); PyTuple_SET_ITEM(__pyx_2, 1, __pyx_num_5); - __pyx_4 = PyObject_Call(__pyx_3, __pyx_2, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; goto __pyx_L1;} + __pyx_4 = PyObject_Call(__pyx_3, __pyx_2, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_v_begin_list); __pyx_v_begin_list = __pyx_4; __pyx_4 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":379 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":436 * elif tot > 10: * begin_list = self.to_sorted_list(0, 5) * end_list = self.to_sorted_list(tot - 5, tot) # <<<<<<<<<<<<<< * ret = "intbitset([" * for n in begin_list: */ - __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_to_sorted_list); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; goto __pyx_L1;} - __pyx_2 = PyInt_FromLong((__pyx_v_tot - 5)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; goto __pyx_L1;} - __pyx_4 = PyInt_FromLong(__pyx_v_tot); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; goto __pyx_L1;} - __pyx_6 = PyTuple_New(2); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_to_sorted_list); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong((__pyx_v_tot - 5)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(__pyx_v_tot); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; goto __pyx_L1;} + __pyx_6 = PyTuple_New(2); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_6, 0, __pyx_2); PyTuple_SET_ITEM(__pyx_6, 1, __pyx_4); __pyx_2 = 0; __pyx_4 = 0; - __pyx_2 = PyObject_Call(__pyx_3, __pyx_6, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; goto __pyx_L1;} + __pyx_2 = PyObject_Call(__pyx_3, __pyx_6, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_6); __pyx_6 = 0; Py_DECREF(__pyx_v_end_list); __pyx_v_end_list = __pyx_2; __pyx_2 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":380 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":437 * begin_list = self.to_sorted_list(0, 5) * end_list = self.to_sorted_list(tot - 5, tot) * ret = "intbitset([" # <<<<<<<<<<<<<< * for n in begin_list: * ret = ret + '%i, ' % n */ - Py_INCREF(__pyx_k_57p); + Py_INCREF(__pyx_k_55p); Py_DECREF(__pyx_v_ret); - __pyx_v_ret = __pyx_k_57p; + __pyx_v_ret = __pyx_k_55p; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":381 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":438 * end_list = self.to_sorted_list(tot - 5, tot) * ret = "intbitset([" * for n in begin_list: # <<<<<<<<<<<<<< * ret = ret + '%i, ' % n * ret = ret + "..., " */ if (PyList_CheckExact(__pyx_v_begin_list)) { __pyx_5 = 0; __pyx_4 = __pyx_v_begin_list; Py_INCREF(__pyx_4); } - else { __pyx_4 = PyObject_GetIter(__pyx_v_begin_list); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; goto __pyx_L1;} } + else { __pyx_4 = PyObject_GetIter(__pyx_v_begin_list); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;} } for (;;) { if (PyList_CheckExact(__pyx_4)) { if (__pyx_5 >= PyList_GET_SIZE(__pyx_4)) break; __pyx_3 = PyList_GET_ITEM(__pyx_4, __pyx_5++); Py_INCREF(__pyx_3); } else { __pyx_3 = PyIter_Next(__pyx_4); if (!__pyx_3) { break; } } Py_DECREF(__pyx_v_n); __pyx_v_n = __pyx_3; __pyx_3 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":382 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":439 * ret = "intbitset([" * for n in begin_list: * ret = ret + '%i, ' % n # <<<<<<<<<<<<<< * ret = ret + "..., " * for n in end_list: */ - __pyx_6 = PyNumber_Remainder(__pyx_k_58p, __pyx_v_n); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; goto __pyx_L1;} - __pyx_2 = PyNumber_Add(__pyx_v_ret, __pyx_6); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; goto __pyx_L1;} + __pyx_6 = PyNumber_Remainder(__pyx_k_56p, __pyx_v_n); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; goto __pyx_L1;} + __pyx_2 = PyNumber_Add(__pyx_v_ret, __pyx_6); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_2; __pyx_2 = 0; } Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":383 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":440 * for n in begin_list: * ret = ret + '%i, ' % n * ret = ret + "..., " # <<<<<<<<<<<<<< * for n in end_list: * ret = ret + '%i, ' % n */ - __pyx_3 = PyNumber_Add(__pyx_v_ret, __pyx_k_59p); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; goto __pyx_L1;} + __pyx_3 = PyNumber_Add(__pyx_v_ret, __pyx_k_57p); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; goto __pyx_L1;} Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_3; __pyx_3 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":384 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":441 * ret = ret + '%i, ' % n * ret = ret + "..., " * for n in end_list: # <<<<<<<<<<<<<< * ret = ret + '%i, ' % n * ret = ret[:-2] */ if (PyList_CheckExact(__pyx_v_end_list)) { __pyx_5 = 0; __pyx_6 = __pyx_v_end_list; Py_INCREF(__pyx_6); } - else { __pyx_6 = PyObject_GetIter(__pyx_v_end_list); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; goto __pyx_L1;} } + else { __pyx_6 = PyObject_GetIter(__pyx_v_end_list); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;} } for (;;) { if (PyList_CheckExact(__pyx_6)) { if (__pyx_5 >= PyList_GET_SIZE(__pyx_6)) break; __pyx_2 = PyList_GET_ITEM(__pyx_6, __pyx_5++); Py_INCREF(__pyx_2); } else { __pyx_2 = PyIter_Next(__pyx_6); if (!__pyx_2) { break; } } Py_DECREF(__pyx_v_n); __pyx_v_n = __pyx_2; __pyx_2 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":385 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":442 * ret = ret + "..., " * for n in end_list: * ret = ret + '%i, ' % n # <<<<<<<<<<<<<< * ret = ret[:-2] * ret = ret + '])' */ - __pyx_4 = PyNumber_Remainder(__pyx_k_60p, __pyx_v_n); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; goto __pyx_L1;} - __pyx_3 = PyNumber_Add(__pyx_v_ret, __pyx_4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; goto __pyx_L1;} + __pyx_4 = PyNumber_Remainder(__pyx_k_58p, __pyx_v_n); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;} + __pyx_3 = PyNumber_Add(__pyx_v_ret, __pyx_4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_3; __pyx_3 = 0; } Py_DECREF(__pyx_6); __pyx_6 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":386 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":443 * for n in end_list: * ret = ret + '%i, ' % n * ret = ret[:-2] # <<<<<<<<<<<<<< * ret = ret + '])' * return ret */ - __pyx_2 = PySequence_GetSlice(__pyx_v_ret, 0, -2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; goto __pyx_L1;} + __pyx_2 = PySequence_GetSlice(__pyx_v_ret, 0, -2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; goto __pyx_L1;} Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_2; __pyx_2 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":387 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":444 * ret = ret + '%i, ' % n * ret = ret[:-2] * ret = ret + '])' # <<<<<<<<<<<<<< * return ret * else: */ - __pyx_4 = PyNumber_Add(__pyx_v_ret, __pyx_k_61p); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; goto __pyx_L1;} + __pyx_4 = PyNumber_Add(__pyx_v_ret, __pyx_k_59p); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;} Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_4; __pyx_4 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":388 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":445 * ret = ret[:-2] * ret = ret + '])' * return ret # <<<<<<<<<<<<<< * else: * return self.__repr__() */ Py_INCREF(__pyx_v_ret); __pyx_r = __pyx_v_ret; goto __pyx_L0; goto __pyx_L2; } /*else*/ { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":390 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":447 * return ret * else: * return self.__repr__() # <<<<<<<<<<<<<< * * ## Buffer interface */ - __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n___repr__); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; goto __pyx_L1;} - __pyx_6 = PyObject_Call(__pyx_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n___repr__); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; goto __pyx_L1;} + __pyx_6 = PyObject_Call(__pyx_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = __pyx_6; __pyx_6 = 0; goto __pyx_L0; } __pyx_L2:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); Py_XDECREF(__pyx_6); __Pyx_AddTraceback("intbitset.intbitset.__str__"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_begin_list); Py_DECREF(__pyx_v_ret); Py_DECREF(__pyx_v_n); Py_DECREF(__pyx_v_end_list); Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":417 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":474 * * # Iterator interface * def __iter__(self): # <<<<<<<<<<<<<< * if self.bitset.trailing_bits: * raise OverflowError, "It's impossible to iterate over an infinite set." */ -static PyObject *__pyx_k_62p; +static PyObject *__pyx_k_60p; -static char __pyx_k_62[] = "It's impossible to iterate over an infinite set."; +static char __pyx_k_60[] = "It's impossible to iterate over an infinite set."; static PyObject *__pyx_pf_9intbitset_9intbitset___iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pf_9intbitset_9intbitset___iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r; word_t __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; Py_INCREF(__pyx_v_self); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":418 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":475 * # Iterator interface * def __iter__(self): * if self.bitset.trailing_bits: # <<<<<<<<<<<<<< * raise OverflowError, "It's impossible to iterate over an infinite set." * return intbitset_iterator(self) */ __pyx_1 = ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset->trailing_bits; if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":419 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":476 * def __iter__(self): * if self.bitset.trailing_bits: * raise OverflowError, "It's impossible to iterate over an infinite set." # <<<<<<<<<<<<<< * return intbitset_iterator(self) * */ - __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_k_62p, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; goto __pyx_L1;} + __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_k_60p, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":420 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":477 * if self.bitset.trailing_bits: * raise OverflowError, "It's impossible to iterate over an infinite set." * return intbitset_iterator(self) # <<<<<<<<<<<<<< * * # Customized interface */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; goto __pyx_L1;} Py_INCREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self); - __pyx_3 = PyObject_Call(((PyObject*)__pyx_ptype_9intbitset_intbitset_iterator), __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; goto __pyx_L1;} + __pyx_3 = PyObject_Call(((PyObject*)__pyx_ptype_9intbitset_intbitset_iterator), __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("intbitset.intbitset.__iter__"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":423 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":480 * * # Customized interface * def add(self, int elem): # <<<<<<<<<<<<<< * """Add an element to a set. * This has no effect if the element is already present.""" */ -static PyObject *__pyx_k_63p; -static PyObject *__pyx_k_64p; +static PyObject *__pyx_k_61p; +static PyObject *__pyx_k_62p; -static char __pyx_k_63[] = "Negative numbers, not allowed"; -static char __pyx_k_64[] = "Element must be <= %s"; +static char __pyx_k_61[] = "Negative numbers, not allowed"; +static char __pyx_k_62[] = "Element must be <= %s"; static PyObject *__pyx_pf_9intbitset_9intbitset_add(PyObject *__pyx_v_self, PyObject *__pyx_arg_elem); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_add[] = "Add an element to a set.\n This has no effect if the element is already present."; static PyObject *__pyx_pf_9intbitset_9intbitset_add(PyObject *__pyx_v_self, PyObject *__pyx_arg_elem) { int __pyx_v_elem; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; - Py_INCREF(__pyx_v_self); assert(__pyx_arg_elem); { - __pyx_v_elem = __pyx_PyInt_int(__pyx_arg_elem); if (unlikely((__pyx_v_elem == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; goto __pyx_L1;} + __pyx_v_elem = __pyx_PyInt_int(__pyx_arg_elem); if (unlikely((__pyx_v_elem == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; goto __pyx_L1;} } + Py_INCREF(__pyx_v_self); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":426 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":483 * """Add an element to a set. * This has no effect if the element is already present.""" * if self.sanity_checks: # <<<<<<<<<<<<<< * if elem < 0: * raise ValueError, "Negative numbers, not allowed" */ __pyx_1 = ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->sanity_checks; if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":427 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":484 * This has no effect if the element is already present.""" * if self.sanity_checks: * if elem < 0: # <<<<<<<<<<<<<< * raise ValueError, "Negative numbers, not allowed" * elif elem > maxelem: */ __pyx_1 = (__pyx_v_elem < 0); if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":428 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":485 * if self.sanity_checks: * if elem < 0: * raise ValueError, "Negative numbers, not allowed" # <<<<<<<<<<<<<< * elif elem > maxelem: * raise OverflowError, "Element must be <= %s" % maxelem */ - __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_63p, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; goto __pyx_L1;} + __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_61p, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; goto __pyx_L1;} goto __pyx_L3; } - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":429 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":486 * if elem < 0: * raise ValueError, "Negative numbers, not allowed" * elif elem > maxelem: # <<<<<<<<<<<<<< * raise OverflowError, "Element must be <= %s" % maxelem * intBitSetAddElem(self.bitset, elem) */ __pyx_1 = (__pyx_v_elem > maxelem); if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":430 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":487 * raise ValueError, "Negative numbers, not allowed" * elif elem > maxelem: * raise OverflowError, "Element must be <= %s" % maxelem # <<<<<<<<<<<<<< * intBitSetAddElem(self.bitset, elem) * */ - __pyx_2 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;} - __pyx_3 = PyNumber_Remainder(__pyx_k_64p, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; goto __pyx_L1;} + __pyx_3 = PyNumber_Remainder(__pyx_k_62p, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_3, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; goto __pyx_L2; } __pyx_L2:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":431 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":488 * elif elem > maxelem: * raise OverflowError, "Element must be <= %s" % maxelem * intBitSetAddElem(self.bitset, elem) # <<<<<<<<<<<<<< * * def clear(self): */ - intBitSetAddElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,__pyx_v_elem); + intBitSetAddElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_elem); __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("intbitset.intbitset.add"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":433 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":490 * intBitSetAddElem(self.bitset, elem) * * def clear(self): # <<<<<<<<<<<<<< * intBitSetReset(self.bitset) * */ static PyObject *__pyx_pf_9intbitset_9intbitset_clear(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ static PyObject *__pyx_pf_9intbitset_9intbitset_clear(PyObject *__pyx_v_self, PyObject *unused) { PyObject *__pyx_r; Py_INCREF(__pyx_v_self); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":434 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":491 * * def clear(self): * intBitSetReset(self.bitset) # <<<<<<<<<<<<<< * * def difference(intbitset self, rhs): */ intBitSetReset(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset); __pyx_r = Py_None; Py_INCREF(Py_None); Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":436 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":493 * intBitSetReset(self.bitset) * * def difference(intbitset self, rhs): # <<<<<<<<<<<<<< * """Return the difference of two intbitsets as a new set. * (i.e. all elements that are in this intbitset but not the other.) */ static PyObject *__pyx_pf_9intbitset_9intbitset_difference(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_difference[] = "Return the difference of two intbitsets as a new set.\n (i.e. all elements that are in this intbitset but not the other.)\n "; static PyObject *__pyx_pf_9intbitset_9intbitset_difference(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_rhs); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":440 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":497 * (i.e. all elements that are in this intbitset but not the other.) * """ * return self.__sub__(rhs) # <<<<<<<<<<<<<< * * def difference_update(self, rhs): */ - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___sub__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___sub__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; goto __pyx_L1;} Py_INCREF(__pyx_v_rhs); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_rhs); - __pyx_3 = PyObject_Call(__pyx_1, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; goto __pyx_L1;} + __pyx_3 = PyObject_Call(__pyx_1, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("intbitset.intbitset.difference"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_rhs); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":442 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":499 * return self.__sub__(rhs) * * def difference_update(self, rhs): # <<<<<<<<<<<<<< * """Remove all elements of another set from this set.""" * self.__isub__(rhs) */ static PyObject *__pyx_pf_9intbitset_9intbitset_difference_update(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_difference_update[] = "Remove all elements of another set from this set."; static PyObject *__pyx_pf_9intbitset_9intbitset_difference_update(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_rhs); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":444 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":501 * def difference_update(self, rhs): * """Remove all elements of another set from this set.""" * self.__isub__(rhs) # <<<<<<<<<<<<<< * * def discard(self, int elem): */ - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___isub__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___isub__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; goto __pyx_L1;} Py_INCREF(__pyx_v_rhs); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_rhs); - __pyx_3 = PyObject_Call(__pyx_1, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;} + __pyx_3 = PyObject_Call(__pyx_1, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("intbitset.intbitset.difference_update"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_rhs); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":446 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":503 * self.__isub__(rhs) * * def discard(self, int elem): # <<<<<<<<<<<<<< * """Remove an element from a intbitset if it is a member. * If the element is not a member, do nothing.""" */ -static PyObject *__pyx_k_65p; -static PyObject *__pyx_k_66p; +static PyObject *__pyx_k_63p; +static PyObject *__pyx_k_64p; -static char __pyx_k_65[] = "Negative numbers, not allowed"; -static char __pyx_k_66[] = "Element must be <= %s"; +static char __pyx_k_63[] = "Negative numbers, not allowed"; +static char __pyx_k_64[] = "Element must be <= %s"; static PyObject *__pyx_pf_9intbitset_9intbitset_discard(PyObject *__pyx_v_self, PyObject *__pyx_arg_elem); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_discard[] = "Remove an element from a intbitset if it is a member.\n If the element is not a member, do nothing."; static PyObject *__pyx_pf_9intbitset_9intbitset_discard(PyObject *__pyx_v_self, PyObject *__pyx_arg_elem) { int __pyx_v_elem; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; - Py_INCREF(__pyx_v_self); assert(__pyx_arg_elem); { - __pyx_v_elem = __pyx_PyInt_int(__pyx_arg_elem); if (unlikely((__pyx_v_elem == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; goto __pyx_L1;} + __pyx_v_elem = __pyx_PyInt_int(__pyx_arg_elem); if (unlikely((__pyx_v_elem == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; goto __pyx_L1;} } + Py_INCREF(__pyx_v_self); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":449 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":506 * """Remove an element from a intbitset if it is a member. * If the element is not a member, do nothing.""" * if self.sanity_checks: # <<<<<<<<<<<<<< * if elem < 0: * raise ValueError, "Negative numbers, not allowed" */ __pyx_1 = ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->sanity_checks; if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":450 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":507 * If the element is not a member, do nothing.""" * if self.sanity_checks: * if elem < 0: # <<<<<<<<<<<<<< * raise ValueError, "Negative numbers, not allowed" * elif elem > maxelem: */ __pyx_1 = (__pyx_v_elem < 0); if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":451 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":508 * if self.sanity_checks: * if elem < 0: * raise ValueError, "Negative numbers, not allowed" # <<<<<<<<<<<<<< * elif elem > maxelem: * raise OverflowError, "Element must be <= %s" % maxelem */ - __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_65p, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; goto __pyx_L1;} + __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_63p, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;} goto __pyx_L3; } - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":452 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":509 * if elem < 0: * raise ValueError, "Negative numbers, not allowed" * elif elem > maxelem: # <<<<<<<<<<<<<< * raise OverflowError, "Element must be <= %s" % maxelem * intBitSetDelElem(self.bitset, elem) */ __pyx_1 = (__pyx_v_elem > maxelem); if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":453 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":510 * raise ValueError, "Negative numbers, not allowed" * elif elem > maxelem: * raise OverflowError, "Element must be <= %s" % maxelem # <<<<<<<<<<<<<< * intBitSetDelElem(self.bitset, elem) * */ - __pyx_2 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; goto __pyx_L1;} - __pyx_3 = PyNumber_Remainder(__pyx_k_66p, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; goto __pyx_L1;} + __pyx_3 = PyNumber_Remainder(__pyx_k_64p, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_3, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; goto __pyx_L2; } __pyx_L2:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":454 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":511 * elif elem > maxelem: * raise OverflowError, "Element must be <= %s" % maxelem * intBitSetDelElem(self.bitset, elem) # <<<<<<<<<<<<<< * * def intersection(self, rhs): */ - intBitSetDelElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,__pyx_v_elem); + intBitSetDelElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_elem); __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("intbitset.intbitset.discard"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":456 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":513 * intBitSetDelElem(self.bitset, elem) * * def intersection(self, rhs): # <<<<<<<<<<<<<< * """Return the intersection of two intbitsets as a new set. * (i.e. all elements that are in both intbitsets.) */ static PyObject *__pyx_pf_9intbitset_9intbitset_intersection(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_intersection[] = "Return the intersection of two intbitsets as a new set.\n (i.e. all elements that are in both intbitsets.)\n "; static PyObject *__pyx_pf_9intbitset_9intbitset_intersection(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_rhs); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":460 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":517 * (i.e. all elements that are in both intbitsets.) * """ * return self.__and__(rhs) # <<<<<<<<<<<<<< * * def intersection_update(self, rhs): */ - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___and__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___and__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;} Py_INCREF(__pyx_v_rhs); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_rhs); - __pyx_3 = PyObject_Call(__pyx_1, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; goto __pyx_L1;} + __pyx_3 = PyObject_Call(__pyx_1, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("intbitset.intbitset.intersection"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_rhs); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":462 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":519 * return self.__and__(rhs) * * def intersection_update(self, rhs): # <<<<<<<<<<<<<< * """Update a intbitset with the intersection of itself and another.""" * self.__iand__(rhs) */ static PyObject *__pyx_pf_9intbitset_9intbitset_intersection_update(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_intersection_update[] = "Update a intbitset with the intersection of itself and another."; static PyObject *__pyx_pf_9intbitset_9intbitset_intersection_update(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_rhs); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":464 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":521 * def intersection_update(self, rhs): * """Update a intbitset with the intersection of itself and another.""" * self.__iand__(rhs) # <<<<<<<<<<<<<< * * def union(self, rhs): */ - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___iand__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___iand__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; goto __pyx_L1;} Py_INCREF(__pyx_v_rhs); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_rhs); - __pyx_3 = PyObject_Call(__pyx_1, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; goto __pyx_L1;} + __pyx_3 = PyObject_Call(__pyx_1, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("intbitset.intbitset.intersection_update"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_rhs); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":466 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":523 * self.__iand__(rhs) * * def union(self, rhs): # <<<<<<<<<<<<<< * """Return the union of two intbitsets as a new set. * (i.e. all elements that are in either intbitsets.) */ static PyObject *__pyx_pf_9intbitset_9intbitset_union(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_union[] = "Return the union of two intbitsets as a new set.\n (i.e. all elements that are in either intbitsets.)\n "; static PyObject *__pyx_pf_9intbitset_9intbitset_union(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_rhs); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":470 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":527 * (i.e. all elements that are in either intbitsets.) * """ * return self.__or__(rhs) # <<<<<<<<<<<<<< * * def union_update(self, rhs): */ - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___or__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___or__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; goto __pyx_L1;} Py_INCREF(__pyx_v_rhs); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_rhs); - __pyx_3 = PyObject_Call(__pyx_1, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; goto __pyx_L1;} + __pyx_3 = PyObject_Call(__pyx_1, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("intbitset.intbitset.union"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_rhs); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":472 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":529 * return self.__or__(rhs) * * def union_update(self, rhs): # <<<<<<<<<<<<<< * """Update a intbitset with the union of itself and another.""" * self.__ior__(rhs) */ static PyObject *__pyx_pf_9intbitset_9intbitset_union_update(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_union_update[] = "Update a intbitset with the union of itself and another."; static PyObject *__pyx_pf_9intbitset_9intbitset_union_update(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_rhs); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":474 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":531 * def union_update(self, rhs): * """Update a intbitset with the union of itself and another.""" * self.__ior__(rhs) # <<<<<<<<<<<<<< * * def issubset(self, rhs): */ - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___ior__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___ior__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;} Py_INCREF(__pyx_v_rhs); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_rhs); - __pyx_3 = PyObject_Call(__pyx_1, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; goto __pyx_L1;} + __pyx_3 = PyObject_Call(__pyx_1, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("intbitset.intbitset.union_update"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_rhs); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":476 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":533 * self.__ior__(rhs) * * def issubset(self, rhs): # <<<<<<<<<<<<<< * """Report whether another set contains this set.""" * return self.__le__(rhs) */ static PyObject *__pyx_n___le__; static PyObject *__pyx_pf_9intbitset_9intbitset_issubset(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_issubset[] = "Report whether another set contains this set."; static PyObject *__pyx_pf_9intbitset_9intbitset_issubset(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_rhs); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":478 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":535 * def issubset(self, rhs): * """Report whether another set contains this set.""" * return self.__le__(rhs) # <<<<<<<<<<<<<< * * def issuperset(self, rhs): */ - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___le__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___le__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; goto __pyx_L1;} Py_INCREF(__pyx_v_rhs); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_rhs); - __pyx_3 = PyObject_Call(__pyx_1, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; goto __pyx_L1;} + __pyx_3 = PyObject_Call(__pyx_1, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("intbitset.intbitset.issubset"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_rhs); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":480 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":537 * return self.__le__(rhs) * * def issuperset(self, rhs): # <<<<<<<<<<<<<< * """Report whether this set contains another set.""" * return self.__ge__(rhs) */ static PyObject *__pyx_n___ge__; static PyObject *__pyx_pf_9intbitset_9intbitset_issuperset(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_issuperset[] = "Report whether this set contains another set."; static PyObject *__pyx_pf_9intbitset_9intbitset_issuperset(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_rhs); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":482 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":539 * def issuperset(self, rhs): * """Report whether this set contains another set.""" * return self.__ge__(rhs) # <<<<<<<<<<<<<< * * def symmetric_difference(self, rhs): */ - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___ge__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___ge__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;} Py_INCREF(__pyx_v_rhs); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_rhs); - __pyx_3 = PyObject_Call(__pyx_1, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; goto __pyx_L1;} + __pyx_3 = PyObject_Call(__pyx_1, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("intbitset.intbitset.issuperset"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_rhs); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":484 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":541 * return self.__ge__(rhs) * * def symmetric_difference(self, rhs): # <<<<<<<<<<<<<< * """Return the symmetric difference of two sets as a new set. * (i.e. all elements that are in exactly one of the sets.) */ static PyObject *__pyx_pf_9intbitset_9intbitset_symmetric_difference(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_symmetric_difference[] = "Return the symmetric difference of two sets as a new set.\n (i.e. all elements that are in exactly one of the sets.)\n "; static PyObject *__pyx_pf_9intbitset_9intbitset_symmetric_difference(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_rhs); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":488 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":545 * (i.e. all elements that are in exactly one of the sets.) * """ * return self.__xor__(rhs) # <<<<<<<<<<<<<< * * def symmetric_difference_update(self, rhs): */ - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___xor__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___xor__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;} Py_INCREF(__pyx_v_rhs); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_rhs); - __pyx_3 = PyObject_Call(__pyx_1, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; goto __pyx_L1;} + __pyx_3 = PyObject_Call(__pyx_1, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("intbitset.intbitset.symmetric_difference"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_rhs); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":490 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":547 * return self.__xor__(rhs) * * def symmetric_difference_update(self, rhs): # <<<<<<<<<<<<<< * """Update an intbitset with the symmetric difference of itself and another. * """ */ static PyObject *__pyx_pf_9intbitset_9intbitset_symmetric_difference_update(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_symmetric_difference_update[] = "Update an intbitset with the symmetric difference of itself and another.\n "; static PyObject *__pyx_pf_9intbitset_9intbitset_symmetric_difference_update(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_rhs); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":493 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":550 * """Update an intbitset with the symmetric difference of itself and another. * """ * self.__ixor__(rhs) # <<<<<<<<<<<<<< * * # Dumping & Loading */ - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___ixor__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___ixor__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; goto __pyx_L1;} Py_INCREF(__pyx_v_rhs); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_rhs); - __pyx_3 = PyObject_Call(__pyx_1, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; goto __pyx_L1;} + __pyx_3 = PyObject_Call(__pyx_1, __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("intbitset.intbitset.symmetric_difference_update"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_rhs); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":496 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":553 * * # Dumping & Loading * def fastdump(self): # <<<<<<<<<<<<<< * """Return a compressed string representation suitable to be saved * somewhere.""" */ static PyObject *__pyx_n_compress; static PyObject *__pyx_pf_9intbitset_9intbitset_fastdump(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_fastdump[] = "Return a compressed string representation suitable to be saved\n somewhere."; static PyObject *__pyx_pf_9intbitset_9intbitset_fastdump(PyObject *__pyx_v_self, PyObject *unused) { Py_ssize_t __pyx_v_size; PyObject *__pyx_v_tmp; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; Py_INCREF(__pyx_v_self); __pyx_v_tmp = Py_None; Py_INCREF(Py_None); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":500 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":557 * somewhere.""" * cdef Py_ssize_t size * size = intBitSetGetSize(( self).bitset) # <<<<<<<<<<<<<< * tmp = PyString_FromStringAndSize(self.bitset.bitset, ( size + 1) * wordbytesize) * return zlib.compress(tmp) */ __pyx_v_size = intBitSetGetSize(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":501 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":558 * cdef Py_ssize_t size * size = intBitSetGetSize(( self).bitset) * tmp = PyString_FromStringAndSize(self.bitset.bitset, ( size + 1) * wordbytesize) # <<<<<<<<<<<<<< * return zlib.compress(tmp) * */ - __pyx_1 = PyString_FromStringAndSize(((char *)((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset->bitset),((__pyx_v_size + 1) * wordbytesize)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; goto __pyx_L1;} + __pyx_1 = PyString_FromStringAndSize(((char *)((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset->bitset), ((__pyx_v_size + 1) * wordbytesize)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; goto __pyx_L1;} Py_DECREF(__pyx_v_tmp); __pyx_v_tmp = __pyx_1; __pyx_1 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":502 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":559 * size = intBitSetGetSize(( self).bitset) * tmp = PyString_FromStringAndSize(self.bitset.bitset, ( size + 1) * wordbytesize) * return zlib.compress(tmp) # <<<<<<<<<<<<<< * * def fastload(self, strdump): */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_zlib); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_compress); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; goto __pyx_L1;} + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_zlib); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_compress); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; goto __pyx_L1;} + __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; goto __pyx_L1;} Py_INCREF(__pyx_v_tmp); PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_tmp); - __pyx_3 = PyObject_Call(__pyx_2, __pyx_1, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; goto __pyx_L1;} + __pyx_3 = PyObject_Call(__pyx_2, __pyx_1, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("intbitset.intbitset.fastdump"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_tmp); Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":504 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":561 * return zlib.compress(tmp) * * def fastload(self, strdump): # <<<<<<<<<<<<<< * """Load a compressed string representation produced by a previous call * to the fastdump method into the current intbitset. The previous content */ -static PyObject *__pyx_k_67p; +static PyObject *__pyx_k_65p; -static char __pyx_k_67[] = "strdump is corrupted"; +static char __pyx_k_65[] = "strdump is corrupted"; static PyObject *__pyx_pf_9intbitset_9intbitset_fastload(PyObject *__pyx_v_self, PyObject *__pyx_v_strdump); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_fastload[] = "Load a compressed string representation produced by a previous call\n to the fastdump method into the current intbitset. The previous content\n will be replaced."; static PyObject *__pyx_pf_9intbitset_9intbitset_fastload(PyObject *__pyx_v_self, PyObject *__pyx_v_strdump) { Py_ssize_t __pyx_v_size; void *__pyx_v_buf; PyObject *__pyx_v_tmp; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; int __pyx_3; PyObject *__pyx_4 = 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_strdump); __pyx_v_tmp = Py_None; Py_INCREF(Py_None); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":510 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":567 * cdef Py_ssize_t size * cdef void *buf * buf = NULL # <<<<<<<<<<<<<< * size = 0 * try: */ __pyx_v_buf = NULL; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":511 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":568 * cdef void *buf * buf = NULL * size = 0 # <<<<<<<<<<<<<< * try: * if type(strdump) is array: */ __pyx_v_size = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":512 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":569 * buf = NULL * size = 0 * try: # <<<<<<<<<<<<<< * if type(strdump) is array: * strdump = strdump.tostring() */ /*try:*/ { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":513 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":570 * size = 0 * try: * if type(strdump) is array: # <<<<<<<<<<<<<< * strdump = strdump.tostring() * # tmp needed to not be garbage collected */ - __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L2;} + __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; goto __pyx_L2;} Py_INCREF(__pyx_v_strdump); PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_strdump); - __pyx_2 = PyObject_Call(((PyObject*)&PyType_Type), __pyx_1, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L2;} + __pyx_2 = PyObject_Call(((PyObject*)&PyType_Type), __pyx_1, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; goto __pyx_L2;} Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_array); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L2;} + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_array); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; goto __pyx_L2;} __pyx_3 = (__pyx_2 == __pyx_1); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_3) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":514 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":571 * try: * if type(strdump) is array: * strdump = strdump.tostring() # <<<<<<<<<<<<<< * # tmp needed to not be garbage collected * tmp = zlib.decompress(strdump) */ - __pyx_2 = PyObject_GetAttr(__pyx_v_strdump, __pyx_n_tostring); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; goto __pyx_L2;} - __pyx_1 = PyObject_Call(__pyx_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; goto __pyx_L2;} + __pyx_2 = PyObject_GetAttr(__pyx_v_strdump, __pyx_n_tostring); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; goto __pyx_L2;} + __pyx_1 = PyObject_Call(__pyx_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; goto __pyx_L2;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_v_strdump); __pyx_v_strdump = __pyx_1; __pyx_1 = 0; goto __pyx_L4; } __pyx_L4:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":516 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":573 * strdump = strdump.tostring() * # tmp needed to not be garbage collected * tmp = zlib.decompress(strdump) # <<<<<<<<<<<<<< * if PyObject_AsReadBuffer(tmp, &buf, &size) < 0: * raise Exception */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_zlib); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; goto __pyx_L2;} - __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_decompress); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; goto __pyx_L2;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_zlib); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; goto __pyx_L2;} + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_decompress); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; goto __pyx_L2;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; goto __pyx_L2;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; goto __pyx_L2;} Py_INCREF(__pyx_v_strdump); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_strdump); - __pyx_4 = PyObject_Call(__pyx_1, __pyx_2, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; goto __pyx_L2;} + __pyx_4 = PyObject_Call(__pyx_1, __pyx_2, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; goto __pyx_L2;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_v_tmp); __pyx_v_tmp = __pyx_4; __pyx_4 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":517 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":574 * # tmp needed to not be garbage collected * tmp = zlib.decompress(strdump) * if PyObject_AsReadBuffer(tmp, &buf, &size) < 0: # <<<<<<<<<<<<<< * raise Exception * intBitSetResetFromBuffer(( self).bitset, buf, size) */ - __pyx_3 = (PyObject_AsReadBuffer(__pyx_v_tmp,(&__pyx_v_buf),(&__pyx_v_size)) < 0); + __pyx_3 = (PyObject_AsReadBuffer(__pyx_v_tmp, (&__pyx_v_buf), (&__pyx_v_size)) < 0); if (__pyx_3) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":518 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":575 * tmp = zlib.decompress(strdump) * if PyObject_AsReadBuffer(tmp, &buf, &size) < 0: * raise Exception # <<<<<<<<<<<<<< * intBitSetResetFromBuffer(( self).bitset, buf, size) * except: */ __Pyx_Raise(__pyx_builtin_Exception, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; goto __pyx_L2;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; goto __pyx_L2;} goto __pyx_L5; } __pyx_L5:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":519 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":576 * if PyObject_AsReadBuffer(tmp, &buf, &size) < 0: * raise Exception * intBitSetResetFromBuffer(( self).bitset, buf, size) # <<<<<<<<<<<<<< * except: * raise ValueError, "strdump is corrupted" */ - intBitSetResetFromBuffer(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,__pyx_v_buf,__pyx_v_size); + intBitSetResetFromBuffer(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_buf, __pyx_v_size); } goto __pyx_L3; __pyx_L2:; Py_XDECREF(__pyx_1); __pyx_1 = 0; Py_XDECREF(__pyx_2); __pyx_2 = 0; Py_XDECREF(__pyx_4); __pyx_4 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":520 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":577 * raise Exception * intBitSetResetFromBuffer(( self).bitset, buf, size) * except: # <<<<<<<<<<<<<< * raise ValueError, "strdump is corrupted" * return self */ /*except:*/ { __Pyx_AddTraceback("intbitset.fastload"); - if (__Pyx_GetException(&__pyx_1, &__pyx_2, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; goto __pyx_L1;} + if (__Pyx_GetException(&__pyx_1, &__pyx_2, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; goto __pyx_L1;} - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":521 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":578 * intBitSetResetFromBuffer(( self).bitset, buf, size) * except: * raise ValueError, "strdump is corrupted" # <<<<<<<<<<<<<< * return self * */ - __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_67p, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; goto __pyx_L1;} + __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_65p, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; goto __pyx_L3; } __pyx_L3:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":522 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":579 * except: * raise ValueError, "strdump is corrupted" * return self # <<<<<<<<<<<<<< * * def copy(self): */ Py_INCREF(__pyx_v_self); __pyx_r = __pyx_v_self; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_4); __Pyx_AddTraceback("intbitset.intbitset.fastload"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_tmp); Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_strdump); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":524 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":581 * return self * * def copy(self): # <<<<<<<<<<<<<< * """Return a shallow copy of a set.""" * return intbitset(self) */ static PyObject *__pyx_pf_9intbitset_9intbitset_copy(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_copy[] = "Return a shallow copy of a set."; static PyObject *__pyx_pf_9intbitset_9intbitset_copy(PyObject *__pyx_v_self, PyObject *unused) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; Py_INCREF(__pyx_v_self); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":526 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":583 * def copy(self): * """Return a shallow copy of a set.""" * return intbitset(self) # <<<<<<<<<<<<<< * * def pop(self): */ - __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;} + __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; goto __pyx_L1;} Py_INCREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self); - __pyx_2 = PyObject_Call(((PyObject*)__pyx_ptype_9intbitset_intbitset), __pyx_1, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;} + __pyx_2 = PyObject_Call(((PyObject*)__pyx_ptype_9intbitset_intbitset), __pyx_1, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("intbitset.intbitset.copy"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":528 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":585 * return intbitset(self) * * def pop(self): # <<<<<<<<<<<<<< * """Remove and return an arbitrary set element.""" * cdef int ret */ static PyObject *__pyx_n_KeyError; -static PyObject *__pyx_k_68p; +static PyObject *__pyx_k_66p; static PyObject *__pyx_builtin_KeyError; -static char __pyx_k_68[] = "pop from an empty intbitset"; +static char __pyx_k_66[] = "pop from an empty intbitset"; static PyObject *__pyx_pf_9intbitset_9intbitset_pop(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_pop[] = "Remove and return an arbitrary set element."; static PyObject *__pyx_pf_9intbitset_9intbitset_pop(PyObject *__pyx_v_self, PyObject *unused) { int __pyx_v_ret; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; Py_INCREF(__pyx_v_self); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":531 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":588 * """Remove and return an arbitrary set element.""" * cdef int ret * ret = intBitSetGetNext(self.bitset, -1) # <<<<<<<<<<<<<< * if ret < 0: * raise KeyError, "pop from an empty intbitset" */ - __pyx_v_ret = intBitSetGetNext(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,-1); + __pyx_v_ret = intBitSetGetNext(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, -1); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":532 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":589 * cdef int ret * ret = intBitSetGetNext(self.bitset, -1) * if ret < 0: # <<<<<<<<<<<<<< * raise KeyError, "pop from an empty intbitset" * intBitSetDelElem(self.bitset, ret) */ __pyx_1 = (__pyx_v_ret < 0); if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":533 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":590 * ret = intBitSetGetNext(self.bitset, -1) * if ret < 0: * raise KeyError, "pop from an empty intbitset" # <<<<<<<<<<<<<< * intBitSetDelElem(self.bitset, ret) * return ret */ - __Pyx_Raise(__pyx_builtin_KeyError, __pyx_k_68p, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; goto __pyx_L1;} + __Pyx_Raise(__pyx_builtin_KeyError, __pyx_k_66p, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":534 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":591 * if ret < 0: * raise KeyError, "pop from an empty intbitset" * intBitSetDelElem(self.bitset, ret) # <<<<<<<<<<<<<< * return ret * */ - intBitSetDelElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,__pyx_v_ret); + intBitSetDelElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_ret); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":535 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":592 * raise KeyError, "pop from an empty intbitset" * intBitSetDelElem(self.bitset, ret) * return ret # <<<<<<<<<<<<<< * * def remove(self, int elem): */ - __pyx_2 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); __Pyx_AddTraceback("intbitset.intbitset.pop"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":537 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":594 * return ret * * def remove(self, int elem): # <<<<<<<<<<<<<< * """Remove an element from a set; it must be a member. * If the element is not a member, raise a KeyError. */ -static PyObject *__pyx_k_69p; -static PyObject *__pyx_k_70p; +static PyObject *__pyx_k_67p; +static PyObject *__pyx_k_68p; -static char __pyx_k_69[] = "Negative numbers, not allowed"; -static char __pyx_k_70[] = "Elements must be <= %s"; +static char __pyx_k_67[] = "Negative numbers, not allowed"; +static char __pyx_k_68[] = "Elements must be <= %s"; static PyObject *__pyx_pf_9intbitset_9intbitset_remove(PyObject *__pyx_v_self, PyObject *__pyx_arg_elem); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_remove[] = "Remove an element from a set; it must be a member.\n If the element is not a member, raise a KeyError.\n "; static PyObject *__pyx_pf_9intbitset_9intbitset_remove(PyObject *__pyx_v_self, PyObject *__pyx_arg_elem) { int __pyx_v_elem; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; - Py_INCREF(__pyx_v_self); assert(__pyx_arg_elem); { - __pyx_v_elem = __pyx_PyInt_int(__pyx_arg_elem); if (unlikely((__pyx_v_elem == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;} + __pyx_v_elem = __pyx_PyInt_int(__pyx_arg_elem); if (unlikely((__pyx_v_elem == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; goto __pyx_L1;} } + Py_INCREF(__pyx_v_self); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":541 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":598 * If the element is not a member, raise a KeyError. * """ * if self.sanity_checks: # <<<<<<<<<<<<<< * if elem < 0: * raise ValueError, "Negative numbers, not allowed" */ __pyx_1 = ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->sanity_checks; if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":542 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":599 * """ * if self.sanity_checks: * if elem < 0: # <<<<<<<<<<<<<< * raise ValueError, "Negative numbers, not allowed" * elif elem > maxelem: */ __pyx_1 = (__pyx_v_elem < 0); if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":543 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":600 * if self.sanity_checks: * if elem < 0: * raise ValueError, "Negative numbers, not allowed" # <<<<<<<<<<<<<< * elif elem > maxelem: * raise OverflowError, "Elements must be <= %s" % maxelem */ - __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_69p, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;} + __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_67p, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;} goto __pyx_L3; } - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":544 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":601 * if elem < 0: * raise ValueError, "Negative numbers, not allowed" * elif elem > maxelem: # <<<<<<<<<<<<<< * raise OverflowError, "Elements must be <= %s" % maxelem * if intBitSetIsInElem(self.bitset, elem): */ __pyx_1 = (__pyx_v_elem > maxelem); if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":545 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":602 * raise ValueError, "Negative numbers, not allowed" * elif elem > maxelem: * raise OverflowError, "Elements must be <= %s" % maxelem # <<<<<<<<<<<<<< * if intBitSetIsInElem(self.bitset, elem): * intBitSetDelElem(self.bitset, elem) */ - __pyx_2 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;} - __pyx_3 = PyNumber_Remainder(__pyx_k_70p, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; goto __pyx_L1;} + __pyx_3 = PyNumber_Remainder(__pyx_k_68p, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_3, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; goto __pyx_L2; } __pyx_L2:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":546 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":603 * elif elem > maxelem: * raise OverflowError, "Elements must be <= %s" % maxelem * if intBitSetIsInElem(self.bitset, elem): # <<<<<<<<<<<<<< * intBitSetDelElem(self.bitset, elem) * else: */ - __pyx_1 = intBitSetIsInElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,__pyx_v_elem); + __pyx_1 = intBitSetIsInElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_elem); if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":547 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":604 * raise OverflowError, "Elements must be <= %s" % maxelem * if intBitSetIsInElem(self.bitset, elem): * intBitSetDelElem(self.bitset, elem) # <<<<<<<<<<<<<< * else: * raise KeyError, elem */ - intBitSetDelElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,__pyx_v_elem); + intBitSetDelElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_elem); goto __pyx_L4; } /*else*/ { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":549 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":606 * intBitSetDelElem(self.bitset, elem) * else: * raise KeyError, elem # <<<<<<<<<<<<<< * * def strbits(self): */ - __pyx_2 = PyInt_FromLong(__pyx_v_elem); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(__pyx_v_elem); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; goto __pyx_L1;} __Pyx_Raise(__pyx_builtin_KeyError, __pyx_2, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; goto __pyx_L1;} } __pyx_L4:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("intbitset.intbitset.remove"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":551 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":608 * raise KeyError, elem * * def strbits(self): # <<<<<<<<<<<<<< * """Return a string of 0s and 1s representing the content in memory * of the intbitset. */ +static PyObject *__pyx_k_69p; +static PyObject *__pyx_k_70p; static PyObject *__pyx_k_71p; static PyObject *__pyx_k_72p; -static PyObject *__pyx_k_73p; -static PyObject *__pyx_k_74p; -static char __pyx_k_71[] = "It's impossible to print an infinite set."; -static char __pyx_k_72[] = ""; -static char __pyx_k_73[] = "0"; -static char __pyx_k_74[] = "1"; +static char __pyx_k_69[] = "It's impossible to print an infinite set."; +static char __pyx_k_70[] = ""; +static char __pyx_k_71[] = "0"; +static char __pyx_k_72[] = "1"; static PyObject *__pyx_pf_9intbitset_9intbitset_strbits(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_strbits[] = "Return a string of 0s and 1s representing the content in memory\n of the intbitset.\n "; static PyObject *__pyx_pf_9intbitset_9intbitset_strbits(PyObject *__pyx_v_self, PyObject *unused) { int __pyx_v_i; int __pyx_v_last; PyObject *__pyx_v_ret; PyObject *__pyx_r; word_t __pyx_1; - Py_ssize_t __pyx_2; + Py_ssize_t __pyx_2 = 0; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; int __pyx_5; PyObject *__pyx_6 = 0; Py_INCREF(__pyx_v_self); __pyx_v_ret = Py_None; Py_INCREF(Py_None); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":557 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":614 * cdef int i * cdef int last * if ( self).bitset.trailing_bits: # <<<<<<<<<<<<<< * raise OverflowError, "It's impossible to print an infinite set." * last = 0 */ __pyx_1 = ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset->trailing_bits; if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":558 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":615 * cdef int last * if ( self).bitset.trailing_bits: * raise OverflowError, "It's impossible to print an infinite set." # <<<<<<<<<<<<<< * last = 0 * ret = '' */ - __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_k_71p, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; goto __pyx_L1;} + __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_k_69p, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":559 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":616 * if ( self).bitset.trailing_bits: * raise OverflowError, "It's impossible to print an infinite set." * last = 0 # <<<<<<<<<<<<<< * ret = '' * for i in self: */ __pyx_v_last = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":560 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":617 * raise OverflowError, "It's impossible to print an infinite set." * last = 0 * ret = '' # <<<<<<<<<<<<<< * for i in self: * ret = ret + '0'*(i-last)+'1' */ - Py_INCREF(__pyx_k_72p); + Py_INCREF(__pyx_k_70p); Py_DECREF(__pyx_v_ret); - __pyx_v_ret = __pyx_k_72p; + __pyx_v_ret = __pyx_k_70p; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":561 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":618 * last = 0 * ret = '' * for i in self: # <<<<<<<<<<<<<< * ret = ret + '0'*(i-last)+'1' * last = i+1 */ if (PyList_CheckExact(__pyx_v_self)) { __pyx_2 = 0; __pyx_3 = __pyx_v_self; Py_INCREF(__pyx_3); } - else { __pyx_3 = PyObject_GetIter(__pyx_v_self); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; goto __pyx_L1;} } + else { __pyx_3 = PyObject_GetIter(__pyx_v_self); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;} } for (;;) { if (PyList_CheckExact(__pyx_3)) { if (__pyx_2 >= PyList_GET_SIZE(__pyx_3)) break; __pyx_4 = PyList_GET_ITEM(__pyx_3, __pyx_2++); Py_INCREF(__pyx_4); } else { __pyx_4 = PyIter_Next(__pyx_3); if (!__pyx_4) { break; } } - __pyx_5 = __pyx_PyInt_int(__pyx_4); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; goto __pyx_L1;} + __pyx_5 = __pyx_PyInt_int(__pyx_4); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_v_i = __pyx_5; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":562 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":619 * ret = '' * for i in self: * ret = ret + '0'*(i-last)+'1' # <<<<<<<<<<<<<< * last = i+1 * return ret */ - __pyx_4 = PyInt_FromLong((__pyx_v_i - __pyx_v_last)); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;} - __pyx_6 = PyNumber_Multiply(__pyx_k_73p, __pyx_4); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong((__pyx_v_i - __pyx_v_last)); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; goto __pyx_L1;} + __pyx_6 = PyNumber_Multiply(__pyx_k_71p, __pyx_4); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_4 = PyNumber_Add(__pyx_v_ret, __pyx_6); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;} + __pyx_4 = PyNumber_Add(__pyx_v_ret, __pyx_6); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; - __pyx_6 = PyNumber_Add(__pyx_4, __pyx_k_74p); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;} + __pyx_6 = PyNumber_Add(__pyx_4, __pyx_k_72p); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_6; __pyx_6 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":563 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":620 * for i in self: * ret = ret + '0'*(i-last)+'1' * last = i+1 # <<<<<<<<<<<<<< * return ret * */ __pyx_v_last = (__pyx_v_i + 1); } Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":564 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":621 * ret = ret + '0'*(i-last)+'1' * last = i+1 * return ret # <<<<<<<<<<<<<< * * def update_with_signs(self, rhs): */ Py_INCREF(__pyx_v_ret); __pyx_r = __pyx_v_ret; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); Py_XDECREF(__pyx_6); __Pyx_AddTraceback("intbitset.intbitset.strbits"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_ret); Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":566 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":623 * return ret * * def update_with_signs(self, rhs): # <<<<<<<<<<<<<< * """Given a dictionary rhs whose keys are integers, remove all the integers * whose value are less than 0 and add every integer whose value is 0 or more""" */ static PyObject *__pyx_n_iteritems; static PyObject *__pyx_n_AttributeError; +static PyObject *__pyx_k_73p; +static PyObject *__pyx_k_74p; static PyObject *__pyx_k_75p; -static PyObject *__pyx_k_76p; -static PyObject *__pyx_k_77p; static PyObject *__pyx_builtin_AttributeError; -static char __pyx_k_75[] = "Negative numbers, not allowed"; -static char __pyx_k_76[] = "Elements must <= %s"; -static char __pyx_k_77[] = "rhs should be a valid dictionary with integers keys and integer values"; +static char __pyx_k_73[] = "Negative numbers, not allowed"; +static char __pyx_k_74[] = "Elements must <= %s"; +static char __pyx_k_75[] = "rhs should be a valid dictionary with integers keys and integer values"; static PyObject *__pyx_pf_9intbitset_9intbitset_update_with_signs(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_update_with_signs[] = "Given a dictionary rhs whose keys are integers, remove all the integers\n whose value are less than 0 and add every integer whose value is 0 or more"; static PyObject *__pyx_pf_9intbitset_9intbitset_update_with_signs(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { int __pyx_v_value; PyObject *__pyx_v_sign; PyObject *__pyx_r; int __pyx_1; - Py_ssize_t __pyx_2; + Py_ssize_t __pyx_2 = 0; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; PyObject *__pyx_5 = 0; PyObject *__pyx_6 = 0; int __pyx_7; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_rhs); __pyx_v_sign = Py_None; Py_INCREF(Py_None); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":570 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":627 * whose value are less than 0 and add every integer whose value is 0 or more""" * cdef int value * try: # <<<<<<<<<<<<<< * if self.sanity_checks: * for value, sign in rhs.iteritems(): */ /*try:*/ { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":571 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":628 * cdef int value * try: * if self.sanity_checks: # <<<<<<<<<<<<<< * for value, sign in rhs.iteritems(): * if value < 0: */ __pyx_1 = ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->sanity_checks; if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":572 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":629 * try: * if self.sanity_checks: * for value, sign in rhs.iteritems(): # <<<<<<<<<<<<<< * if value < 0: * raise ValueError, "Negative numbers, not allowed" */ - __pyx_3 = PyObject_GetAttr(__pyx_v_rhs, __pyx_n_iteritems); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L2;} - __pyx_4 = PyObject_Call(__pyx_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L2;} + __pyx_3 = PyObject_GetAttr(__pyx_v_rhs, __pyx_n_iteritems); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; goto __pyx_L2;} + __pyx_4 = PyObject_Call(__pyx_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; goto __pyx_L2;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (PyList_CheckExact(__pyx_4)) { __pyx_2 = 0; __pyx_3 = __pyx_4; Py_INCREF(__pyx_3); } - else { __pyx_3 = PyObject_GetIter(__pyx_4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L2;} } + else { __pyx_3 = PyObject_GetIter(__pyx_4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; goto __pyx_L2;} } Py_DECREF(__pyx_4); __pyx_4 = 0; for (;;) { if (PyList_CheckExact(__pyx_3)) { if (__pyx_2 >= PyList_GET_SIZE(__pyx_3)) break; __pyx_4 = PyList_GET_ITEM(__pyx_3, __pyx_2++); Py_INCREF(__pyx_4); } else { __pyx_4 = PyIter_Next(__pyx_3); if (!__pyx_4) { break; } } if (PyTuple_CheckExact(__pyx_4) && PyTuple_GET_SIZE(__pyx_4) == 2) { - __pyx_6 = PyTuple_GET_ITEM(__pyx_4, 0); + PyObject* tuple = __pyx_4; + __pyx_6 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(__pyx_6); - __pyx_7 = __pyx_PyInt_int(__pyx_6); if (unlikely((__pyx_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L2;} + __pyx_7 = __pyx_PyInt_int(__pyx_6); if (unlikely((__pyx_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; goto __pyx_L2;} Py_DECREF(__pyx_6); __pyx_6 = 0; __pyx_v_value = __pyx_7; - __pyx_6 = PyTuple_GET_ITEM(__pyx_4, 1); + __pyx_6 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(__pyx_6); Py_DECREF(__pyx_v_sign); __pyx_v_sign = __pyx_6; __pyx_6 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; } else { - __pyx_5 = PyObject_GetIter(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L2;} + __pyx_5 = PyObject_GetIter(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; goto __pyx_L2;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_6 = __Pyx_UnpackItem(__pyx_5); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L2;} - __pyx_7 = __pyx_PyInt_int(__pyx_6); if (unlikely((__pyx_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L2;} + __pyx_6 = __Pyx_UnpackItem(__pyx_5); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; goto __pyx_L2;} + __pyx_7 = __pyx_PyInt_int(__pyx_6); if (unlikely((__pyx_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; goto __pyx_L2;} Py_DECREF(__pyx_6); __pyx_6 = 0; __pyx_v_value = __pyx_7; - __pyx_6 = __Pyx_UnpackItem(__pyx_5); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L2;} + __pyx_6 = __Pyx_UnpackItem(__pyx_5); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; goto __pyx_L2;} Py_DECREF(__pyx_v_sign); __pyx_v_sign = __pyx_6; __pyx_6 = 0; - if (__Pyx_EndUnpack(__pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L2;} + if (__Pyx_EndUnpack(__pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; goto __pyx_L2;} Py_DECREF(__pyx_5); __pyx_5 = 0; } - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":573 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":630 * if self.sanity_checks: * for value, sign in rhs.iteritems(): * if value < 0: # <<<<<<<<<<<<<< * raise ValueError, "Negative numbers, not allowed" * elif value > maxelem: */ __pyx_1 = (__pyx_v_value < 0); if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":574 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":631 * for value, sign in rhs.iteritems(): * if value < 0: * raise ValueError, "Negative numbers, not allowed" # <<<<<<<<<<<<<< * elif value > maxelem: * raise OverflowError, "Elements must <= %s" % maxelem */ - __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_75p, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; goto __pyx_L2;} + __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k_73p, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; goto __pyx_L2;} goto __pyx_L7; } - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":575 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":632 * if value < 0: * raise ValueError, "Negative numbers, not allowed" * elif value > maxelem: # <<<<<<<<<<<<<< * raise OverflowError, "Elements must <= %s" % maxelem * if sign < 0: */ __pyx_1 = (__pyx_v_value > maxelem); if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":576 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":633 * raise ValueError, "Negative numbers, not allowed" * elif value > maxelem: * raise OverflowError, "Elements must <= %s" % maxelem # <<<<<<<<<<<<<< * if sign < 0: * intBitSetDelElem(self.bitset, value) */ - __pyx_6 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; goto __pyx_L2;} - __pyx_4 = PyNumber_Remainder(__pyx_k_76p, __pyx_6); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; goto __pyx_L2;} + __pyx_6 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; goto __pyx_L2;} + __pyx_4 = PyNumber_Remainder(__pyx_k_74p, __pyx_6); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; goto __pyx_L2;} Py_DECREF(__pyx_6); __pyx_6 = 0; __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_4, 0); Py_DECREF(__pyx_4); __pyx_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; goto __pyx_L2;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; goto __pyx_L2;} goto __pyx_L7; } __pyx_L7:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":577 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":634 * elif value > maxelem: * raise OverflowError, "Elements must <= %s" % maxelem * if sign < 0: # <<<<<<<<<<<<<< * intBitSetDelElem(self.bitset, value) * else: */ - __pyx_5 = PyObject_RichCompare(__pyx_v_sign, __pyx_num_0, Py_LT); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; goto __pyx_L2;} - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; goto __pyx_L2;} + __pyx_5 = PyObject_RichCompare(__pyx_v_sign, __pyx_num_0, Py_LT); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; goto __pyx_L2;} + __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; goto __pyx_L2;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":578 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":635 * raise OverflowError, "Elements must <= %s" % maxelem * if sign < 0: * intBitSetDelElem(self.bitset, value) # <<<<<<<<<<<<<< * else: * intBitSetAddElem(self.bitset, value) */ - intBitSetDelElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,__pyx_v_value); + intBitSetDelElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_value); goto __pyx_L8; } /*else*/ { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":580 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":637 * intBitSetDelElem(self.bitset, value) * else: * intBitSetAddElem(self.bitset, value) # <<<<<<<<<<<<<< * else: * for value, sign in rhs.iteritems(): */ - intBitSetAddElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,__pyx_v_value); + intBitSetAddElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_value); } __pyx_L8:; } Py_DECREF(__pyx_3); __pyx_3 = 0; goto __pyx_L4; } /*else*/ { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":582 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":639 * intBitSetAddElem(self.bitset, value) * else: * for value, sign in rhs.iteritems(): # <<<<<<<<<<<<<< * if sign < 0: * intBitSetDelElem(self.bitset, value) */ - __pyx_6 = PyObject_GetAttr(__pyx_v_rhs, __pyx_n_iteritems); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; goto __pyx_L2;} - __pyx_4 = PyObject_Call(__pyx_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; goto __pyx_L2;} + __pyx_6 = PyObject_GetAttr(__pyx_v_rhs, __pyx_n_iteritems); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; goto __pyx_L2;} + __pyx_4 = PyObject_Call(__pyx_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; goto __pyx_L2;} Py_DECREF(__pyx_6); __pyx_6 = 0; if (PyList_CheckExact(__pyx_4)) { __pyx_2 = 0; __pyx_5 = __pyx_4; Py_INCREF(__pyx_5); } - else { __pyx_5 = PyObject_GetIter(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; goto __pyx_L2;} } + else { __pyx_5 = PyObject_GetIter(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; goto __pyx_L2;} } Py_DECREF(__pyx_4); __pyx_4 = 0; for (;;) { if (PyList_CheckExact(__pyx_5)) { if (__pyx_2 >= PyList_GET_SIZE(__pyx_5)) break; __pyx_3 = PyList_GET_ITEM(__pyx_5, __pyx_2++); Py_INCREF(__pyx_3); } else { __pyx_3 = PyIter_Next(__pyx_5); if (!__pyx_3) { break; } } if (PyTuple_CheckExact(__pyx_3) && PyTuple_GET_SIZE(__pyx_3) == 2) { - __pyx_4 = PyTuple_GET_ITEM(__pyx_3, 0); + PyObject* tuple = __pyx_3; + __pyx_4 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(__pyx_4); - __pyx_7 = __pyx_PyInt_int(__pyx_4); if (unlikely((__pyx_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; goto __pyx_L2;} + __pyx_7 = __pyx_PyInt_int(__pyx_4); if (unlikely((__pyx_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; goto __pyx_L2;} Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_v_value = __pyx_7; - __pyx_4 = PyTuple_GET_ITEM(__pyx_3, 1); + __pyx_4 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(__pyx_4); Py_DECREF(__pyx_v_sign); __pyx_v_sign = __pyx_4; __pyx_4 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; } else { - __pyx_6 = PyObject_GetIter(__pyx_3); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; goto __pyx_L2;} + __pyx_6 = PyObject_GetIter(__pyx_3); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; goto __pyx_L2;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_4 = __Pyx_UnpackItem(__pyx_6); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; goto __pyx_L2;} - __pyx_7 = __pyx_PyInt_int(__pyx_4); if (unlikely((__pyx_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; goto __pyx_L2;} + __pyx_4 = __Pyx_UnpackItem(__pyx_6); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; goto __pyx_L2;} + __pyx_7 = __pyx_PyInt_int(__pyx_4); if (unlikely((__pyx_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; goto __pyx_L2;} Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_v_value = __pyx_7; - __pyx_4 = __Pyx_UnpackItem(__pyx_6); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; goto __pyx_L2;} + __pyx_4 = __Pyx_UnpackItem(__pyx_6); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; goto __pyx_L2;} Py_DECREF(__pyx_v_sign); __pyx_v_sign = __pyx_4; __pyx_4 = 0; - if (__Pyx_EndUnpack(__pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; goto __pyx_L2;} + if (__Pyx_EndUnpack(__pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; goto __pyx_L2;} Py_DECREF(__pyx_6); __pyx_6 = 0; } - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":583 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":640 * else: * for value, sign in rhs.iteritems(): * if sign < 0: # <<<<<<<<<<<<<< * intBitSetDelElem(self.bitset, value) * else: */ - __pyx_4 = PyObject_RichCompare(__pyx_v_sign, __pyx_num_0, Py_LT); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; goto __pyx_L2;} - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_4); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; goto __pyx_L2;} + __pyx_4 = PyObject_RichCompare(__pyx_v_sign, __pyx_num_0, Py_LT); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; goto __pyx_L2;} + __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_4); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; goto __pyx_L2;} Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":584 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":641 * for value, sign in rhs.iteritems(): * if sign < 0: * intBitSetDelElem(self.bitset, value) # <<<<<<<<<<<<<< * else: * intBitSetAddElem(self.bitset, value) */ - intBitSetDelElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,__pyx_v_value); + intBitSetDelElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_value); goto __pyx_L11; } /*else*/ { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":586 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":643 * intBitSetDelElem(self.bitset, value) * else: * intBitSetAddElem(self.bitset, value) # <<<<<<<<<<<<<< * except AttributeError: * raise TypeError, "rhs should be a valid dictionary with integers keys and integer values" */ - intBitSetAddElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,__pyx_v_value); + intBitSetAddElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_value); } __pyx_L11:; } Py_DECREF(__pyx_5); __pyx_5 = 0; } __pyx_L4:; } goto __pyx_L3; __pyx_L2:; Py_XDECREF(__pyx_3); __pyx_3 = 0; Py_XDECREF(__pyx_6); __pyx_6 = 0; Py_XDECREF(__pyx_4); __pyx_4 = 0; Py_XDECREF(__pyx_5); __pyx_5 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":587 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":644 * else: * intBitSetAddElem(self.bitset, value) * except AttributeError: # <<<<<<<<<<<<<< * raise TypeError, "rhs should be a valid dictionary with integers keys and integer values" * */ __pyx_7 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_7) { __Pyx_AddTraceback("intbitset.update_with_signs"); - if (__Pyx_GetException(&__pyx_3, &__pyx_6, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;} + if (__Pyx_GetException(&__pyx_3, &__pyx_6, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; goto __pyx_L1;} - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":588 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":645 * intBitSetAddElem(self.bitset, value) * except AttributeError: * raise TypeError, "rhs should be a valid dictionary with integers keys and integer values" # <<<<<<<<<<<<<< * * def get_size(self): */ - __Pyx_Raise(__pyx_builtin_TypeError, __pyx_k_77p, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; goto __pyx_L1;} + __Pyx_Raise(__pyx_builtin_TypeError, __pyx_k_75p, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_6); __pyx_6 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; goto __pyx_L3; } goto __pyx_L1; __pyx_L3:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); Py_XDECREF(__pyx_5); Py_XDECREF(__pyx_6); __Pyx_AddTraceback("intbitset.intbitset.update_with_signs"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_sign); Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_rhs); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":590 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":647 * raise TypeError, "rhs should be a valid dictionary with integers keys and integer values" * * def get_size(self): # <<<<<<<<<<<<<< * return intBitSetGetSize(self.bitset) * */ static PyObject *__pyx_pf_9intbitset_9intbitset_get_size(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ static PyObject *__pyx_pf_9intbitset_9intbitset_get_size(PyObject *__pyx_v_self, PyObject *unused) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; Py_INCREF(__pyx_v_self); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":591 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":648 * * def get_size(self): * return intBitSetGetSize(self.bitset) # <<<<<<<<<<<<<< * * def get_allocated(self): */ - __pyx_1 = PyInt_FromLong(intBitSetGetSize(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;} + __pyx_1 = PyInt_FromLong(intBitSetGetSize(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("intbitset.intbitset.get_size"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":593 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":650 * return intBitSetGetSize(self.bitset) * * def get_allocated(self): # <<<<<<<<<<<<<< * return intBitSetGetAllocated(self.bitset) * */ static PyObject *__pyx_pf_9intbitset_9intbitset_get_allocated(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ static PyObject *__pyx_pf_9intbitset_9intbitset_get_allocated(PyObject *__pyx_v_self, PyObject *unused) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; Py_INCREF(__pyx_v_self); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":594 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":651 * * def get_allocated(self): * return intBitSetGetAllocated(self.bitset) # <<<<<<<<<<<<<< * * def get_sorted_element(self, int index): */ - __pyx_1 = PyInt_FromLong(intBitSetGetAllocated(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; goto __pyx_L1;} + __pyx_1 = PyInt_FromLong(intBitSetGetAllocated(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("intbitset.intbitset.get_allocated"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":596 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":653 * return intBitSetGetAllocated(self.bitset) * * def get_sorted_element(self, int index): # <<<<<<<<<<<<<< * """Return element at position index in the sorted representation of the * set. Note that index must be less than len(self)""" */ static PyObject *__pyx_n_IndexError; +static PyObject *__pyx_k_76p; +static PyObject *__pyx_k_77p; static PyObject *__pyx_k_78p; -static PyObject *__pyx_k_79p; -static PyObject *__pyx_k_80p; static PyObject *__pyx_builtin_IndexError; -static char __pyx_k_78[] = "It's impossible to retrieve a negative item from an infinite set."; -static char __pyx_k_79[] = "Index must be <= %s"; -static char __pyx_k_80[] = "intbitset index out of range"; +static char __pyx_k_76[] = "It's impossible to retrieve a negative item from an infinite set."; +static char __pyx_k_77[] = "Index must be <= %s"; +static char __pyx_k_78[] = "intbitset index out of range"; static PyObject *__pyx_pf_9intbitset_9intbitset_get_sorted_element(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_get_sorted_element[] = "Return element at position index in the sorted representation of the\n set. Note that index must be less than len(self)"; static PyObject *__pyx_pf_9intbitset_9intbitset_get_sorted_element(PyObject *__pyx_v_self, PyObject *__pyx_arg_index) { int __pyx_v_index; int __pyx_v_l; int __pyx_v_last; int __pyx_v_i; PyObject *__pyx_r; int __pyx_1; word_t __pyx_2; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; - Py_INCREF(__pyx_v_self); assert(__pyx_arg_index); { - __pyx_v_index = __pyx_PyInt_int(__pyx_arg_index); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;} + __pyx_v_index = __pyx_PyInt_int(__pyx_arg_index); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; goto __pyx_L1;} } + Py_INCREF(__pyx_v_self); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":602 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":659 * cdef int last * cdef int i * l = intBitSetGetTot(self.bitset) # <<<<<<<<<<<<<< * if index < 0: * if self.bitset.trailing_bits: */ __pyx_v_l = intBitSetGetTot(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":603 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":660 * cdef int i * l = intBitSetGetTot(self.bitset) * if index < 0: # <<<<<<<<<<<<<< * if self.bitset.trailing_bits: * raise OverflowError, "It's impossible to retrieve a negative item from an infinite set." */ __pyx_1 = (__pyx_v_index < 0); if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":604 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":661 * l = intBitSetGetTot(self.bitset) * if index < 0: * if self.bitset.trailing_bits: # <<<<<<<<<<<<<< * raise OverflowError, "It's impossible to retrieve a negative item from an infinite set." * index = index + l */ __pyx_2 = ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset->trailing_bits; if (__pyx_2) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":605 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":662 * if index < 0: * if self.bitset.trailing_bits: * raise OverflowError, "It's impossible to retrieve a negative item from an infinite set." # <<<<<<<<<<<<<< * index = index + l * elif index > maxelem: */ - __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_k_78p, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;} + __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_k_76p, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":606 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":663 * if self.bitset.trailing_bits: * raise OverflowError, "It's impossible to retrieve a negative item from an infinite set." * index = index + l # <<<<<<<<<<<<<< * elif index > maxelem: * raise OverflowError, "Index must be <= %s" % maxelem */ __pyx_v_index = (__pyx_v_index + __pyx_v_l); goto __pyx_L2; } - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":607 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":664 * raise OverflowError, "It's impossible to retrieve a negative item from an infinite set." * index = index + l * elif index > maxelem: # <<<<<<<<<<<<<< * raise OverflowError, "Index must be <= %s" % maxelem * if 0 <= index < l: */ __pyx_1 = (__pyx_v_index > maxelem); if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":608 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":665 * index = index + l * elif index > maxelem: * raise OverflowError, "Index must be <= %s" % maxelem # <<<<<<<<<<<<<< * if 0 <= index < l: * last = intBitSetGetNext(self.bitset, -1) */ - __pyx_3 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; goto __pyx_L1;} - __pyx_4 = PyNumber_Remainder(__pyx_k_79p, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; goto __pyx_L1;} + __pyx_4 = PyNumber_Remainder(__pyx_k_77p, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_4, 0); Py_DECREF(__pyx_4); __pyx_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":609 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":666 * elif index > maxelem: * raise OverflowError, "Index must be <= %s" % maxelem * if 0 <= index < l: # <<<<<<<<<<<<<< * last = intBitSetGetNext(self.bitset, -1) * for i from 0 <= i < index: */ __pyx_1 = (0 <= __pyx_v_index); if (__pyx_1) { __pyx_1 = (__pyx_v_index < __pyx_v_l); } if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":610 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":667 * raise OverflowError, "Index must be <= %s" % maxelem * if 0 <= index < l: * last = intBitSetGetNext(self.bitset, -1) # <<<<<<<<<<<<<< * for i from 0 <= i < index: * last = intBitSetGetNext(self.bitset, last) */ - __pyx_v_last = intBitSetGetNext(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,-1); + __pyx_v_last = intBitSetGetNext(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, -1); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":611 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":668 * if 0 <= index < l: * last = intBitSetGetNext(self.bitset, -1) * for i from 0 <= i < index: # <<<<<<<<<<<<<< * last = intBitSetGetNext(self.bitset, last) * else: */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_index; __pyx_v_i++) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":612 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":669 * last = intBitSetGetNext(self.bitset, -1) * for i from 0 <= i < index: * last = intBitSetGetNext(self.bitset, last) # <<<<<<<<<<<<<< * else: * raise IndexError, "intbitset index out of range" */ - __pyx_v_last = intBitSetGetNext(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,__pyx_v_last); + __pyx_v_last = intBitSetGetNext(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_last); } goto __pyx_L4; } /*else*/ { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":614 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":671 * last = intBitSetGetNext(self.bitset, last) * else: * raise IndexError, "intbitset index out of range" # <<<<<<<<<<<<<< * return last * */ - __Pyx_Raise(__pyx_builtin_IndexError, __pyx_k_80p, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; goto __pyx_L1;} + __Pyx_Raise(__pyx_builtin_IndexError, __pyx_k_78p, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; goto __pyx_L1;} } __pyx_L4:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":615 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":672 * else: * raise IndexError, "intbitset index out of range" * return last # <<<<<<<<<<<<<< * * def to_sorted_list(self, int i, int j): */ - __pyx_3 = PyInt_FromLong(__pyx_v_last); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(__pyx_v_last); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); __Pyx_AddTraceback("intbitset.intbitset.get_sorted_element"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":617 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":674 * return last * * def to_sorted_list(self, int i, int j): # <<<<<<<<<<<<<< * """Return a sublist of the sorted representation of the set. * Note, negative indices are not supported.""" */ -static PyObject *__pyx_k_81p; -static PyObject *__pyx_k_82p; +static PyObject *__pyx_k_79p; +static PyObject *__pyx_k_80p; -static char __pyx_k_81[] = "It's impossible to retrieve a sublist using negative indices from an infinite set."; -static char __pyx_k_82[] = "Indexes must be <= %s"; +static char __pyx_k_79[] = "It's impossible to retrieve a sublist using negative indices from an infinite set."; +static char __pyx_k_80[] = "Indexes must be <= %s"; static PyObject *__pyx_pf_9intbitset_9intbitset_to_sorted_list(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_to_sorted_list[] = "Return a sublist of the sorted representation of the set.\n Note, negative indices are not supported."; static PyObject *__pyx_pf_9intbitset_9intbitset_to_sorted_list(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_i; int __pyx_v_j; int __pyx_v_l; int __pyx_v_last; int __pyx_v_cnt; PyObject *__pyx_v_ret; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"i","j",0}; - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "ii", __pyx_argnames, &__pyx_v_i, &__pyx_v_j))) return NULL; + if (likely(!__pyx_kwds) && likely(PyTuple_GET_SIZE(__pyx_args) == 2)) { + __pyx_v_i = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; goto __pyx_L2;} + __pyx_v_j = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_j == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; goto __pyx_L2;} + } + else { + if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "ii", __pyx_argnames, &__pyx_v_i, &__pyx_v_j))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; goto __pyx_L2;} + } + goto __pyx_L3; + __pyx_L2:; + return NULL; + __pyx_L3:; Py_INCREF(__pyx_v_self); __pyx_v_ret = Py_None; Py_INCREF(Py_None); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":623 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":680 * cdef int last * cdef int cnt * if self.bitset.trailing_bits and (i < 0 or j < 0): # <<<<<<<<<<<<<< * raise OverflowError, "It's impossible to retrieve a sublist using negative indices from an infinite set." * elif (i > maxelem or j > maxelem): */ __pyx_1 = ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset->trailing_bits; if (__pyx_1) { __pyx_1 = (__pyx_v_i < 0); if (!__pyx_1) { __pyx_1 = (__pyx_v_j < 0); } } if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":624 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":681 * cdef int cnt * if self.bitset.trailing_bits and (i < 0 or j < 0): * raise OverflowError, "It's impossible to retrieve a sublist using negative indices from an infinite set." # <<<<<<<<<<<<<< * elif (i > maxelem or j > maxelem): * raise OverflowError, "Indexes must be <= %s" % maxelem */ - __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_k_81p, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; goto __pyx_L1;} - goto __pyx_L2; + __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_k_79p, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; goto __pyx_L1;} + goto __pyx_L4; } - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":625 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":682 * if self.bitset.trailing_bits and (i < 0 or j < 0): * raise OverflowError, "It's impossible to retrieve a sublist using negative indices from an infinite set." * elif (i > maxelem or j > maxelem): # <<<<<<<<<<<<<< * raise OverflowError, "Indexes must be <= %s" % maxelem * l = intBitSetGetTot(self.bitset) */ __pyx_1 = (__pyx_v_i > maxelem); if (!__pyx_1) { __pyx_1 = (__pyx_v_j > maxelem); } if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":626 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":683 * raise OverflowError, "It's impossible to retrieve a sublist using negative indices from an infinite set." * elif (i > maxelem or j > maxelem): * raise OverflowError, "Indexes must be <= %s" % maxelem # <<<<<<<<<<<<<< * l = intBitSetGetTot(self.bitset) * if i == 0 and j == -1: */ - __pyx_2 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; goto __pyx_L1;} - __pyx_3 = PyNumber_Remainder(__pyx_k_82p, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; goto __pyx_L1;} + __pyx_3 = PyNumber_Remainder(__pyx_k_80p, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_3, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; goto __pyx_L1;} - goto __pyx_L2; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; goto __pyx_L1;} + goto __pyx_L4; } - __pyx_L2:; + __pyx_L4:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":627 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":684 * elif (i > maxelem or j > maxelem): * raise OverflowError, "Indexes must be <= %s" % maxelem * l = intBitSetGetTot(self.bitset) # <<<<<<<<<<<<<< * if i == 0 and j == -1: * return intbitset(self) */ __pyx_v_l = intBitSetGetTot(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":628 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":685 * raise OverflowError, "Indexes must be <= %s" % maxelem * l = intBitSetGetTot(self.bitset) * if i == 0 and j == -1: # <<<<<<<<<<<<<< * return intbitset(self) * ret = intbitset() */ __pyx_1 = (__pyx_v_i == 0); if (__pyx_1) { __pyx_1 = (__pyx_v_j == -1); } if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":629 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":686 * l = intBitSetGetTot(self.bitset) * if i == 0 and j == -1: * return intbitset(self) # <<<<<<<<<<<<<< * ret = intbitset() * if i < 0: */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; goto __pyx_L1;} Py_INCREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self); - __pyx_3 = PyObject_Call(((PyObject*)__pyx_ptype_9intbitset_intbitset), __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; goto __pyx_L1;} + __pyx_3 = PyObject_Call(((PyObject*)__pyx_ptype_9intbitset_intbitset), __pyx_2, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; - goto __pyx_L3; + goto __pyx_L5; } - __pyx_L3:; + __pyx_L5:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":630 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":687 * if i == 0 and j == -1: * return intbitset(self) * ret = intbitset() # <<<<<<<<<<<<<< * if i < 0: * i = i + l */ - __pyx_2 = PyObject_Call(((PyObject*)__pyx_ptype_9intbitset_intbitset), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; goto __pyx_L1;} + __pyx_2 = PyObject_Call(((PyObject*)__pyx_ptype_9intbitset_intbitset), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; goto __pyx_L1;} Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_2; __pyx_2 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":631 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":688 * return intbitset(self) * ret = intbitset() * if i < 0: # <<<<<<<<<<<<<< * i = i + l * if j < 0: */ __pyx_1 = (__pyx_v_i < 0); if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":632 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":689 * ret = intbitset() * if i < 0: * i = i + l # <<<<<<<<<<<<<< * if j < 0: * j = j + l */ __pyx_v_i = (__pyx_v_i + __pyx_v_l); - goto __pyx_L4; + goto __pyx_L6; } - __pyx_L4:; + __pyx_L6:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":633 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":690 * if i < 0: * i = i + l * if j < 0: # <<<<<<<<<<<<<< * j = j + l * if i >= l: */ __pyx_1 = (__pyx_v_j < 0); if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":634 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":691 * i = i + l * if j < 0: * j = j + l # <<<<<<<<<<<<<< * if i >= l: * i = l */ __pyx_v_j = (__pyx_v_j + __pyx_v_l); - goto __pyx_L5; + goto __pyx_L7; } - __pyx_L5:; + __pyx_L7:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":635 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":692 * if j < 0: * j = j + l * if i >= l: # <<<<<<<<<<<<<< * i = l * if j >= l: */ __pyx_1 = (__pyx_v_i >= __pyx_v_l); if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":636 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":693 * j = j + l * if i >= l: * i = l # <<<<<<<<<<<<<< * if j >= l: * j = l */ __pyx_v_i = __pyx_v_l; - goto __pyx_L6; + goto __pyx_L8; } - __pyx_L6:; + __pyx_L8:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":637 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":694 * if i >= l: * i = l * if j >= l: # <<<<<<<<<<<<<< * j = l * last = -1 */ __pyx_1 = (__pyx_v_j >= __pyx_v_l); if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":638 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":695 * i = l * if j >= l: * j = l # <<<<<<<<<<<<<< * last = -1 * for cnt from 0 <= cnt < i: */ __pyx_v_j = __pyx_v_l; - goto __pyx_L7; + goto __pyx_L9; } - __pyx_L7:; + __pyx_L9:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":639 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":696 * if j >= l: * j = l * last = -1 # <<<<<<<<<<<<<< * for cnt from 0 <= cnt < i: * last = intBitSetGetNext(self.bitset, last) */ __pyx_v_last = -1; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":640 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":697 * j = l * last = -1 * for cnt from 0 <= cnt < i: # <<<<<<<<<<<<<< * last = intBitSetGetNext(self.bitset, last) * for cnt from i <= cnt < j: */ for (__pyx_v_cnt = 0; __pyx_v_cnt < __pyx_v_i; __pyx_v_cnt++) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":641 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":698 * last = -1 * for cnt from 0 <= cnt < i: * last = intBitSetGetNext(self.bitset, last) # <<<<<<<<<<<<<< * for cnt from i <= cnt < j: * last = intBitSetGetNext(self.bitset, last) */ - __pyx_v_last = intBitSetGetNext(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,__pyx_v_last); + __pyx_v_last = intBitSetGetNext(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_last); } - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":642 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":699 * for cnt from 0 <= cnt < i: * last = intBitSetGetNext(self.bitset, last) * for cnt from i <= cnt < j: # <<<<<<<<<<<<<< * last = intBitSetGetNext(self.bitset, last) * intBitSetAddElem(( ret).bitset, last) */ for (__pyx_v_cnt = __pyx_v_i; __pyx_v_cnt < __pyx_v_j; __pyx_v_cnt++) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":643 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":700 * last = intBitSetGetNext(self.bitset, last) * for cnt from i <= cnt < j: * last = intBitSetGetNext(self.bitset, last) # <<<<<<<<<<<<<< * intBitSetAddElem(( ret).bitset, last) * return ret */ - __pyx_v_last = intBitSetGetNext(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,__pyx_v_last); + __pyx_v_last = intBitSetGetNext(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_last); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":644 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":701 * for cnt from i <= cnt < j: * last = intBitSetGetNext(self.bitset, last) * intBitSetAddElem(( ret).bitset, last) # <<<<<<<<<<<<<< * return ret * */ - intBitSetAddElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_ret)->bitset,__pyx_v_last); + intBitSetAddElem(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_ret)->bitset, __pyx_v_last); } - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":645 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":702 * last = intBitSetGetNext(self.bitset, last) * intBitSetAddElem(( ret).bitset, last) * return ret # <<<<<<<<<<<<<< * * def is_infinite(self): */ Py_INCREF(__pyx_v_ret); __pyx_r = __pyx_v_ret; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("intbitset.intbitset.to_sorted_list"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_ret); Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":647 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":704 * return ret * * def is_infinite(self): # <<<<<<<<<<<<<< * """Return True if the intbitset is infinite. (i.e. trailing_bits=True * was used in the constructor.)""" */ static PyObject *__pyx_pf_9intbitset_9intbitset_is_infinite(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_is_infinite[] = "Return True if the intbitset is infinite. (i.e. trailing_bits=True\n was used in the constructor.)"; static PyObject *__pyx_pf_9intbitset_9intbitset_is_infinite(PyObject *__pyx_v_self, PyObject *unused) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; Py_INCREF(__pyx_v_self); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":650 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":707 * """Return True if the intbitset is infinite. (i.e. trailing_bits=True * was used in the constructor.)""" * return self.bitset.trailing_bits != 0 # <<<<<<<<<<<<<< * * def extract_finite_list(self, int up_to=-1): */ - __pyx_1 = __Pyx_PyBool_FromLong((((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset->trailing_bits != 0)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; goto __pyx_L1;} + __pyx_1 = __Pyx_PyBool_FromLong((((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset->trailing_bits != 0)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("intbitset.intbitset.is_infinite"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":652 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":709 * return self.bitset.trailing_bits != 0 * * def extract_finite_list(self, int up_to=-1): # <<<<<<<<<<<<<< * """Return a finite list of elements sufficient to be passed to intbitset * constructor toghether with the proper value of trailing_bits in order */ static PyObject *__pyx_n_append; -static PyObject *__pyx_k_83p; +static PyObject *__pyx_k_81p; -static char __pyx_k_83[] = "up_to must be <= %s"; +static char __pyx_k_81[] = "up_to must be <= %s"; static PyObject *__pyx_pf_9intbitset_9intbitset_extract_finite_list(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_extract_finite_list[] = "Return a finite list of elements sufficient to be passed to intbitset\n constructor toghether with the proper value of trailing_bits in order\n to reproduce this intbitset. At least up_to integer are looked for when\n they are inside the intbitset but not necessarily needed to build the\n intbitset"; static PyObject *__pyx_pf_9intbitset_9intbitset_extract_finite_list(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_up_to; int __pyx_v_true_up_to; int __pyx_v_last; PyObject *__pyx_v_ret; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; int __pyx_5; static char *__pyx_argnames[] = {"up_to",0}; - __pyx_v_up_to = __pyx_k_13; - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|i", __pyx_argnames, &__pyx_v_up_to))) return NULL; + __pyx_v_up_to = -1; + if (likely(!__pyx_kwds) && likely(0 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 1)) { + if (PyTuple_GET_SIZE(__pyx_args) > 0) { + __pyx_v_up_to = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_up_to == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; goto __pyx_L2;} + } + } + else { + if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|i", __pyx_argnames, &__pyx_v_up_to))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; goto __pyx_L2;} + } + goto __pyx_L3; + __pyx_L2:; + return NULL; + __pyx_L3:; Py_INCREF(__pyx_v_self); __pyx_v_ret = Py_None; Py_INCREF(Py_None); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":660 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":717 * cdef int true_up_to * cdef int last * if self.sanity_checks and up_to > maxelem: # <<<<<<<<<<<<<< * raise OverflowError, "up_to must be <= %s" % maxelem * ret = [] */ __pyx_1 = ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->sanity_checks; if (__pyx_1) { __pyx_1 = (__pyx_v_up_to > maxelem); } if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":661 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":718 * cdef int last * if self.sanity_checks and up_to > maxelem: * raise OverflowError, "up_to must be <= %s" % maxelem # <<<<<<<<<<<<<< * ret = [] * true_up_to = max(up_to, (intBitSetGetSize(self.bitset)) * wordbitsize) */ - __pyx_2 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; goto __pyx_L1;} - __pyx_3 = PyNumber_Remainder(__pyx_k_83p, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; goto __pyx_L1;} + __pyx_3 = PyNumber_Remainder(__pyx_k_81p, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_3, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; goto __pyx_L1;} - goto __pyx_L2; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; goto __pyx_L1;} + goto __pyx_L4; } - __pyx_L2:; + __pyx_L4:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":662 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":719 * if self.sanity_checks and up_to > maxelem: * raise OverflowError, "up_to must be <= %s" % maxelem * ret = [] # <<<<<<<<<<<<<< * true_up_to = max(up_to, (intBitSetGetSize(self.bitset)) * wordbitsize) * last = -1 */ - __pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; goto __pyx_L1;} + __pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;} Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_2; __pyx_2 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":663 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":720 * raise OverflowError, "up_to must be <= %s" % maxelem * ret = [] * true_up_to = max(up_to, (intBitSetGetSize(self.bitset)) * wordbitsize) # <<<<<<<<<<<<<< * last = -1 * while last < true_up_to: */ - __pyx_3 = PyInt_FromLong(__pyx_v_up_to); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; goto __pyx_L1;} - __pyx_2 = PyInt_FromLong((intBitSetGetSize(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset) * wordbitsize)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(__pyx_v_up_to); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong((intBitSetGetSize(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset) * wordbitsize)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2); __pyx_3 = 0; __pyx_2 = 0; - __pyx_3 = PyObject_Call(__pyx_builtin_max, __pyx_4, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; goto __pyx_L1;} + __pyx_3 = PyObject_Call(__pyx_builtin_max, __pyx_4, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_5 = __pyx_PyInt_int(__pyx_3); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; goto __pyx_L1;} + __pyx_5 = __pyx_PyInt_int(__pyx_3); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_v_true_up_to = __pyx_5; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":664 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":721 * ret = [] * true_up_to = max(up_to, (intBitSetGetSize(self.bitset)) * wordbitsize) * last = -1 # <<<<<<<<<<<<<< * while last < true_up_to: * last = intBitSetGetNext(self.bitset, last) */ __pyx_v_last = -1; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":665 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":722 * true_up_to = max(up_to, (intBitSetGetSize(self.bitset)) * wordbitsize) * last = -1 * while last < true_up_to: # <<<<<<<<<<<<<< * last = intBitSetGetNext(self.bitset, last) * if last == -2: */ while (1) { __pyx_1 = (__pyx_v_last < __pyx_v_true_up_to); if (!__pyx_1) break; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":666 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":723 * last = -1 * while last < true_up_to: * last = intBitSetGetNext(self.bitset, last) # <<<<<<<<<<<<<< * if last == -2: * break */ - __pyx_v_last = intBitSetGetNext(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset,__pyx_v_last); + __pyx_v_last = intBitSetGetNext(((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset, __pyx_v_last); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":667 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":724 * while last < true_up_to: * last = intBitSetGetNext(self.bitset, last) * if last == -2: # <<<<<<<<<<<<<< * break * ret.append(last) */ __pyx_1 = (__pyx_v_last == -2); if (__pyx_1) { - goto __pyx_L4; - goto __pyx_L5; + goto __pyx_L6; + goto __pyx_L7; } - __pyx_L5:; + __pyx_L7:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":669 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":726 * if last == -2: * break * ret.append(last) # <<<<<<<<<<<<<< * return ret * */ - __pyx_2 = PyObject_GetAttr(__pyx_v_ret, __pyx_n_append); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; goto __pyx_L1;} - __pyx_4 = PyInt_FromLong(__pyx_v_last); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_v_ret, __pyx_n_append); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(__pyx_v_last); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4); __pyx_4 = 0; - __pyx_4 = PyObject_Call(__pyx_2, __pyx_3, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; goto __pyx_L1;} + __pyx_4 = PyObject_Call(__pyx_2, __pyx_3, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; } - __pyx_L4:; + __pyx_L6:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":670 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":727 * break * ret.append(last) * return ret # <<<<<<<<<<<<<< * * def get_wordbitsize(self): */ Py_INCREF(__pyx_v_ret); __pyx_r = __pyx_v_ret; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); __Pyx_AddTraceback("intbitset.intbitset.extract_finite_list"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_ret); Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":672 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":729 * return ret * * def get_wordbitsize(self): # <<<<<<<<<<<<<< * return wordbitsize * */ static PyObject *__pyx_pf_9intbitset_9intbitset_get_wordbitsize(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ static PyObject *__pyx_pf_9intbitset_9intbitset_get_wordbitsize(PyObject *__pyx_v_self, PyObject *unused) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; Py_INCREF(__pyx_v_self); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":673 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":730 * * def get_wordbitsize(self): * return wordbitsize # <<<<<<<<<<<<<< * * def get_wordbytsize(self): */ - __pyx_1 = PyInt_FromLong(wordbitsize); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; goto __pyx_L1;} + __pyx_1 = PyInt_FromLong(wordbitsize); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("intbitset.intbitset.get_wordbitsize"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":675 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":732 * return wordbitsize * * def get_wordbytsize(self): # <<<<<<<<<<<<<< * return wordbytesize * */ static PyObject *__pyx_pf_9intbitset_9intbitset_get_wordbytsize(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ static PyObject *__pyx_pf_9intbitset_9intbitset_get_wordbytsize(PyObject *__pyx_v_self, PyObject *unused) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; Py_INCREF(__pyx_v_self); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":676 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":733 * * def get_wordbytsize(self): * return wordbytesize # <<<<<<<<<<<<<< * * def tolist(self): */ - __pyx_1 = PyInt_FromLong(wordbytesize); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; goto __pyx_L1;} + __pyx_1 = PyInt_FromLong(wordbytesize); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("intbitset.intbitset.get_wordbytsize"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":678 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":735 * return wordbytesize * * def tolist(self): # <<<<<<<<<<<<<< * """Legacy method to retrieve a list of all the elements inside an * intbitset. */ -static PyObject *__pyx_k_84p; +static PyObject *__pyx_k_82p; -static char __pyx_k_84[] = "It's impossible to retrieve a list of an infinite set"; +static char __pyx_k_82[] = "It's impossible to retrieve a list of an infinite set"; static PyObject *__pyx_pf_9intbitset_9intbitset_tolist(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_tolist[] = "Legacy method to retrieve a list of all the elements inside an\n intbitset.\n "; static PyObject *__pyx_pf_9intbitset_9intbitset_tolist(PyObject *__pyx_v_self, PyObject *unused) { PyObject *__pyx_r; word_t __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; Py_INCREF(__pyx_v_self); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":682 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":739 * intbitset. * """ * if self.bitset.trailing_bits: # <<<<<<<<<<<<<< * raise OverflowError, "It's impossible to retrieve a list of an infinite set" * return self.extract_finite_list() */ __pyx_1 = ((struct __pyx_obj_9intbitset_intbitset *)__pyx_v_self)->bitset->trailing_bits; if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":683 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":740 * """ * if self.bitset.trailing_bits: * raise OverflowError, "It's impossible to retrieve a list of an infinite set" # <<<<<<<<<<<<<< * return self.extract_finite_list() * */ - __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_k_84p, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; goto __pyx_L1;} + __Pyx_Raise(__pyx_builtin_OverflowError, __pyx_k_82p, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":684 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":741 * if self.bitset.trailing_bits: * raise OverflowError, "It's impossible to retrieve a list of an infinite set" * return self.extract_finite_list() # <<<<<<<<<<<<<< * * cdef class intbitset_iterator: */ - __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_extract_finite_list); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; goto __pyx_L1;} - __pyx_3 = PyObject_Call(__pyx_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_extract_finite_list); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; goto __pyx_L1;} + __pyx_3 = PyObject_Call(__pyx_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("intbitset.intbitset.tolist"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":690 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":747 * cdef IntBitSet *bitset * * def __cinit__(self, intbitset bitset not None): # <<<<<<<<<<<<<< * self.last = -1 * self.bitset = bitset.bitset */ static int __pyx_pf_9intbitset_18intbitset_iterator___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pf_9intbitset_18intbitset_iterator___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_9intbitset_intbitset *__pyx_v_bitset = 0; int __pyx_r; static char *__pyx_argnames[] = {"bitset",0}; - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_bitset))) return -1; + if (likely(!__pyx_kwds) && likely(PyTuple_GET_SIZE(__pyx_args) == 1)) { + __pyx_v_bitset = ((struct __pyx_obj_9intbitset_intbitset *)PyTuple_GET_ITEM(__pyx_args, 0)); + } + else { + if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_bitset))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; goto __pyx_L2;} + } + goto __pyx_L3; + __pyx_L2:; + return -1; + __pyx_L3:; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_bitset); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bitset), __pyx_ptype_9intbitset_intbitset, 0, "bitset"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; goto __pyx_L1;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bitset), __pyx_ptype_9intbitset_intbitset, 0, "bitset"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; goto __pyx_L1;} - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":691 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":748 * * def __cinit__(self, intbitset bitset not None): * self.last = -1 # <<<<<<<<<<<<<< * self.bitset = bitset.bitset * */ ((struct __pyx_obj_9intbitset_intbitset_iterator *)__pyx_v_self)->last = -1; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":692 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":749 * def __cinit__(self, intbitset bitset not None): * self.last = -1 * self.bitset = bitset.bitset # <<<<<<<<<<<<<< * * def __next__(self): */ ((struct __pyx_obj_9intbitset_intbitset_iterator *)__pyx_v_self)->bitset = __pyx_v_bitset->bitset; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("intbitset.intbitset_iterator.__cinit__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_bitset); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":694 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":751 * self.bitset = bitset.bitset * * def __next__(self): # <<<<<<<<<<<<<< * self.last = intBitSetGetNext((self).bitset, self.last) * if self.last < 0: */ static PyObject *__pyx_n_StopIteration; static PyObject *__pyx_builtin_StopIteration; static PyObject *__pyx_pf_9intbitset_18intbitset_iterator___next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pf_9intbitset_18intbitset_iterator___next__(PyObject *__pyx_v_self) { PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; Py_INCREF(__pyx_v_self); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":695 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":752 * * def __next__(self): * self.last = intBitSetGetNext((self).bitset, self.last) # <<<<<<<<<<<<<< * if self.last < 0: * self.last = -2 */ - ((struct __pyx_obj_9intbitset_intbitset_iterator *)__pyx_v_self)->last = intBitSetGetNext(((struct __pyx_obj_9intbitset_intbitset_iterator *)__pyx_v_self)->bitset,((struct __pyx_obj_9intbitset_intbitset_iterator *)__pyx_v_self)->last); + ((struct __pyx_obj_9intbitset_intbitset_iterator *)__pyx_v_self)->last = intBitSetGetNext(((struct __pyx_obj_9intbitset_intbitset_iterator *)__pyx_v_self)->bitset, ((struct __pyx_obj_9intbitset_intbitset_iterator *)__pyx_v_self)->last); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":696 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":753 * def __next__(self): * self.last = intBitSetGetNext((self).bitset, self.last) * if self.last < 0: # <<<<<<<<<<<<<< * self.last = -2 * raise StopIteration */ __pyx_1 = (((struct __pyx_obj_9intbitset_intbitset_iterator *)__pyx_v_self)->last < 0); if (__pyx_1) { - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":697 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":754 * self.last = intBitSetGetNext((self).bitset, self.last) * if self.last < 0: * self.last = -2 # <<<<<<<<<<<<<< * raise StopIteration * return self.last */ ((struct __pyx_obj_9intbitset_intbitset_iterator *)__pyx_v_self)->last = -2; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":698 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":755 * if self.last < 0: * self.last = -2 * raise StopIteration # <<<<<<<<<<<<<< * return self.last * */ __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":699 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":756 * self.last = -2 * raise StopIteration * return self.last # <<<<<<<<<<<<<< * * def __iter__(self): */ - __pyx_2 = PyInt_FromLong(((struct __pyx_obj_9intbitset_intbitset_iterator *)__pyx_v_self)->last); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(((struct __pyx_obj_9intbitset_intbitset_iterator *)__pyx_v_self)->last); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); __Pyx_AddTraceback("intbitset.intbitset_iterator.__next__"); __pyx_r = NULL; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":701 +/* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":758 * return self.last * * def __iter__(self): # <<<<<<<<<<<<<< * return self */ static PyObject *__pyx_pf_9intbitset_18intbitset_iterator___iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pf_9intbitset_18intbitset_iterator___iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r; Py_INCREF(__pyx_v_self); - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":702 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":759 * * def __iter__(self): * return self # <<<<<<<<<<<<<< */ Py_INCREF(__pyx_v_self); __pyx_r = __pyx_v_self; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static __Pyx_InternTabEntry __pyx_intern_tab[] = { {&__pyx_n_AttributeError, "AttributeError"}, {&__pyx_n_CFG_INTBITSET_ENABLE_SANITY_CHECKS, "CFG_INTBITSET_ENABLE_SANITY_CHECKS"}, {&__pyx_n_Error, "Error"}, {&__pyx_n_Exception, "Exception"}, {&__pyx_n_IndexError, "IndexError"}, {&__pyx_n_KeyError, "KeyError"}, {&__pyx_n_OverflowError, "OverflowError"}, {&__pyx_n_StopIteration, "StopIteration"}, {&__pyx_n_TypeError, "TypeError"}, {&__pyx_n_ValueError, "ValueError"}, {&__pyx_n___all__, "__all__"}, {&__pyx_n___and__, "__and__"}, {&__pyx_n___apilevel__, "__apilevel__"}, {&__pyx_n___cinit__, "__cinit__"}, {&__pyx_n___cmp__, "__cmp__"}, {&__pyx_n___contains__, "__contains__"}, {&__pyx_n___dealloc__, "__dealloc__"}, {&__pyx_n___deepcopy__, "__deepcopy__"}, {&__pyx_n___del__, "__del__"}, {&__pyx_n___ge__, "__ge__"}, {&__pyx_n___hash__, "__hash__"}, {&__pyx_n___iadd__, "__iadd__"}, {&__pyx_n___iand__, "__iand__"}, {&__pyx_n___ior__, "__ior__"}, {&__pyx_n___isub__, "__isub__"}, {&__pyx_n___iter__, "__iter__"}, {&__pyx_n___ixor__, "__ixor__"}, {&__pyx_n___le__, "__le__"}, {&__pyx_n___len__, "__len__"}, {&__pyx_n___maxelem__, "__maxelem__"}, {&__pyx_n___next__, "__next__"}, {&__pyx_n___nonzero__, "__nonzero__"}, {&__pyx_n___or__, "__or__"}, {&__pyx_n___repr__, "__repr__"}, {&__pyx_n___revision__, "__revision__"}, {&__pyx_n___richcmp__, "__richcmp__"}, {&__pyx_n___str__, "__str__"}, {&__pyx_n___sub__, "__sub__"}, {&__pyx_n___xor__, "__xor__"}, {&__pyx_n_add, "add"}, {&__pyx_n_append, "append"}, {&__pyx_n_array, "array"}, {&__pyx_n_clear, "clear"}, {&__pyx_n_compress, "compress"}, {&__pyx_n_copy, "copy"}, {&__pyx_n_decompress, "decompress"}, {&__pyx_n_difference, "difference"}, {&__pyx_n_difference_update, "difference_update"}, {&__pyx_n_discard, "discard"}, {&__pyx_n_endswith, "endswith"}, {&__pyx_n_extract_finite_list, "extract_finite_list"}, {&__pyx_n_fastdump, "fastdump"}, {&__pyx_n_fastload, "fastload"}, {&__pyx_n_get_allocated, "get_allocated"}, {&__pyx_n_get_size, "get_size"}, {&__pyx_n_get_sorted_element, "get_sorted_element"}, {&__pyx_n_get_wordbitsize, "get_wordbitsize"}, {&__pyx_n_get_wordbytsize, "get_wordbytsize"}, {&__pyx_n_intbitset, "intbitset"}, {&__pyx_n_intersection, "intersection"}, {&__pyx_n_intersection_update, "intersection_update"}, {&__pyx_n_is_infinite, "is_infinite"}, {&__pyx_n_issubset, "issubset"}, {&__pyx_n_issuperset, "issuperset"}, {&__pyx_n_iteritems, "iteritems"}, {&__pyx_n_max, "max"}, {&__pyx_n_no_allocate, "no_allocate"}, {&__pyx_n_pop, "pop"}, {&__pyx_n_remove, "remove"}, {&__pyx_n_strbits, "strbits"}, {&__pyx_n_symmetric_difference, "symmetric_difference"}, {&__pyx_n_symmetric_difference_update, "symmetric_difference_update"}, {&__pyx_n_to_sorted_list, "to_sorted_list"}, {&__pyx_n_tolist, "tolist"}, {&__pyx_n_tostring, "tostring"}, {&__pyx_n_union, "union"}, {&__pyx_n_union_update, "union_update"}, {&__pyx_n_update_with_signs, "update_with_signs"}, {&__pyx_n_zlib, "zlib"}, {0, 0} }; static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_k_1p, __pyx_k_1, sizeof(__pyx_k_1), 0}, {&__pyx_k_5p, __pyx_k_5, sizeof(__pyx_k_5), 0}, + {&__pyx_k_10p, __pyx_k_10, sizeof(__pyx_k_10), 0}, + {&__pyx_k_11p, __pyx_k_11, sizeof(__pyx_k_11), 0}, + {&__pyx_k_12p, __pyx_k_12, sizeof(__pyx_k_12), 0}, + {&__pyx_k_14p, __pyx_k_14, sizeof(__pyx_k_14), 0}, {&__pyx_k_15p, __pyx_k_15, sizeof(__pyx_k_15), 0}, {&__pyx_k_16p, __pyx_k_16, sizeof(__pyx_k_16), 0}, {&__pyx_k_17p, __pyx_k_17, sizeof(__pyx_k_17), 0}, + {&__pyx_k_18p, __pyx_k_18, sizeof(__pyx_k_18), 0}, {&__pyx_k_19p, __pyx_k_19, sizeof(__pyx_k_19), 0}, {&__pyx_k_20p, __pyx_k_20, sizeof(__pyx_k_20), 0}, {&__pyx_k_21p, __pyx_k_21, sizeof(__pyx_k_21), 0}, {&__pyx_k_22p, __pyx_k_22, sizeof(__pyx_k_22), 0}, {&__pyx_k_23p, __pyx_k_23, sizeof(__pyx_k_23), 0}, {&__pyx_k_24p, __pyx_k_24, sizeof(__pyx_k_24), 0}, {&__pyx_k_25p, __pyx_k_25, sizeof(__pyx_k_25), 0}, {&__pyx_k_26p, __pyx_k_26, sizeof(__pyx_k_26), 0}, {&__pyx_k_27p, __pyx_k_27, sizeof(__pyx_k_27), 0}, {&__pyx_k_28p, __pyx_k_28, sizeof(__pyx_k_28), 0}, {&__pyx_k_29p, __pyx_k_29, sizeof(__pyx_k_29), 0}, {&__pyx_k_30p, __pyx_k_30, sizeof(__pyx_k_30), 0}, {&__pyx_k_31p, __pyx_k_31, sizeof(__pyx_k_31), 0}, {&__pyx_k_32p, __pyx_k_32, sizeof(__pyx_k_32), 0}, {&__pyx_k_33p, __pyx_k_33, sizeof(__pyx_k_33), 0}, {&__pyx_k_34p, __pyx_k_34, sizeof(__pyx_k_34), 0}, {&__pyx_k_35p, __pyx_k_35, sizeof(__pyx_k_35), 0}, {&__pyx_k_36p, __pyx_k_36, sizeof(__pyx_k_36), 0}, {&__pyx_k_37p, __pyx_k_37, sizeof(__pyx_k_37), 0}, {&__pyx_k_38p, __pyx_k_38, sizeof(__pyx_k_38), 0}, {&__pyx_k_39p, __pyx_k_39, sizeof(__pyx_k_39), 0}, - {&__pyx_k_40p, __pyx_k_40, sizeof(__pyx_k_40), 0}, + {&__pyx_k_44p, __pyx_k_44, sizeof(__pyx_k_44), 0}, {&__pyx_k_45p, __pyx_k_45, sizeof(__pyx_k_45), 0}, {&__pyx_k_46p, __pyx_k_46, sizeof(__pyx_k_46), 0}, {&__pyx_k_47p, __pyx_k_47, sizeof(__pyx_k_47), 0}, {&__pyx_k_48p, __pyx_k_48, sizeof(__pyx_k_48), 0}, {&__pyx_k_49p, __pyx_k_49, sizeof(__pyx_k_49), 0}, {&__pyx_k_50p, __pyx_k_50, sizeof(__pyx_k_50), 0}, {&__pyx_k_51p, __pyx_k_51, sizeof(__pyx_k_51), 0}, {&__pyx_k_52p, __pyx_k_52, sizeof(__pyx_k_52), 0}, {&__pyx_k_53p, __pyx_k_53, sizeof(__pyx_k_53), 0}, {&__pyx_k_54p, __pyx_k_54, sizeof(__pyx_k_54), 0}, {&__pyx_k_55p, __pyx_k_55, sizeof(__pyx_k_55), 0}, {&__pyx_k_56p, __pyx_k_56, sizeof(__pyx_k_56), 0}, {&__pyx_k_57p, __pyx_k_57, sizeof(__pyx_k_57), 0}, {&__pyx_k_58p, __pyx_k_58, sizeof(__pyx_k_58), 0}, {&__pyx_k_59p, __pyx_k_59, sizeof(__pyx_k_59), 0}, {&__pyx_k_60p, __pyx_k_60, sizeof(__pyx_k_60), 0}, {&__pyx_k_61p, __pyx_k_61, sizeof(__pyx_k_61), 0}, {&__pyx_k_62p, __pyx_k_62, sizeof(__pyx_k_62), 0}, {&__pyx_k_63p, __pyx_k_63, sizeof(__pyx_k_63), 0}, {&__pyx_k_64p, __pyx_k_64, sizeof(__pyx_k_64), 0}, {&__pyx_k_65p, __pyx_k_65, sizeof(__pyx_k_65), 0}, {&__pyx_k_66p, __pyx_k_66, sizeof(__pyx_k_66), 0}, {&__pyx_k_67p, __pyx_k_67, sizeof(__pyx_k_67), 0}, {&__pyx_k_68p, __pyx_k_68, sizeof(__pyx_k_68), 0}, {&__pyx_k_69p, __pyx_k_69, sizeof(__pyx_k_69), 0}, {&__pyx_k_70p, __pyx_k_70, sizeof(__pyx_k_70), 0}, {&__pyx_k_71p, __pyx_k_71, sizeof(__pyx_k_71), 0}, {&__pyx_k_72p, __pyx_k_72, sizeof(__pyx_k_72), 0}, {&__pyx_k_73p, __pyx_k_73, sizeof(__pyx_k_73), 0}, {&__pyx_k_74p, __pyx_k_74, sizeof(__pyx_k_74), 0}, {&__pyx_k_75p, __pyx_k_75, sizeof(__pyx_k_75), 0}, {&__pyx_k_76p, __pyx_k_76, sizeof(__pyx_k_76), 0}, {&__pyx_k_77p, __pyx_k_77, sizeof(__pyx_k_77), 0}, {&__pyx_k_78p, __pyx_k_78, sizeof(__pyx_k_78), 0}, {&__pyx_k_79p, __pyx_k_79, sizeof(__pyx_k_79), 0}, {&__pyx_k_80p, __pyx_k_80, sizeof(__pyx_k_80), 0}, {&__pyx_k_81p, __pyx_k_81, sizeof(__pyx_k_81), 0}, {&__pyx_k_82p, __pyx_k_82, sizeof(__pyx_k_82), 0}, - {&__pyx_k_83p, __pyx_k_83, sizeof(__pyx_k_83), 0}, - {&__pyx_k_84p, __pyx_k_84, sizeof(__pyx_k_84), 0}, {0, 0, 0, 0} }; static PyObject *__pyx_tp_new_9intbitset_intbitset(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; if (__pyx_pf_9intbitset_9intbitset___cinit__(o, a, k) < 0) { Py_DECREF(o); o = 0; } return o; } static void __pyx_tp_dealloc_9intbitset_intbitset(PyObject *o) { { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++o->ob_refcnt; __pyx_pf_9intbitset_9intbitset___dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --o->ob_refcnt; PyErr_Restore(etype, eval, etb); } (*o->ob_type->tp_free)(o); } static struct PyMethodDef __pyx_methods_9intbitset_intbitset[] = { {"__iadd__", (PyCFunction)__pyx_pf_9intbitset_9intbitset___iadd__, METH_O|METH_COEXIST, 0}, {"__isub__", (PyCFunction)__pyx_pf_9intbitset_9intbitset___isub__, METH_O|METH_COEXIST, 0}, {"__deepcopy__", (PyCFunction)__pyx_pf_9intbitset_9intbitset___deepcopy__, METH_O, 0}, {"__del__", (PyCFunction)__pyx_pf_9intbitset_9intbitset___del__, METH_O, 0}, {"__and__", (PyCFunction)__pyx_pf_9intbitset_9intbitset___and__, METH_O|METH_COEXIST, 0}, {"__or__", (PyCFunction)__pyx_pf_9intbitset_9intbitset___or__, METH_O|METH_COEXIST, 0}, {"__xor__", (PyCFunction)__pyx_pf_9intbitset_9intbitset___xor__, METH_O|METH_COEXIST, 0}, {"__sub__", (PyCFunction)__pyx_pf_9intbitset_9intbitset___sub__, METH_O|METH_COEXIST, 0}, {"__iand__", (PyCFunction)__pyx_pf_9intbitset_9intbitset___iand__, METH_O|METH_COEXIST, 0}, {"__ior__", (PyCFunction)__pyx_pf_9intbitset_9intbitset___ior__, METH_O|METH_COEXIST, 0}, {"__ixor__", (PyCFunction)__pyx_pf_9intbitset_9intbitset___ixor__, METH_O|METH_COEXIST, 0}, {"__repr__", (PyCFunction)__pyx_pf_9intbitset_9intbitset___repr__, METH_NOARGS|METH_COEXIST, 0}, {"__str__", (PyCFunction)__pyx_pf_9intbitset_9intbitset___str__, METH_NOARGS|METH_COEXIST, 0}, {"__iter__", (PyCFunction)__pyx_pf_9intbitset_9intbitset___iter__, METH_NOARGS|METH_COEXIST, 0}, {"add", (PyCFunction)__pyx_pf_9intbitset_9intbitset_add, METH_O, __pyx_doc_9intbitset_9intbitset_add}, {"clear", (PyCFunction)__pyx_pf_9intbitset_9intbitset_clear, METH_NOARGS, 0}, {"difference", (PyCFunction)__pyx_pf_9intbitset_9intbitset_difference, METH_O, __pyx_doc_9intbitset_9intbitset_difference}, {"difference_update", (PyCFunction)__pyx_pf_9intbitset_9intbitset_difference_update, METH_O, __pyx_doc_9intbitset_9intbitset_difference_update}, {"discard", (PyCFunction)__pyx_pf_9intbitset_9intbitset_discard, METH_O, __pyx_doc_9intbitset_9intbitset_discard}, {"intersection", (PyCFunction)__pyx_pf_9intbitset_9intbitset_intersection, METH_O, __pyx_doc_9intbitset_9intbitset_intersection}, {"intersection_update", (PyCFunction)__pyx_pf_9intbitset_9intbitset_intersection_update, METH_O, __pyx_doc_9intbitset_9intbitset_intersection_update}, {"union", (PyCFunction)__pyx_pf_9intbitset_9intbitset_union, METH_O, __pyx_doc_9intbitset_9intbitset_union}, {"union_update", (PyCFunction)__pyx_pf_9intbitset_9intbitset_union_update, METH_O, __pyx_doc_9intbitset_9intbitset_union_update}, {"issubset", (PyCFunction)__pyx_pf_9intbitset_9intbitset_issubset, METH_O, __pyx_doc_9intbitset_9intbitset_issubset}, {"issuperset", (PyCFunction)__pyx_pf_9intbitset_9intbitset_issuperset, METH_O, __pyx_doc_9intbitset_9intbitset_issuperset}, {"symmetric_difference", (PyCFunction)__pyx_pf_9intbitset_9intbitset_symmetric_difference, METH_O, __pyx_doc_9intbitset_9intbitset_symmetric_difference}, {"symmetric_difference_update", (PyCFunction)__pyx_pf_9intbitset_9intbitset_symmetric_difference_update, METH_O, __pyx_doc_9intbitset_9intbitset_symmetric_difference_update}, {"fastdump", (PyCFunction)__pyx_pf_9intbitset_9intbitset_fastdump, METH_NOARGS, __pyx_doc_9intbitset_9intbitset_fastdump}, {"fastload", (PyCFunction)__pyx_pf_9intbitset_9intbitset_fastload, METH_O, __pyx_doc_9intbitset_9intbitset_fastload}, {"copy", (PyCFunction)__pyx_pf_9intbitset_9intbitset_copy, METH_NOARGS, __pyx_doc_9intbitset_9intbitset_copy}, {"pop", (PyCFunction)__pyx_pf_9intbitset_9intbitset_pop, METH_NOARGS, __pyx_doc_9intbitset_9intbitset_pop}, {"remove", (PyCFunction)__pyx_pf_9intbitset_9intbitset_remove, METH_O, __pyx_doc_9intbitset_9intbitset_remove}, {"strbits", (PyCFunction)__pyx_pf_9intbitset_9intbitset_strbits, METH_NOARGS, __pyx_doc_9intbitset_9intbitset_strbits}, {"update_with_signs", (PyCFunction)__pyx_pf_9intbitset_9intbitset_update_with_signs, METH_O, __pyx_doc_9intbitset_9intbitset_update_with_signs}, {"get_size", (PyCFunction)__pyx_pf_9intbitset_9intbitset_get_size, METH_NOARGS, 0}, {"get_allocated", (PyCFunction)__pyx_pf_9intbitset_9intbitset_get_allocated, METH_NOARGS, 0}, {"get_sorted_element", (PyCFunction)__pyx_pf_9intbitset_9intbitset_get_sorted_element, METH_O, __pyx_doc_9intbitset_9intbitset_get_sorted_element}, {"to_sorted_list", (PyCFunction)__pyx_pf_9intbitset_9intbitset_to_sorted_list, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9intbitset_9intbitset_to_sorted_list}, {"is_infinite", (PyCFunction)__pyx_pf_9intbitset_9intbitset_is_infinite, METH_NOARGS, __pyx_doc_9intbitset_9intbitset_is_infinite}, {"extract_finite_list", (PyCFunction)__pyx_pf_9intbitset_9intbitset_extract_finite_list, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9intbitset_9intbitset_extract_finite_list}, {"get_wordbitsize", (PyCFunction)__pyx_pf_9intbitset_9intbitset_get_wordbitsize, METH_NOARGS, 0}, {"get_wordbytsize", (PyCFunction)__pyx_pf_9intbitset_9intbitset_get_wordbytsize, METH_NOARGS, 0}, {"tolist", (PyCFunction)__pyx_pf_9intbitset_9intbitset_tolist, METH_NOARGS, __pyx_doc_9intbitset_9intbitset_tolist}, {0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_intbitset = { 0, /*nb_add*/ __pyx_pf_9intbitset_9intbitset___sub__, /*nb_subtract*/ 0, /*nb_multiply*/ 0, /*nb_divide*/ 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ __pyx_pf_9intbitset_9intbitset___nonzero__, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ __pyx_pf_9intbitset_9intbitset___and__, /*nb_and*/ __pyx_pf_9intbitset_9intbitset___xor__, /*nb_xor*/ __pyx_pf_9intbitset_9intbitset___or__, /*nb_or*/ 0, /*nb_coerce*/ 0, /*nb_int*/ 0, /*nb_long*/ 0, /*nb_float*/ 0, /*nb_oct*/ 0, /*nb_hex*/ __pyx_pf_9intbitset_9intbitset___iadd__, /*nb_inplace_add*/ __pyx_pf_9intbitset_9intbitset___isub__, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ 0, /*nb_inplace_divide*/ 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ __pyx_pf_9intbitset_9intbitset___iand__, /*nb_inplace_and*/ __pyx_pf_9intbitset_9intbitset___ixor__, /*nb_inplace_xor*/ __pyx_pf_9intbitset_9intbitset___ior__, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX 0, /*nb_index*/ #endif }; static PySequenceMethods __pyx_tp_as_sequence_intbitset = { __pyx_pf_9intbitset_9intbitset___len__, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ __pyx_pf_9intbitset_9intbitset___contains__, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_intbitset = { __pyx_pf_9intbitset_9intbitset___len__, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_intbitset = { 0, /*bf_getreadbuffer*/ 0, /*bf_getwritebuffer*/ 0, /*bf_getsegcount*/ 0, /*bf_getcharbuffer*/ }; PyTypeObject __pyx_type_9intbitset_intbitset = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "intbitset.intbitset", /*tp_name*/ sizeof(struct __pyx_obj_9intbitset_intbitset), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_9intbitset_intbitset, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ __pyx_pf_9intbitset_9intbitset___cmp__, /*tp_compare*/ __pyx_pf_9intbitset_9intbitset___repr__, /*tp_repr*/ &__pyx_tp_as_number_intbitset, /*tp_as_number*/ &__pyx_tp_as_sequence_intbitset, /*tp_as_sequence*/ &__pyx_tp_as_mapping_intbitset, /*tp_as_mapping*/ __pyx_pf_9intbitset_9intbitset___hash__, /*tp_hash*/ 0, /*tp_call*/ __pyx_pf_9intbitset_9intbitset___str__, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_intbitset, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - "\n Defines an intbitset data object to hold unordered sets of\n unsigned integers with ultra fast set operations, implemented via\n bit vectors and Python C extension to optimize speed and memory\n usage.\n\n Emulates the Python built-in set class interface with some\n additional specific methods such as its own fast dump and load\n marshalling functions. Uses real bits to optimize memory usage,\n so may have issues with endianness if you transport serialized\n bitsets between various machine architectures.\n\n\n ", /*tp_doc*/ + "\n Defines an intbitset data object to hold unordered sets of\n unsigned integers with ultra fast set operations, implemented via\n bit vectors and Python C extension to optimize speed and memory\n usage.\n\n Emulates the Python built-in set class interface with some\n additional specific methods such as its own fast dump and load\n marshalling functions. Uses real bits to optimize memory usage,\n so may have issues with endianness if you transport serialized\n bitsets between various machine architectures.\n\n The constructor accept the following parameters:\n rhs=0, int preallocate=-1, int trailing_bits=0,\n bint sanity_checks=CFG_INTBITSET_ENABLE_SANITY_CHECKS,\n int no_allocate=0:\n\n where:\n * rhs can be:\n - int/long for creating allocating empty intbitset that will hold at least\n rhs elements, before being resized\n - intbitset for cloning\n - str for retrieving an intbitset that was dumped into a string\n - array for retrieving an intbitset that was dumped into a string stored\n in an array\n - sequence made of integers for copying all the elements from the\n sequence. If minsize is specified than it is initially allocated\n enough space to hold up to minsize integers, otherwise the biggest\n element of the sequence will be used.\n - sequence made of tuples: then the first element of each tuple\n is considered as an integer (as in the sequence made of integers).\n * preallocate is a suggested initial upper bound on the numbers that will be\n stored, by looking at rhs a sequence of number.\n * trailing_bits is 1, then the set will contain \"all\" the positive integers\n * no_allocate is used internally and should never be set.\n after the biggest one added with rhs.\n ", /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ __pyx_pf_9intbitset_9intbitset___richcmp__, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pf_9intbitset_9intbitset___iter__, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_9intbitset_intbitset, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_9intbitset_intbitset, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ }; static PyObject *__pyx_tp_new_9intbitset_intbitset_iterator(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; if (__pyx_pf_9intbitset_18intbitset_iterator___cinit__(o, a, k) < 0) { Py_DECREF(o); o = 0; } return o; } static void __pyx_tp_dealloc_9intbitset_intbitset_iterator(PyObject *o) { (*o->ob_type->tp_free)(o); } static struct PyMethodDef __pyx_methods_9intbitset_intbitset_iterator[] = { {"__next__", (PyCFunction)__pyx_pf_9intbitset_18intbitset_iterator___next__, METH_NOARGS|METH_COEXIST, 0}, {"__iter__", (PyCFunction)__pyx_pf_9intbitset_18intbitset_iterator___iter__, METH_NOARGS|METH_COEXIST, 0}, {0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_intbitset_iterator = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ 0, /*nb_divide*/ 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ 0, /*nb_coerce*/ 0, /*nb_int*/ 0, /*nb_long*/ 0, /*nb_float*/ 0, /*nb_oct*/ 0, /*nb_hex*/ 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ 0, /*nb_inplace_divide*/ 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX 0, /*nb_index*/ #endif }; static PySequenceMethods __pyx_tp_as_sequence_intbitset_iterator = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_intbitset_iterator = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_intbitset_iterator = { 0, /*bf_getreadbuffer*/ 0, /*bf_getwritebuffer*/ 0, /*bf_getsegcount*/ 0, /*bf_getcharbuffer*/ }; PyTypeObject __pyx_type_9intbitset_intbitset_iterator = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "intbitset.intbitset_iterator", /*tp_name*/ sizeof(struct __pyx_obj_9intbitset_intbitset_iterator), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_9intbitset_intbitset_iterator, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ 0, /*tp_repr*/ &__pyx_tp_as_number_intbitset_iterator, /*tp_as_number*/ &__pyx_tp_as_sequence_intbitset_iterator, /*tp_as_sequence*/ &__pyx_tp_as_mapping_intbitset_iterator, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_intbitset_iterator, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pf_9intbitset_18intbitset_iterator___iter__, /*tp_iter*/ __pyx_pf_9intbitset_18intbitset_iterator___next__, /*tp_iternext*/ __pyx_methods_9intbitset_intbitset_iterator, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_9intbitset_intbitset_iterator, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ }; static struct PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; static void __pyx_init_filenames(void); /*proto*/ PyMODINIT_FUNC initintbitset(void); /*proto*/ PyMODINIT_FUNC initintbitset(void) { PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; int __pyx_3; /*--- Libary function declarations ---*/ __pyx_init_filenames(); /*--- Module creation code ---*/ __pyx_m = Py_InitModule4("intbitset", __pyx_methods, 0, 0, PYTHON_API_VERSION); if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}; __pyx_b = PyImport_AddModule("__builtin__"); if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}; if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}; /*--- Intern code ---*/ __pyx_num_0 = PyInt_FromLong(0); if (unlikely(!__pyx_num_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}; __pyx_num_2 = PyInt_FromLong(2); if (unlikely(!__pyx_num_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}; __pyx_num_1 = PyInt_FromLong(1); if (unlikely(!__pyx_num_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}; __pyx_num_10 = PyInt_FromLong(10); if (unlikely(!__pyx_num_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}; __pyx_num_5 = PyInt_FromLong(5); if (unlikely(!__pyx_num_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}; if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}; /*--- String init code ---*/ if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}; /*--- Builtin init code ---*/ - __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; goto __pyx_L1;} - __pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_n_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; goto __pyx_L1;} - __pyx_builtin_max = __Pyx_GetName(__pyx_b, __pyx_n_max); if (!__pyx_builtin_max) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L1;} - __pyx_builtin_OverflowError = __Pyx_GetName(__pyx_b, __pyx_n_OverflowError); if (!__pyx_builtin_OverflowError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; goto __pyx_L1;} - __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; goto __pyx_L1;} - __pyx_builtin_KeyError = __Pyx_GetName(__pyx_b, __pyx_n_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; goto __pyx_L1;} - __pyx_builtin_AttributeError = __Pyx_GetName(__pyx_b, __pyx_n_AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;} - __pyx_builtin_IndexError = __Pyx_GetName(__pyx_b, __pyx_n_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; goto __pyx_L1;} - __pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_n_StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; goto __pyx_L1;} + __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; goto __pyx_L1;} + __pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_n_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;} + __pyx_builtin_max = __Pyx_GetName(__pyx_b, __pyx_n_max); if (!__pyx_builtin_max) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; goto __pyx_L1;} + __pyx_builtin_OverflowError = __Pyx_GetName(__pyx_b, __pyx_n_OverflowError); if (!__pyx_builtin_OverflowError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;} + __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; goto __pyx_L1;} + __pyx_builtin_KeyError = __Pyx_GetName(__pyx_b, __pyx_n_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; goto __pyx_L1;} + __pyx_builtin_AttributeError = __Pyx_GetName(__pyx_b, __pyx_n_AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; goto __pyx_L1;} + __pyx_builtin_IndexError = __Pyx_GetName(__pyx_b, __pyx_n_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; goto __pyx_L1;} + __pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_n_StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; goto __pyx_L1;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;} + __pyx_skip_dispatch = 0; /*--- Global init code ---*/ /*--- Function export code ---*/ /*--- Function import code ---*/ /*--- Type init code ---*/ if (PyType_Ready(&__pyx_type_9intbitset_intbitset) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;} if (PyObject_SetAttrString(__pyx_m, "intbitset", (PyObject *)&__pyx_type_9intbitset_intbitset) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;} __pyx_ptype_9intbitset_intbitset = &__pyx_type_9intbitset_intbitset; - if (PyType_Ready(&__pyx_type_9intbitset_intbitset_iterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; goto __pyx_L1;} - if (PyObject_SetAttrString(__pyx_m, "intbitset_iterator", (PyObject *)&__pyx_type_9intbitset_intbitset_iterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; goto __pyx_L1;} + if (PyType_Ready(&__pyx_type_9intbitset_intbitset_iterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; goto __pyx_L1;} + if (PyObject_SetAttrString(__pyx_m, "intbitset_iterator", (PyObject *)&__pyx_type_9intbitset_intbitset_iterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; goto __pyx_L1;} __pyx_ptype_9intbitset_intbitset_iterator = &__pyx_type_9intbitset_intbitset_iterator; /*--- Type import code ---*/ /*--- Execution code ---*/ /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":20 * ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * * __revision__ = "$Id$" # <<<<<<<<<<<<<< - * __apilevel__ = 1.02 + * __apilevel__ = 1.03 * */ if (PyObject_SetAttr(__pyx_m, __pyx_n___revision__, __pyx_k_1p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;} /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":21 * * __revision__ = "$Id$" - * __apilevel__ = 1.02 # <<<<<<<<<<<<<< + * __apilevel__ = 1.03 # <<<<<<<<<<<<<< * * """ */ - __pyx_1 = PyFloat_FromDouble(1.02); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;} + __pyx_1 = PyFloat_FromDouble(1.03); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n___apilevel__, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":44 * """ * * import zlib # <<<<<<<<<<<<<< * from array import array * from invenio.config import CFG_INTBITSET_ENABLE_SANITY_CHECKS */ __pyx_1 = __Pyx_Import(__pyx_n_zlib, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_zlib, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":45 * * import zlib * from array import array # <<<<<<<<<<<<<< * from invenio.config import CFG_INTBITSET_ENABLE_SANITY_CHECKS * */ __pyx_1 = PyList_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; goto __pyx_L1;} Py_INCREF(__pyx_n_array); PyList_SET_ITEM(__pyx_1, 0, __pyx_n_array); __pyx_2 = __Pyx_Import(__pyx_n_array, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_array, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":46 * import zlib * from array import array * from invenio.config import CFG_INTBITSET_ENABLE_SANITY_CHECKS # <<<<<<<<<<<<<< * * __all__ = ['intbitset'] */ __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; goto __pyx_L1;} Py_INCREF(__pyx_n_CFG_INTBITSET_ENABLE_SANITY_CHECKS); PyList_SET_ITEM(__pyx_2, 0, __pyx_n_CFG_INTBITSET_ENABLE_SANITY_CHECKS); __pyx_1 = __Pyx_Import(__pyx_k_5p, __pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_CFG_INTBITSET_ENABLE_SANITY_CHECKS); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_CFG_INTBITSET_ENABLE_SANITY_CHECKS, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":48 * from invenio.config import CFG_INTBITSET_ENABLE_SANITY_CHECKS * * __all__ = ['intbitset'] # <<<<<<<<<<<<<< * * cdef extern from "intbitset.h": */ __pyx_1 = PyList_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; goto __pyx_L1;} Py_INCREF(__pyx_n_intbitset); PyList_SET_ITEM(__pyx_1, 0, __pyx_n_intbitset); if (PyObject_SetAttr(__pyx_m, __pyx_n___all__, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":94 * unsigned char intBitSetCmp(IntBitSet *x, IntBitSet *y) * * __maxelem__ = maxelem # <<<<<<<<<<<<<< * * cdef class intbitset: */ __pyx_2 = PyInt_FromLong(maxelem); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n___maxelem__, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":114 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":137 * cdef bint sanity_checks * * def __cinit__(self, rhs=0, int preallocate=-1, int trailing_bits=0, bint sanity_checks=CFG_INTBITSET_ENABLE_SANITY_CHECKS, int no_allocate=0): # <<<<<<<<<<<<<< * """ * Initialize intbitset. */ - Py_INCREF(__pyx_num_0); - __pyx_k_8 = __pyx_num_0; - __pyx_k_9 = -1; - __pyx_k_10 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_CFG_INTBITSET_ENABLE_SANITY_CHECKS); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;} - __pyx_3 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely((__pyx_3 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;} + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_CFG_INTBITSET_ENABLE_SANITY_CHECKS); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; goto __pyx_L1;} + __pyx_3 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely((__pyx_3 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_k_11 = __pyx_3; - __pyx_k_12 = 0; - - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":652 - * return self.bitset.trailing_bits != 0 - * - * def extract_finite_list(self, int up_to=-1): # <<<<<<<<<<<<<< - * """Return a finite list of elements sufficient to be passed to intbitset - * constructor toghether with the proper value of trailing_bits in order - */ - __pyx_k_13 = -1; + __pyx_k_8 = __pyx_3; - /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":701 + /* "/usr/portage/build/cds-invenio/modules/miscutil/lib/intbitset.pyx":758 * return self.last * * def __iter__(self): # <<<<<<<<<<<<<< * return self */ return; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("intbitset"); } static char *__pyx_filenames[] = { "intbitset.pyx", }; /* Runtime support code */ static void __pyx_init_filenames(void) { __pyx_f = __pyx_filenames; } static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name) { if (!type) { PyErr_Format(PyExc_SystemError, "Missing type object"); return 0; } if ((none_allowed && obj == Py_None) || PyObject_TypeCheck(obj, type)) return 1; PyErr_Format(PyExc_TypeError, "Argument '%s' has incorrect type (expected %s, got %s)", name, type->tp_name, obj->ob_type->tp_name); return 0; } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { PyObject *__import__ = 0; PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; __import__ = PyObject_GetAttrString(__pyx_b, "__import__"); if (!__import__) goto bad; if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; module = PyObject_CallFunction(__import__, "OOOO", name, global_dict, empty_dict, list); bad: Py_XDECREF(empty_list); Py_XDECREF(__import__); Py_XDECREF(empty_dict); return module; } static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { PyObject *result; result = PyObject_GetAttr(dict, name); if (!result) PyErr_SetObject(PyExc_NameError, name); return result; } static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { Py_XINCREF(type); Py_XINCREF(value); Py_XINCREF(tb); /* First, check the traceback argument, replacing None with NULL. */ if (tb == Py_None) { Py_DECREF(tb); tb = 0; } else if (tb != NULL && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } /* Next, replace a missing value with None */ if (value == NULL) { value = Py_None; Py_INCREF(value); } #if PY_VERSION_HEX < 0x02050000 if (!PyClass_Check(type)) #else if (!PyType_Check(type)) #endif { /* Raising an instance. The value should be a dummy. */ if (value != Py_None) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } /* Normalize to raise , */ Py_DECREF(value); value = type; #if PY_VERSION_HEX < 0x02050000 if (PyInstance_Check(type)) { type = (PyObject*) ((PyInstanceObject*)type)->in_class; Py_INCREF(type); } else { PyErr_SetString(PyExc_TypeError, "raise: exception must be an old-style class or instance"); goto raise_error; } #else type = (PyObject*) type->ob_type; Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } #endif } PyErr_Restore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_Get(); PyErr_Fetch(type, value, tb); PyErr_NormalizeException(type, value, tb); if (PyErr_Occurred()) goto bad; Py_INCREF(*type); Py_INCREF(*value); Py_INCREF(*tb); tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; /* Make sure tstate is in a consistent state when we XDECREF these objects (XDECREF may run arbitrary code). */ Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); return 0; bad: Py_XDECREF(*type); Py_XDECREF(*value); Py_XDECREF(*tb); return -1; } static void __Pyx_UnpackError(void) { PyErr_SetString(PyExc_ValueError, "unpack sequence of wrong size"); } static PyObject *__Pyx_UnpackItem(PyObject *iter) { PyObject *item; if (!(item = PyIter_Next(iter))) { if (!PyErr_Occurred()) __Pyx_UnpackError(); } return item; } static int __Pyx_EndUnpack(PyObject *iter) { PyObject *item; if ((item = PyIter_Next(iter))) { Py_DECREF(item); __Pyx_UnpackError(); return -1; } else if (!PyErr_Occurred()) return 0; else return -1; } static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) { while (t->p) { *t->p = PyString_InternFromString(t->s); if (!*t->p) return -1; ++t; } return 0; } static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; ++t; } return 0; } #include "compile.h" #include "frameobject.h" #include "traceback.h" static void __Pyx_AddTraceback(char *funcname) { PyObject *py_srcfile = 0; PyObject *py_funcname = 0; PyObject *py_globals = 0; - PyObject *empty_tuple = 0; PyObject *empty_string = 0; PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_srcfile = PyString_FromString(__pyx_filename); if (!py_srcfile) goto bad; py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; py_globals = PyModule_GetDict(__pyx_m); if (!py_globals) goto bad; - empty_tuple = PyTuple_New(0); - if (!empty_tuple) goto bad; empty_string = PyString_FromString(""); if (!empty_string) goto bad; py_code = PyCode_New( 0, /*int argcount,*/ 0, /*int nlocals,*/ 0, /*int stacksize,*/ 0, /*int flags,*/ empty_string, /*PyObject *code,*/ - empty_tuple, /*PyObject *consts,*/ - empty_tuple, /*PyObject *names,*/ - empty_tuple, /*PyObject *varnames,*/ - empty_tuple, /*PyObject *freevars,*/ - empty_tuple, /*PyObject *cellvars,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ __pyx_lineno, /*int firstlineno,*/ empty_string /*PyObject *lnotab*/ ); if (!py_code) goto bad; py_frame = PyFrame_New( PyThreadState_Get(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ py_globals, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = __pyx_lineno; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); - Py_XDECREF(empty_tuple); Py_XDECREF(empty_string); Py_XDECREF(py_code); Py_XDECREF(py_frame); } /* Type Conversion Functions */ static INLINE Py_ssize_t __pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject* x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { if (x == Py_True) return 1; else if (x == Py_False) return 0; else return PyObject_IsTrue(x); } static INLINE PY_LONG_LONG __pyx_PyInt_AsLongLong(PyObject* x) { if (PyInt_CheckExact(x)) { return PyInt_AS_LONG(x); } else if (PyLong_CheckExact(x)) { return PyLong_AsLongLong(x); } else { + PY_LONG_LONG val; PyObject* tmp = PyNumber_Int(x); if (!tmp) return (PY_LONG_LONG)-1; - PY_LONG_LONG val = __pyx_PyInt_AsLongLong(tmp); + val = __pyx_PyInt_AsLongLong(tmp); Py_DECREF(tmp); return val; } } static INLINE unsigned PY_LONG_LONG __pyx_PyInt_AsUnsignedLongLong(PyObject* x) { if (PyInt_CheckExact(x)) { long val = PyInt_AS_LONG(x); if (unlikely(val < 0)) { PyErr_SetString(PyExc_TypeError, "Negative assignment to unsigned type."); return (unsigned PY_LONG_LONG)-1; } return val; } else if (PyLong_CheckExact(x)) { return PyLong_AsUnsignedLongLong(x); } else { + PY_LONG_LONG val; PyObject* tmp = PyNumber_Int(x); if (!tmp) return (PY_LONG_LONG)-1; - PY_LONG_LONG val = __pyx_PyInt_AsUnsignedLongLong(tmp); + val = __pyx_PyInt_AsUnsignedLongLong(tmp); Py_DECREF(tmp); return val; } } static INLINE unsigned char __pyx_PyInt_unsigned_char(PyObject* x) { if (sizeof(unsigned char) < sizeof(long)) { long long_val = __pyx_PyInt_AsLong(x); unsigned char val = (unsigned char)long_val; if (unlikely((val != long_val) || (long_val < 0))) { PyErr_SetString(PyExc_OverflowError, "value too large to convert to unsigned char"); return (unsigned char)-1; } return val; } else { return __pyx_PyInt_AsLong(x); } } static INLINE unsigned short __pyx_PyInt_unsigned_short(PyObject* x) { if (sizeof(unsigned short) < sizeof(long)) { long long_val = __pyx_PyInt_AsLong(x); unsigned short val = (unsigned short)long_val; if (unlikely((val != long_val) || (long_val < 0))) { PyErr_SetString(PyExc_OverflowError, "value too large to convert to unsigned short"); return (unsigned short)-1; } return val; } else { return __pyx_PyInt_AsLong(x); } } static INLINE char __pyx_PyInt_char(PyObject* x) { if (sizeof(char) < sizeof(long)) { long long_val = __pyx_PyInt_AsLong(x); char val = (char)long_val; if (unlikely((val != long_val) )) { PyErr_SetString(PyExc_OverflowError, "value too large to convert to char"); return (char)-1; } return val; } else { return __pyx_PyInt_AsLong(x); } } static INLINE short __pyx_PyInt_short(PyObject* x) { if (sizeof(short) < sizeof(long)) { long long_val = __pyx_PyInt_AsLong(x); short val = (short)long_val; if (unlikely((val != long_val) )) { PyErr_SetString(PyExc_OverflowError, "value too large to convert to short"); return (short)-1; } return val; } else { return __pyx_PyInt_AsLong(x); } } static INLINE int __pyx_PyInt_int(PyObject* x) { if (sizeof(int) < sizeof(long)) { long long_val = __pyx_PyInt_AsLong(x); int val = (int)long_val; if (unlikely((val != long_val) )) { PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int)-1; } return val; } else { return __pyx_PyInt_AsLong(x); } } static INLINE long __pyx_PyInt_long(PyObject* x) { if (sizeof(long) < sizeof(long)) { long long_val = __pyx_PyInt_AsLong(x); long val = (long)long_val; if (unlikely((val != long_val) )) { PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long)-1; } return val; } else { return __pyx_PyInt_AsLong(x); } } static INLINE signed char __pyx_PyInt_signed_char(PyObject* x) { if (sizeof(signed char) < sizeof(long)) { long long_val = __pyx_PyInt_AsLong(x); signed char val = (signed char)long_val; if (unlikely((val != long_val) )) { PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed char"); return (signed char)-1; } return val; } else { return __pyx_PyInt_AsLong(x); } } static INLINE signed short __pyx_PyInt_signed_short(PyObject* x) { if (sizeof(signed short) < sizeof(long)) { long long_val = __pyx_PyInt_AsLong(x); signed short val = (signed short)long_val; if (unlikely((val != long_val) )) { PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed short"); return (signed short)-1; } return val; } else { return __pyx_PyInt_AsLong(x); } } static INLINE signed int __pyx_PyInt_signed_int(PyObject* x) { if (sizeof(signed int) < sizeof(long)) { long long_val = __pyx_PyInt_AsLong(x); signed int val = (signed int)long_val; if (unlikely((val != long_val) )) { PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed int"); return (signed int)-1; } return val; } else { return __pyx_PyInt_AsLong(x); } } static INLINE signed long __pyx_PyInt_signed_long(PyObject* x) { if (sizeof(signed long) < sizeof(long)) { long long_val = __pyx_PyInt_AsLong(x); signed long val = (signed long)long_val; if (unlikely((val != long_val) )) { PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed long"); return (signed long)-1; } return val; } else { return __pyx_PyInt_AsLong(x); } } static INLINE long double __pyx_PyInt_long_double(PyObject* x) { if (sizeof(long double) < sizeof(long)) { long long_val = __pyx_PyInt_AsLong(x); long double val = (long double)long_val; if (unlikely((val != long_val) )) { PyErr_SetString(PyExc_OverflowError, "value too large to convert to long double"); return (long double)-1; } return val; } else { return __pyx_PyInt_AsLong(x); } } diff --git a/modules/miscutil/lib/intbitset.pyx b/modules/miscutil/lib/intbitset.pyx index 523a1d089..e27e30d13 100644 --- a/modules/miscutil/lib/intbitset.pyx +++ b/modules/miscutil/lib/intbitset.pyx @@ -1,702 +1,759 @@ # $Id$ ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN. ## ## CDS Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## CDS Invenio is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDS Invenio; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. __revision__ = "$Id$" -__apilevel__ = 1.02 +__apilevel__ = 1.03 """ Defines an intbitset data object to hold unordered sets of unsigned integers with ultra fast set operations, implemented via bit vectors and Python C extension to optimize speed and memory usage. Emulates the Python built-in set class interface with some additional specific methods such as its own fast dump and load marshalling functions. Uses real bits to optimize memory usage, so may have issues with endianness if you transport serialized bitsets between various machine architectures. Please note that no bigger than __maxelem__ elements can be added to an intbitset and, if CFG_INTBITSET_ENABLE_SANITY_CHECKS is disabled, you will receive unpredictable results. Note to Invenio developers: If you make modification to this file you have to manually regenerate intbitset.c by running: - $ pyrexc intbitset.pyx + $ cython intbitset.pyx and then commit generated intbitset.c to CVS. """ import zlib from array import array from invenio.config import CFG_INTBITSET_ENABLE_SANITY_CHECKS __all__ = ['intbitset'] cdef extern from "intbitset.h": ctypedef int Py_ssize_t cdef extern from "Python.h": object PyString_FromStringAndSize(char *s, Py_ssize_t len) int PyObject_AsReadBuffer(object obj, void **buf, Py_ssize_t *buf_len) cdef extern from "intbitset.h": ctypedef unsigned long long int word_t #ctypedef unsigned char bool_t ctypedef struct IntBitSet: int size int allocated word_t trailing_bits int tot word_t *bitset int wordbytesize int wordbitsize int maxelem IntBitSet *intBitSetCreate(int size, bint trailing_bits) IntBitSet *intBitSetCreateFromBuffer(void *buf, int bufsize) IntBitSet *intBitSetCreateNoAllocate() IntBitSet *intBitSetResetFromBuffer(IntBitSet *bitset, void *buf, int bufsize) IntBitSet *intBitSetReset(IntBitSet *bitset) void intBitSetDestroy(IntBitSet *bitset) IntBitSet *intBitSetClone(IntBitSet *bitset) int intBitSetGetSize(IntBitSet *bitset) int intBitSetGetAllocated(IntBitSet *bitset) int intBitSetGetTot(IntBitSet * bitset) bint intBitSetIsInElem(IntBitSet *bitset, int elem) void intBitSetAddElem(IntBitSet *bitset, int elem) void intBitSetDelElem(IntBitSet *bitset, int elem) bint intBitSetEmpty(IntBitSet *bitset) IntBitSet *intBitSetUnion(IntBitSet *x, IntBitSet *y) IntBitSet *intBitSetIntersection(IntBitSet *x, IntBitSet *y) IntBitSet *intBitSetSub(IntBitSet *x, IntBitSet *y) IntBitSet *intBitSetXor(IntBitSet *x, IntBitSet *y) IntBitSet *intBitSetIUnion(IntBitSet *dst, IntBitSet *src) IntBitSet *intBitSetIIntersection(IntBitSet *dst, IntBitSet *src) IntBitSet *intBitSetISub(IntBitSet *x, IntBitSet *y) IntBitSet *intBitSetIXor(IntBitSet *x, IntBitSet *y) int intBitSetGetNext(IntBitSet *x, int last) unsigned char intBitSetCmp(IntBitSet *x, IntBitSet *y) __maxelem__ = maxelem cdef class intbitset: """ Defines an intbitset data object to hold unordered sets of unsigned integers with ultra fast set operations, implemented via bit vectors and Python C extension to optimize speed and memory usage. Emulates the Python built-in set class interface with some additional specific methods such as its own fast dump and load marshalling functions. Uses real bits to optimize memory usage, so may have issues with endianness if you transport serialized bitsets between various machine architectures. + The constructor accept the following parameters: + rhs=0, int preallocate=-1, int trailing_bits=0, + bint sanity_checks=CFG_INTBITSET_ENABLE_SANITY_CHECKS, + int no_allocate=0: + where: + * rhs can be: + - int/long for creating allocating empty intbitset that will hold at least + rhs elements, before being resized + - intbitset for cloning + - str for retrieving an intbitset that was dumped into a string + - array for retrieving an intbitset that was dumped into a string stored + in an array + - sequence made of integers for copying all the elements from the + sequence. If minsize is specified than it is initially allocated + enough space to hold up to minsize integers, otherwise the biggest + element of the sequence will be used. + - sequence made of tuples: then the first element of each tuple + is considered as an integer (as in the sequence made of integers). + * preallocate is a suggested initial upper bound on the numbers that will be + stored, by looking at rhs a sequence of number. + * trailing_bits is 1, then the set will contain "all" the positive integers + * no_allocate is used internally and should never be set. + after the biggest one added with rhs. """ cdef IntBitSet *bitset cdef bint sanity_checks def __cinit__(self, rhs=0, int preallocate=-1, int trailing_bits=0, bint sanity_checks=CFG_INTBITSET_ENABLE_SANITY_CHECKS, int no_allocate=0): """ Initialize intbitset. * rhs can be: - int/long for creating allocating empty intbitset that will hold at least rhs elements, before being resized - intbitset for cloning - str for retrieving an intbitset that was dumped into a string - array for retrieving an intbitset that was dumped into a string stored in an array - sequence made of integers for copying all the elements from the sequence. If minsize is specified than it is initially allocated enough space to hold up to minsize integers, otherwise the biggest element of the sequence will be used. * preallocate is a suggested initial upper bound on the numbers that will be stored, by looking at rhs a sequence of number. * trailing_bits is 1, then the set will contain "all" the positive integers * no_allocate is used internally and should never be set. after the biggest one added with rhs. """ cdef Py_ssize_t size cdef void *buf cdef int elem cdef int i cdef int last cdef int remelem + cdef bint tuple_of_tuples self.sanity_checks = sanity_checks msg = "Error" self.bitset = NULL if no_allocate: self.bitset = intBitSetCreateNoAllocate() return if type(rhs) in (int, long): if rhs < 0: raise ValueError, "rhs can't be negative" self.bitset = intBitSetCreate(rhs, trailing_bits) elif type(rhs) is intbitset: self.bitset = intBitSetClone((rhs).bitset) elif type(rhs) in (str, array): try: if type(rhs) is array: rhs = rhs.tostring() tmp = zlib.decompress(rhs) if PyObject_AsReadBuffer(tmp, &buf, &size) < 0: raise Exception, "Buffer error!!!" self.bitset = intBitSetCreateFromBuffer(buf, size) except Exception, msg: raise ValueError, "rhs is corrupted: %s" % msg elif hasattr(rhs, '__iter__'): + tuple_of_tuples = rhs and type(rhs[0]) is tuple try: if preallocate < 0: - if rhs: + if rhs and type(rhs[0]) is int: preallocate = max(rhs) else: preallocate = 0 if self.sanity_checks: if not (0 <= preallocate < maxelem): raise OverflowError, "Can't integers bigger than %s" % maxelem self.bitset = intBitSetCreate(preallocate, trailing_bits) if trailing_bits: last = 0 if self.sanity_checks: - for elem in rhs: - if elem < 0: - raise ValueError, "Negative numbers, not allowed" - elif elem > maxelem: - raise OverflowError, "Elements must be <= %s" % maxelem - for remelem from last <= remelem < elem: - intBitSetDelElem(self.bitset, remelem) - last = elem + 1 + if tuple_of_tuples: + for tmp_tuple in rhs: + elem = tmp_tuple[0] + if elem < 0: + raise ValueError, "Negative numbers, not allowed" + elif elem > maxelem: + raise OverflowError, "Elements must be <= %s" % maxelem + for remelem from last <= remelem < elem: + intBitSetDelElem(self.bitset, remelem) + last = elem + 1 + else: + for elem in rhs: + if elem < 0: + raise ValueError, "Negative numbers, not allowed" + elif elem > maxelem: + raise OverflowError, "Elements must be <= %s" % maxelem + for remelem from last <= remelem < elem: + intBitSetDelElem(self.bitset, remelem) + last = elem + 1 else: - for elem in rhs: - for remelem from last <= remelem < elem: - intBitSetDelElem(self.bitset, remelem) - last = elem + 1 + if tuple_of_tuples: + for tmp_tuple in rhs: + elem = tmp_tuple[0] + for remelem from last <= remelem < elem: + intBitSetDelElem(self.bitset, remelem) + last = elem + 1 + else: + for elem in rhs: + for remelem from last <= remelem < elem: + intBitSetDelElem(self.bitset, remelem) + last = elem + 1 else: if self.sanity_checks: - for elem in rhs: - if elem < 0: - raise ValueError, "Negative numbers, not allowed" - elif elem > maxelem: - raise OverflowError, "Elements must be <= %s" % maxelem - intBitSetAddElem(self.bitset, elem) + if tuple_of_tuples: + for tmp_tuple in rhs: + elem = tmp_tuple[0] + if elem < 0: + raise ValueError, "Negative numbers, not allowed" + elif elem > maxelem: + raise OverflowError, "Elements must be <= %s" % maxelem + intBitSetAddElem(self.bitset, elem) + else: + for elem in rhs: + if elem < 0: + raise ValueError, "Negative numbers, not allowed" + elif elem > maxelem: + raise OverflowError, "Elements must be <= %s" % maxelem + intBitSetAddElem(self.bitset, elem) else: - for elem in rhs: - intBitSetAddElem(self.bitset, elem) + if tuple_of_tuples: + for tmp_tuple in rhs: + elem = tmp_tuple[0] + intBitSetAddElem(self.bitset, elem) + else: + for elem in rhs: + intBitSetAddElem(self.bitset, elem) except Exception, msg: raise ValueError, "retrieving integers from rhs is impossible: %s" % msg else: raise TypeError, "rhs is of unknown type %s" % type(rhs) def __dealloc__(self): if self.bitset: intBitSetDestroy(self.bitset) def __contains__(self, int elem): if self.sanity_checks: if elem < 0: raise ValueError, "Negative numbers, not allowed" elif elem > maxelem: raise OverflowError, "Element must be <= %s" % maxelem return intBitSetIsInElem(self.bitset, elem) != 0 def __cmp__(self, intbitset rhs not None): raise TypeError, "cannot compare intbitset using cmp()" def __richcmp__(self, intbitset rhs not None, int op): cdef short unsigned int tmp tmp = intBitSetCmp((self).bitset, rhs.bitset) if op == 0: # < return tmp == 1 if op == 1: # <= return tmp <= 1 if op == 2: # == return tmp == 0 if op == 3: # != return tmp > 0 if op == 4: # > return tmp == 2 if op == 5: # >= return tmp in (0, 2) def __len__(self): return intBitSetGetTot(self.bitset) def __hash__(self): return hash(PyString_FromStringAndSize(self.bitset.bitset, wordbytesize * (intBitSetGetTot(self.bitset) / wordbitsize + 1))) def __nonzero__(self): return not intBitSetEmpty(self.bitset) def __iadd__(self, rhs): cdef int elem if isinstance(rhs, (int, long)): if self.sanity_checks: if rhs < 0: raise ValueError, "Negative numbers, not allowed" elif rhs > maxelem: raise OverflowError, "rhs must be <= %s" % maxelem intBitSetAddElem(self.bitset, rhs) elif isinstance(rhs, intbitset): intBitSetIUnion(self.bitset, ( rhs).bitset) else: if self.sanity_checks: for elem in rhs: if elem < 0: raise ValueError, "Negative numbers, not allowed" elif elem > maxelem: raise OverflowError, "Elements must be <= %s" % maxelem intBitSetAddElem(self.bitset, elem) else: for elem in rhs: if elem < 0: raise ValueError, "Negative numbers, not allowed" elif elem > maxelem: raise OverflowError, "Elements must be <= %s" % maxelem intBitSetAddElem(self.bitset, elem) return self def __isub__(self, rhs): cdef int elem if isinstance(rhs, (int, long)): if self.sanity_checks: if rhs < 0: raise ValueError, "Negative numbers, not allowed" elif rhs > maxelem: raise OverflowError, "rhs must be <= %s" % maxelem intBitSetDelElem(self.bitset, rhs) elif isinstance(rhs, intbitset): intBitSetISub(self.bitset, ( rhs).bitset) else: if self.sanity_checks: for elem in rhs: if elem < 0: raise ValueError, "Negative numbers, not allowed" elif elem > maxelem: raise OverflowError, "Elements must be <= %s" % maxelem intBitSetDelElem(self.bitset, elem) else: for elem in rhs: intBitSetDelElem(self.bitset, elem) return self def __deepcopy__(self, memo): return intbitset(self) def __del__(self, int elem): if self.sanity_checks: if elem < 0: raise ValueError, "Negative numbers, not allowed" elif elem > maxelem: raise OverflowError, "Element must be <= %s" % maxelem intBitSetDelElem(self.bitset, elem) def __and__(self, intbitset rhs not None): ret = intbitset(no_allocate=1) (ret).bitset = intBitSetIntersection(( self).bitset, rhs.bitset) return ret def __or__(self, intbitset rhs not None): ret = intbitset(no_allocate=1) (ret).bitset = intBitSetUnion(( self).bitset, rhs.bitset) return ret def __xor__(self, intbitset rhs not None): ret = intbitset(no_allocate=1) (ret).bitset = intBitSetXor(( self).bitset, rhs.bitset) return ret def __sub__(self, intbitset rhs not None): ret = intbitset(no_allocate=1) (ret).bitset = intBitSetSub(( self).bitset, rhs.bitset) return ret def __iand__(self, intbitset rhs not None): intBitSetIIntersection(self.bitset, rhs.bitset) return self def __ior__(self, intbitset rhs not None): intBitSetIUnion(self.bitset, rhs.bitset) return self def __ixor__(self, intbitset rhs not None): intBitSetIXor(self.bitset, rhs.bitset) return self def __repr__(self): cdef int last cdef int maxelem if self.bitset.trailing_bits: maxelem = (intBitSetGetSize(self.bitset)) * wordbitsize ret = "intbitset([" last = -1 while last < maxelem: last = intBitSetGetNext(self.bitset, last) ret = ret + '%i, ' % last if ret.endswith(", "): ret = ret[:-2] ret = ret + '], trailing_bits=True)' return ret else: ret = "intbitset([" last = -1 while last >= -1: last = intBitSetGetNext(self.bitset, last) ret = ret + '%i, ' % last - ret = ret[:-len('-2, ')] + ret = ret[:-4] # -len('-2, ') if ret.endswith(', '): ret = ret[:-2] ret = ret + '])' return ret def __str__(self): cdef int tot tot = intBitSetGetTot(self.bitset) if tot < 0: begin_list = self.to_sorted_list(0, 10) ret = "intbitset([" for n in begin_list: ret = ret + '%i, ' % n ret = ret + "...])" return ret elif tot > 10: begin_list = self.to_sorted_list(0, 5) end_list = self.to_sorted_list(tot - 5, tot) ret = "intbitset([" for n in begin_list: ret = ret + '%i, ' % n ret = ret + "..., " for n in end_list: ret = ret + '%i, ' % n ret = ret[:-2] ret = ret + '])' return ret else: return self.__repr__() ## Buffer interface #def __getreadbuffer__(self, int i, void **p): #if i != 0: #return -1 #p[0] = (self).bitset #return (self).size * wordbytesize #def __getwritebuffer__(self, int i, void **p): #if i != 0: #raise SystemError #p[0] = (self).bitset #return (self).size * wordbytesize #def __getsegcount__(self, int *p): #if p != NULL: #p[0] = (self).size * wordbytesize #return 1 #def __getcharbuffer__(self, int i, char **p): #if i != 0: #return -1 #p[0] = (self).bitset #return (self).size * wordbytesize # Iterator interface def __iter__(self): if self.bitset.trailing_bits: raise OverflowError, "It's impossible to iterate over an infinite set." return intbitset_iterator(self) # Customized interface def add(self, int elem): """Add an element to a set. This has no effect if the element is already present.""" if self.sanity_checks: if elem < 0: raise ValueError, "Negative numbers, not allowed" elif elem > maxelem: raise OverflowError, "Element must be <= %s" % maxelem intBitSetAddElem(self.bitset, elem) def clear(self): intBitSetReset(self.bitset) def difference(intbitset self, rhs): """Return the difference of two intbitsets as a new set. (i.e. all elements that are in this intbitset but not the other.) """ return self.__sub__(rhs) def difference_update(self, rhs): """Remove all elements of another set from this set.""" self.__isub__(rhs) def discard(self, int elem): """Remove an element from a intbitset if it is a member. If the element is not a member, do nothing.""" if self.sanity_checks: if elem < 0: raise ValueError, "Negative numbers, not allowed" elif elem > maxelem: raise OverflowError, "Element must be <= %s" % maxelem intBitSetDelElem(self.bitset, elem) def intersection(self, rhs): """Return the intersection of two intbitsets as a new set. (i.e. all elements that are in both intbitsets.) """ return self.__and__(rhs) def intersection_update(self, rhs): """Update a intbitset with the intersection of itself and another.""" self.__iand__(rhs) def union(self, rhs): """Return the union of two intbitsets as a new set. (i.e. all elements that are in either intbitsets.) """ return self.__or__(rhs) def union_update(self, rhs): """Update a intbitset with the union of itself and another.""" self.__ior__(rhs) def issubset(self, rhs): """Report whether another set contains this set.""" return self.__le__(rhs) def issuperset(self, rhs): """Report whether this set contains another set.""" return self.__ge__(rhs) def symmetric_difference(self, rhs): """Return the symmetric difference of two sets as a new set. (i.e. all elements that are in exactly one of the sets.) """ return self.__xor__(rhs) def symmetric_difference_update(self, rhs): """Update an intbitset with the symmetric difference of itself and another. """ self.__ixor__(rhs) # Dumping & Loading def fastdump(self): """Return a compressed string representation suitable to be saved somewhere.""" cdef Py_ssize_t size size = intBitSetGetSize(( self).bitset) tmp = PyString_FromStringAndSize(self.bitset.bitset, ( size + 1) * wordbytesize) return zlib.compress(tmp) def fastload(self, strdump): """Load a compressed string representation produced by a previous call to the fastdump method into the current intbitset. The previous content will be replaced.""" cdef Py_ssize_t size cdef void *buf buf = NULL size = 0 try: if type(strdump) is array: strdump = strdump.tostring() # tmp needed to not be garbage collected tmp = zlib.decompress(strdump) if PyObject_AsReadBuffer(tmp, &buf, &size) < 0: raise Exception intBitSetResetFromBuffer(( self).bitset, buf, size) except: raise ValueError, "strdump is corrupted" return self def copy(self): """Return a shallow copy of a set.""" return intbitset(self) def pop(self): """Remove and return an arbitrary set element.""" cdef int ret ret = intBitSetGetNext(self.bitset, -1) if ret < 0: raise KeyError, "pop from an empty intbitset" intBitSetDelElem(self.bitset, ret) return ret def remove(self, int elem): """Remove an element from a set; it must be a member. If the element is not a member, raise a KeyError. """ if self.sanity_checks: if elem < 0: raise ValueError, "Negative numbers, not allowed" elif elem > maxelem: raise OverflowError, "Elements must be <= %s" % maxelem if intBitSetIsInElem(self.bitset, elem): intBitSetDelElem(self.bitset, elem) else: raise KeyError, elem def strbits(self): """Return a string of 0s and 1s representing the content in memory of the intbitset. """ cdef int i cdef int last if ( self).bitset.trailing_bits: raise OverflowError, "It's impossible to print an infinite set." last = 0 ret = '' for i in self: ret = ret + '0'*(i-last)+'1' last = i+1 return ret def update_with_signs(self, rhs): """Given a dictionary rhs whose keys are integers, remove all the integers whose value are less than 0 and add every integer whose value is 0 or more""" cdef int value try: if self.sanity_checks: for value, sign in rhs.iteritems(): if value < 0: raise ValueError, "Negative numbers, not allowed" elif value > maxelem: raise OverflowError, "Elements must <= %s" % maxelem if sign < 0: intBitSetDelElem(self.bitset, value) else: intBitSetAddElem(self.bitset, value) else: for value, sign in rhs.iteritems(): if sign < 0: intBitSetDelElem(self.bitset, value) else: intBitSetAddElem(self.bitset, value) except AttributeError: raise TypeError, "rhs should be a valid dictionary with integers keys and integer values" def get_size(self): return intBitSetGetSize(self.bitset) def get_allocated(self): return intBitSetGetAllocated(self.bitset) def get_sorted_element(self, int index): """Return element at position index in the sorted representation of the set. Note that index must be less than len(self)""" cdef int l cdef int last cdef int i l = intBitSetGetTot(self.bitset) if index < 0: if self.bitset.trailing_bits: raise OverflowError, "It's impossible to retrieve a negative item from an infinite set." index = index + l elif index > maxelem: raise OverflowError, "Index must be <= %s" % maxelem if 0 <= index < l: last = intBitSetGetNext(self.bitset, -1) for i from 0 <= i < index: last = intBitSetGetNext(self.bitset, last) else: raise IndexError, "intbitset index out of range" return last def to_sorted_list(self, int i, int j): """Return a sublist of the sorted representation of the set. Note, negative indices are not supported.""" cdef int l cdef int last cdef int cnt if self.bitset.trailing_bits and (i < 0 or j < 0): raise OverflowError, "It's impossible to retrieve a sublist using negative indices from an infinite set." elif (i > maxelem or j > maxelem): raise OverflowError, "Indexes must be <= %s" % maxelem l = intBitSetGetTot(self.bitset) if i == 0 and j == -1: return intbitset(self) ret = intbitset() if i < 0: i = i + l if j < 0: j = j + l if i >= l: i = l if j >= l: j = l last = -1 for cnt from 0 <= cnt < i: last = intBitSetGetNext(self.bitset, last) for cnt from i <= cnt < j: last = intBitSetGetNext(self.bitset, last) intBitSetAddElem(( ret).bitset, last) return ret def is_infinite(self): """Return True if the intbitset is infinite. (i.e. trailing_bits=True was used in the constructor.)""" return self.bitset.trailing_bits != 0 def extract_finite_list(self, int up_to=-1): """Return a finite list of elements sufficient to be passed to intbitset constructor toghether with the proper value of trailing_bits in order to reproduce this intbitset. At least up_to integer are looked for when they are inside the intbitset but not necessarily needed to build the intbitset""" cdef int true_up_to cdef int last if self.sanity_checks and up_to > maxelem: raise OverflowError, "up_to must be <= %s" % maxelem ret = [] true_up_to = max(up_to, (intBitSetGetSize(self.bitset)) * wordbitsize) last = -1 while last < true_up_to: last = intBitSetGetNext(self.bitset, last) if last == -2: break ret.append(last) return ret def get_wordbitsize(self): return wordbitsize def get_wordbytsize(self): return wordbytesize def tolist(self): """Legacy method to retrieve a list of all the elements inside an intbitset. """ if self.bitset.trailing_bits: raise OverflowError, "It's impossible to retrieve a list of an infinite set" return self.extract_finite_list() cdef class intbitset_iterator: cdef int last cdef IntBitSet *bitset def __cinit__(self, intbitset bitset not None): self.last = -1 self.bitset = bitset.bitset def __next__(self): self.last = intBitSetGetNext((self).bitset, self.last) if self.last < 0: self.last = -2 raise StopIteration return self.last def __iter__(self): return self diff --git a/modules/miscutil/lib/intbitset_tests.py b/modules/miscutil/lib/intbitset_tests.py index 8702c44c8..5e6d26c0b 100644 --- a/modules/miscutil/lib/intbitset_tests.py +++ b/modules/miscutil/lib/intbitset_tests.py @@ -1,386 +1,395 @@ # -*- coding: utf-8 -*- ## ## $Id$ ## ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN. ## ## CDS Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## CDS Invenio is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDS Invenio; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. """Unit tests for the intbitset data structure.""" __revision__ = "$Id$" import unittest from invenio.intbitset import intbitset try: set() except NameError: from sets import Set as set class IntBitSetTest(unittest.TestCase): """Test functions related to intbitset data structure.""" def setUp(self): self.sets = [ [10, 20], [10, 40], [60, 70], [60, 80], [10, 20, 60, 70], [10, 40, 60, 80], [1000], [10000], [23, 45, 67, 89, 110, 130, 174, 1002, 2132, 23434], - [700, 2000] + [700, 2000], ] self.fncs_list = [ (intbitset.__and__, set.__and__, int.__and__, False), (intbitset.__or__, set.__or__, int.__or__, False), (intbitset.__xor__, set.__xor__, int.__xor__, False), (intbitset.__sub__, set.__sub__, int.__sub__, False), (intbitset.__iand__, set.__iand__, int.__and__, True), (intbitset.__ior__, set.__ior__, int.__or__, True), (intbitset.__ixor__, set.__ixor__, int.__xor__, True), (intbitset.__isub__, set.__isub__, int.__sub__, True), ] self.cmp_list = [ (intbitset.__eq__, set.__eq__, lambda x, y: cmp(x, y) == 0), (intbitset.__ge__, set.__ge__, lambda x, y: cmp(x, y) >= 0), (intbitset.__gt__, set.__gt__, lambda x, y: cmp(x, y) > 0), (intbitset.__le__, set.__le__, lambda x, y: cmp(x, y) <= 0), (intbitset.__lt__, set.__lt__, lambda x, y: cmp(x, y) < 0), (intbitset.__ne__, set.__ne__, lambda x, y: cmp(x, y) != 0), ] def _helper_sanity_test(self, intbitset1, msg=''): wordbitsize = intbitset1.get_wordbitsize() size1 = intbitset1.get_size() allocated1 = intbitset1.get_allocated() creator_list = intbitset1.extract_finite_list() up_to1 = creator_list and max(creator_list) or -1 self.failUnless(up_to1 <= size1 * wordbitsize < allocated1 * wordbitsize, "up_to1=%s, size1=%s, allocated1=%s while testing %s during %s" % (up_to1, size1 * wordbitsize, allocated1 * wordbitsize, intbitset1, msg)) tmp = intbitset(intbitset1.fastdump()) size2 = tmp.get_size() allocated2 = tmp.get_allocated() creator_list = tmp.extract_finite_list() up_to2 = creator_list and max(creator_list) or -1 self.failUnless(up_to2 <= size2 * wordbitsize < allocated2 * wordbitsize, "After serialization up_to2=%s, size2=%s, allocated2=%s while testing %s during %s" % (up_to2, size2 * wordbitsize, allocated2 * wordbitsize, intbitset1, msg)) def _helper_test_via_fncs_list(self, fncs, intbitset1, intbitset2): orig1 = intbitset(intbitset1) orig2 = intbitset(intbitset2) msg = "Testing %s(%s, %s)" % (fncs[0].__name__, repr(intbitset1), repr(intbitset2)) trailing1 = intbitset1.is_infinite() trailing2 = intbitset2.is_infinite() if fncs[3]: fncs[0](intbitset1, intbitset2) trailing1 = fncs[2](trailing1, trailing2) > 0 up_to = intbitset1.extract_finite_list() and max(intbitset1.extract_finite_list()) or -1 else: intbitset3 = fncs[0](intbitset1, intbitset2) trailing3 = fncs[2](trailing1, trailing2) > 0 up_to = intbitset3.extract_finite_list() and max(intbitset3.extract_finite_list()) or -1 set1 = set(orig1.extract_finite_list(up_to)) set2 = set(orig2.extract_finite_list(up_to)) if fncs[3]: fncs[1](set1, set2) else: set3 = fncs[1](set1, set2) self._helper_sanity_test(intbitset1, msg) self._helper_sanity_test(intbitset2, msg) if fncs[3]: self.assertEqual(set1 & set(intbitset1.extract_finite_list(up_to)), set(intbitset1.extract_finite_list(up_to)), "%s not equal to %s after executing %s(%s, %s)" % (set1, set(intbitset1.extract_finite_list(up_to)), fncs[0].__name__, repr(orig1), repr(orig2))) self.assertEqual(set1 | set(intbitset1.extract_finite_list(up_to)), set1, "%s not equal to %s after executing %s(%s, %s)" % (set1, set(intbitset1.extract_finite_list(up_to)), fncs[0].__name__, repr(orig1), repr(orig2))) self.assertEqual(trailing1, intbitset1.is_infinite(), "%s is not %s as it is supposed to be after executing %s(%s, %s)" % (intbitset1, trailing1 and 'infinite' or 'finite', fncs[0].__name__, repr(orig1), repr(orig2))) else: self._helper_sanity_test(intbitset3, msg) self.assertEqual(set3 & set(intbitset3.extract_finite_list(up_to)), set(intbitset3.extract_finite_list(up_to)), "%s not equal to %s after executing %s(%s, %s)" % (set3, set(intbitset3.extract_finite_list(up_to)), fncs[0].__name__, repr(orig1), repr(orig2))) self.assertEqual(set3 | set(intbitset3.extract_finite_list(up_to)), set3, "%s not equal to %s after executing %s(%s, %s)" % (set3, set(intbitset3.extract_finite_list(up_to)), fncs[0].__name__, repr(orig1), repr(orig2))) self.assertEqual(trailing3, intbitset3.is_infinite(), "%s is not %s as it is supposed to be after executing %s(%s, %s)" % (intbitset3, trailing3 and 'infinite' or 'finite', fncs[0].__name__, repr(orig1), repr(orig2))) def _helper_test_normal_set(self, fncs): for set1 in self.sets: for set2 in self.sets: self._helper_test_via_fncs_list(fncs, intbitset(set1), intbitset(set2)) def _helper_test_empty_set(self, fncs): for set1 in self.sets: self._helper_test_via_fncs_list(fncs, intbitset(set1), intbitset([])) self._helper_test_via_fncs_list(fncs, intbitset([]), intbitset(set1)) self._helper_test_via_fncs_list(fncs, intbitset([]), intbitset([])) def _helper_test_inifinite_set(self, fncs): for set1 in self.sets: for set2 in self.sets: self._helper_test_via_fncs_list(fncs, intbitset(set1), intbitset(set2, trailing_bits=True)) self._helper_test_via_fncs_list(fncs, intbitset(set1, trailing_bits=True), intbitset(set2)) self._helper_test_via_fncs_list(fncs, intbitset(set1, trailing_bits=True), intbitset(set2, trailing_bits=True)) def _helper_test_infinite_vs_empty(self, fncs): for set1 in self.sets: self._helper_test_via_fncs_list(fncs, intbitset(set1, trailing_bits=True), intbitset([])) self._helper_test_via_fncs_list(fncs, intbitset([]), intbitset(set1, trailing_bits=True)) self._helper_test_via_fncs_list(fncs, intbitset([]), intbitset(trailing_bits=True)) self._helper_test_via_fncs_list(fncs, intbitset(trailing_bits=True), intbitset([])) def test_set_intersection(self): """intbitset - set intersection, normal set""" self._helper_test_normal_set(self.fncs_list[0]) def test_set_intersection_empty(self): """intbitset - set intersection, empty set""" self._helper_test_empty_set(self.fncs_list[0]) def test_set_intersection_infinite(self): """intbitset - set intersection, infinite set""" self._helper_test_inifinite_set(self.fncs_list[0]) def test_set_intersection_infinite_empty(self): """intbitset - set intersection, infinite vs empty""" self._helper_test_infinite_vs_empty(self.fncs_list[0]) def test_set_union(self): """intbitset - set union, normal set""" self._helper_test_normal_set(self.fncs_list[1]) def test_set_union_empty(self): """intbitset - set union, empty set""" self._helper_test_empty_set(self.fncs_list[1]) def test_set_union_infinite(self): """intbitset - set union, infinite set""" self._helper_test_inifinite_set(self.fncs_list[1]) def test_set_union_infinite_empty(self): """intbitset - set union, infinite vs empty""" self._helper_test_infinite_vs_empty(self.fncs_list[1]) def test_set_symmetric_difference(self): """intbitset - set symmetric difference, normal set""" self._helper_test_normal_set(self.fncs_list[2]) def test_set_symmetric_difference_empty(self): """intbitset - set symmetric difference, empty set""" self._helper_test_empty_set(self.fncs_list[2]) def test_set_symmetric_difference_infinite(self): """intbitset - set symmetric difference, infinite set""" self._helper_test_inifinite_set(self.fncs_list[2]) def test_set_symmetric_difference_infinite_empty(self): """intbitset - set symmetric difference, infinite vs empty""" self._helper_test_infinite_vs_empty(self.fncs_list[2]) def test_set_difference(self): """intbitset - set difference, normal set""" self._helper_test_normal_set(self.fncs_list[3]) def test_set_difference_empty(self): """intbitset - set difference, empty set""" self._helper_test_empty_set(self.fncs_list[3]) def test_set_difference_infinite(self): """intbitset - set difference, infinite set""" self._helper_test_inifinite_set(self.fncs_list[3]) def test_set_difference_infinite_empty(self): """intbitset - set difference, infinite vs empty""" self._helper_test_infinite_vs_empty(self.fncs_list[3]) def test_set_intersection_in_place(self): """intbitset - set intersection, normal set in place""" self._helper_test_normal_set(self.fncs_list[4]) def test_set_intersection_empty_in_place(self): """intbitset - set intersection, empty set in place""" self._helper_test_empty_set(self.fncs_list[4]) def test_set_intersection_infinite_in_place(self): """intbitset - set intersection, infinite set in place""" self._helper_test_inifinite_set(self.fncs_list[4]) def test_set_intersection_infinite_empty_in_place(self): """intbitset - set intersection, infinite vs empty in place""" self._helper_test_infinite_vs_empty(self.fncs_list[4]) def test_set_union_in_place(self): """intbitset - set union, normal set in place""" self._helper_test_normal_set(self.fncs_list[5]) def test_set_union_empty_in_place(self): """intbitset - set union, empty set in place""" self._helper_test_empty_set(self.fncs_list[5]) def test_set_union_infinite_in_place(self): """intbitset - set union, infinite set in place""" self._helper_test_inifinite_set(self.fncs_list[5]) def test_set_union_infinite_empty_in_place(self): """intbitset - set union, infinite vs empty in place""" self._helper_test_infinite_vs_empty(self.fncs_list[5]) def test_set_symmetric_difference_in_place(self): """intbitset - set symmetric difference, normal set in place""" self._helper_test_normal_set(self.fncs_list[6]) def test_set_symmetric_difference_empty_in_place(self): """intbitset - set symmetric difference, empty set in place""" self._helper_test_empty_set(self.fncs_list[6]) def test_set_symmetric_difference_infinite_in_place(self): """intbitset - set symmetric difference, infinite set in place""" self._helper_test_inifinite_set(self.fncs_list[6]) def test_set_symmetric_difference_infinite_empty_in_place(self): """intbitset - set symmetric difference, infinite vs empty in place""" self._helper_test_infinite_vs_empty(self.fncs_list[6]) def test_set_difference_in_place(self): """intbitset - set difference, normal set in place""" self._helper_test_normal_set(self.fncs_list[7]) def test_set_difference_empty_in_place(self): """intbitset - set difference, empty set in place""" self._helper_test_empty_set(self.fncs_list[7]) def test_set_difference_infinite_in_place(self): """intbitset - set difference, infinite set in place""" self._helper_test_inifinite_set(self.fncs_list[7]) def test_set_difference_infinite_empty_in_place(self): """intbitset - set difference, infinite vs empty in place""" self._helper_test_infinite_vs_empty(self.fncs_list[7]) def test_list_dump(self): """intbitset - list dump""" for set1 in self.sets + [[]]: self.assertEqual(list(intbitset(set1)), set1) def test_ascii_bit_dump(self): """intbitset - ascii bit dump""" for set1 in self.sets + [[]]: tot = 0 count = 0 for bit in intbitset(set1).strbits(): if bit == '0': self.failIf(count in set1) elif bit == '1': self.failIf(count not in set1) tot += 1 else: self.fail() count += 1 self.assertEqual(tot, len(set1)) + def test_tuple_of_tuples(self): + """intbitset - support tuple of tuples""" + for set1 in self.sets + [[]]: + tmp_tuple = tuple([(elem, ) for elem in set1]) + self.assertEqual(list(intbitset(set1)), list(intbitset(tmp_tuple))) + for set1 in self.sets + [[]]: + tmp_tuple = tuple([(elem, ) for elem in set1]) + self.assertEqual(intbitset(set1, trailing_bits=True), intbitset(tmp_tuple, trailing_bits=True)) + def test_marshalling(self): """intbitset - marshalling""" for set1 in self.sets + [[]]: self.assertEqual(intbitset(set1), intbitset().fastload((intbitset(set1).fastdump()))) for set1 in self.sets + [[]]: self.assertEqual(intbitset(set1, trailing_bits=True), intbitset().fastload(intbitset(set1, trailing_bits=True).fastdump())) for set1 in self.sets + [[]]: self.assertEqual(intbitset(set1), intbitset().fastload((intbitset(set1).fastdump()))) for set1 in self.sets + [[]]: self.assertEqual(intbitset(set1, trailing_bits=True), intbitset().fastload(intbitset(set1, trailing_bits=True).fastdump())) #def test_set_emptiness(self): #"""intbitset - tests for emptiness""" #map(lambda x, y: self.assertEqual(x.__nonzero__(), y, "%s is %s empty" % (x, not y and 'not' or '')), self.sets. self.emptiness) def test_set_clear(self): """intbitset - clearing""" for set1 in self.sets + [[]]: intbitset1 = intbitset(set1) intbitset1.clear() self.assertEqual(list(intbitset1), []) intbitset1 = intbitset(set1, trailing_bits=True) intbitset1.clear() self.assertEqual(list(intbitset1), []) def test_set_repr(self): """intbitset - Pythonic representation""" for set1 in self.sets + [[]]: intbitset1 = intbitset(set1) self.assertEqual(intbitset1, eval(repr(intbitset1))) for set1 in self.sets + [[]]: intbitset1 = intbitset(set1, trailing_bits=True) self.assertEqual(intbitset1, eval(repr(intbitset1))) def test_set_cmp(self): """intbitset - (non infinte) set comparison""" for set1 in self.sets + [[]]: for set2 in self.sets + [[]]: for op in self.cmp_list: self.assertEqual(op[0](intbitset(set1), intbitset(set2)), op[1](set(set1), set(set2)), "Error in comparing %s %s with comparing function %s" % (set1, set2, op[0].__name__)) def test_set_update_with_signs(self): """intbitset - set update with signs""" dict1 = {10 : -1, 20 : 1, 23 : -1, 27 : 1, 33 : -1, 56 : 1, 70 : -1, 74 : 1} for set1 in self.sets + [[]]: intbitset1 = intbitset(set1) intbitset1.update_with_signs(dict1) up_to = max(dict1.keys() + set1) for i in xrange(up_to + 1): if dict1.get(i, i in set1 and 1 or -1) == 1: self.failUnless(i in intbitset1, "%s was not correctly updated from %s by %s" % (repr(intbitset1), repr(set1), repr(dict1))) else: self.failIf(i in intbitset1, "%s was not correctly updated from %s by %s" % (repr(intbitset1), repr(set1), repr(dict1))) def test_set_cloning(self): """intbitset - set cloning""" import copy for set1 in self.sets + [[]]: intbitset1 = intbitset(set1) intbitset2 = intbitset(intbitset1) intbitset3 = copy.deepcopy(intbitset2) self._helper_sanity_test(intbitset1) self._helper_sanity_test(intbitset2) self._helper_sanity_test(intbitset3) self.assertEqual(intbitset1, intbitset2) self.assertEqual(intbitset1, intbitset3) for set1 in self.sets + [[]]: intbitset1 = intbitset(set1, trailing_bits=True) intbitset2 = intbitset(intbitset1) intbitset3 = copy.deepcopy(intbitset2) self._helper_sanity_test(intbitset1) self._helper_sanity_test(intbitset2) self._helper_sanity_test(intbitset3) self.assertEqual(intbitset1, intbitset2) self.assertEqual(intbitset1, intbitset3) def create_test_suite(): """Return test suite for the intbitset data structure.""" return unittest.TestSuite(( unittest.makeSuite(IntBitSetTest, 'test'), )) if __name__ == "__main__": unittest.TextTestRunner(verbosity=2).run(create_test_suite())