diff --git a/sklearn/utils/murmurhash.c b/sklearn/utils/murmurhash.c index 8230c9cee22d9ec4d87837de0a03233df2ad708a..c0795ee5331b6d7a20abc8570b6df9ee8b9431f8 100644 --- a/sklearn/utils/murmurhash.c +++ b/sklearn/utils/murmurhash.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.15.1 on Tue Jan 17 02:25:55 2012 */ +/* Generated by Cython 0.15.1 on Tue Jan 17 02:33:20 2012 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -415,6 +415,8 @@ static void __Pyx_WriteUnraisable(const char *name, int clineno, static int __Pyx_check_binary_version(void); +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /*proto*/ + static void __Pyx_AddTraceback(const char *funcname, int __pyx_clineno, int __pyx_lineno, const char *__pyx_filename); /*proto*/ @@ -458,7 +460,7 @@ static PyObject *__pyx_k_1; static PyObject *__pyx_k_tuple_3; static PyObject *__pyx_k_tuple_4; -/* "sklearn/utils/murmurhash.pyx":23 +/* "sklearn/utils/murmurhash.pyx":18 * * * cpdef unsigned int murmurhash3_32_int_uint(int key, unsigned int seed): # <<<<<<<<<<<<<< @@ -473,7 +475,7 @@ static unsigned int __pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_int_uint __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("murmurhash3_32_int_uint"); - /* "sklearn/utils/murmurhash.pyx":25 + /* "sklearn/utils/murmurhash.pyx":20 * cpdef unsigned int murmurhash3_32_int_uint(int key, unsigned int seed): * cdef unsigned int out * MurmurHash3_x86_32(&key, sizeof(int), seed, &out) # <<<<<<<<<<<<<< @@ -482,7 +484,7 @@ static unsigned int __pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_int_uint */ MurmurHash3_x86_32((&__pyx_v_key), (sizeof(int)), __pyx_v_seed, (&__pyx_v_out)); - /* "sklearn/utils/murmurhash.pyx":26 + /* "sklearn/utils/murmurhash.pyx":21 * cdef unsigned int out * MurmurHash3_x86_32(&key, sizeof(int), seed, &out) * return out # <<<<<<<<<<<<<< @@ -498,7 +500,7 @@ static unsigned int __pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_int_uint return __pyx_r; } -/* "sklearn/utils/murmurhash.pyx":23 +/* "sklearn/utils/murmurhash.pyx":18 * * * cpdef unsigned int murmurhash3_32_int_uint(int key, unsigned int seed): # <<<<<<<<<<<<<< @@ -539,11 +541,11 @@ static PyObject *__pyx_pf_7sklearn_5utils_10murmurhash_murmurhash3_32_int_uint(P values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__seed); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("murmurhash3_32_int_uint", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("murmurhash3_32_int_uint", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "murmurhash3_32_int_uint") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "murmurhash3_32_int_uint") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -551,19 +553,19 @@ static PyObject *__pyx_pf_7sklearn_5utils_10murmurhash_murmurhash3_32_int_uint(P values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } - __pyx_v_key = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_key == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_seed = __Pyx_PyInt_AsUnsignedInt(values[1]); if (unlikely((__pyx_v_seed == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_key = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_key == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_seed = __Pyx_PyInt_AsUnsignedInt(values[1]); if (unlikely((__pyx_v_seed == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("murmurhash3_32_int_uint", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("murmurhash3_32_int_uint", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.utils.murmurhash.murmurhash3_32_int_uint", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_int_uint(__pyx_v_key, __pyx_v_seed, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_int_uint(__pyx_v_key, __pyx_v_seed, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -581,7 +583,7 @@ static PyObject *__pyx_pf_7sklearn_5utils_10murmurhash_murmurhash3_32_int_uint(P return __pyx_r; } -/* "sklearn/utils/murmurhash.pyx":29 +/* "sklearn/utils/murmurhash.pyx":24 * * * cpdef int murmurhash3_32_int_int(int key, unsigned int seed): # <<<<<<<<<<<<<< @@ -596,7 +598,7 @@ static int __pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_int_int(int __pyx __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("murmurhash3_32_int_int"); - /* "sklearn/utils/murmurhash.pyx":31 + /* "sklearn/utils/murmurhash.pyx":26 * cpdef int murmurhash3_32_int_int(int key, unsigned int seed): * cdef int out * MurmurHash3_x86_32(&key, sizeof(int), seed, &out) # <<<<<<<<<<<<<< @@ -605,7 +607,7 @@ static int __pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_int_int(int __pyx */ MurmurHash3_x86_32((&__pyx_v_key), (sizeof(int)), __pyx_v_seed, (&__pyx_v_out)); - /* "sklearn/utils/murmurhash.pyx":32 + /* "sklearn/utils/murmurhash.pyx":27 * cdef int out * MurmurHash3_x86_32(&key, sizeof(int), seed, &out) * return out # <<<<<<<<<<<<<< @@ -621,7 +623,7 @@ static int __pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_int_int(int __pyx return __pyx_r; } -/* "sklearn/utils/murmurhash.pyx":29 +/* "sklearn/utils/murmurhash.pyx":24 * * * cpdef int murmurhash3_32_int_int(int key, unsigned int seed): # <<<<<<<<<<<<<< @@ -662,11 +664,11 @@ static PyObject *__pyx_pf_7sklearn_5utils_10murmurhash_1murmurhash3_32_int_int(P values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__seed); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("murmurhash3_32_int_int", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("murmurhash3_32_int_int", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "murmurhash3_32_int_int") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "murmurhash3_32_int_int") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -674,19 +676,19 @@ static PyObject *__pyx_pf_7sklearn_5utils_10murmurhash_1murmurhash3_32_int_int(P values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } - __pyx_v_key = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_key == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_seed = __Pyx_PyInt_AsUnsignedInt(values[1]); if (unlikely((__pyx_v_seed == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_key = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_key == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_seed = __Pyx_PyInt_AsUnsignedInt(values[1]); if (unlikely((__pyx_v_seed == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("murmurhash3_32_int_int", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("murmurhash3_32_int_int", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.utils.murmurhash.murmurhash3_32_int_int", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(__pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_int_int(__pyx_v_key, __pyx_v_seed, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_int_int(__pyx_v_key, __pyx_v_seed, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -704,7 +706,7 @@ static PyObject *__pyx_pf_7sklearn_5utils_10murmurhash_1murmurhash3_32_int_int(P return __pyx_r; } -/* "sklearn/utils/murmurhash.pyx":35 +/* "sklearn/utils/murmurhash.pyx":30 * * * cpdef unsigned int murmurhash3_32_bytes_uint(bytes key, unsigned int seed): # <<<<<<<<<<<<<< @@ -725,17 +727,17 @@ static unsigned int __pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_bytes_ui int __pyx_clineno = 0; __Pyx_RefNannySetupContext("murmurhash3_32_bytes_uint"); - /* "sklearn/utils/murmurhash.pyx":37 + /* "sklearn/utils/murmurhash.pyx":32 * cpdef unsigned int murmurhash3_32_bytes_uint(bytes key, unsigned int seed): * cdef unsigned int out * cdef char* key_c = key # <<<<<<<<<<<<<< * MurmurHash3_x86_32(key_c, len(key), seed, &out) * return out */ - __pyx_t_1 = PyBytes_AsString(((PyObject *)__pyx_v_key)); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyBytes_AsString(((PyObject *)__pyx_v_key)); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_key_c = __pyx_t_1; - /* "sklearn/utils/murmurhash.pyx":38 + /* "sklearn/utils/murmurhash.pyx":33 * cdef unsigned int out * cdef char* key_c = key * MurmurHash3_x86_32(key_c, len(key), seed, &out) # <<<<<<<<<<<<<< @@ -743,12 +745,12 @@ static unsigned int __pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_bytes_ui * */ if (unlikely(((PyObject *)__pyx_v_key) == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_2 = PyBytes_GET_SIZE(((PyObject *)__pyx_v_key)); MurmurHash3_x86_32(__pyx_v_key_c, __pyx_t_2, __pyx_v_seed, (&__pyx_v_out)); - /* "sklearn/utils/murmurhash.pyx":39 + /* "sklearn/utils/murmurhash.pyx":34 * cdef char* key_c = key * MurmurHash3_x86_32(key_c, len(key), seed, &out) * return out # <<<<<<<<<<<<<< @@ -768,7 +770,7 @@ static unsigned int __pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_bytes_ui return __pyx_r; } -/* "sklearn/utils/murmurhash.pyx":35 +/* "sklearn/utils/murmurhash.pyx":30 * * * cpdef unsigned int murmurhash3_32_bytes_uint(bytes key, unsigned int seed): # <<<<<<<<<<<<<< @@ -809,11 +811,11 @@ static PyObject *__pyx_pf_7sklearn_5utils_10murmurhash_2murmurhash3_32_bytes_uin values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__seed); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("murmurhash3_32_bytes_uint", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("murmurhash3_32_bytes_uint", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "murmurhash3_32_bytes_uint") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "murmurhash3_32_bytes_uint") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -822,19 +824,19 @@ static PyObject *__pyx_pf_7sklearn_5utils_10murmurhash_2murmurhash3_32_bytes_uin values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_key = ((PyObject*)values[0]); - __pyx_v_seed = __Pyx_PyInt_AsUnsignedInt(values[1]); if (unlikely((__pyx_v_seed == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_seed = __Pyx_PyInt_AsUnsignedInt(values[1]); if (unlikely((__pyx_v_seed == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("murmurhash3_32_bytes_uint", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("murmurhash3_32_bytes_uint", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.utils.murmurhash.murmurhash3_32_bytes_uint", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyBytes_Type), 1, "key", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyBytes_Type), 1, "key", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_bytes_uint(__pyx_v_key, __pyx_v_seed, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_bytes_uint(__pyx_v_key, __pyx_v_seed, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -852,7 +854,7 @@ static PyObject *__pyx_pf_7sklearn_5utils_10murmurhash_2murmurhash3_32_bytes_uin return __pyx_r; } -/* "sklearn/utils/murmurhash.pyx":42 +/* "sklearn/utils/murmurhash.pyx":37 * * * cpdef int murmurhash3_32_bytes_int(bytes key, unsigned int seed): # <<<<<<<<<<<<<< @@ -873,17 +875,17 @@ static int __pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_bytes_int(PyObjec int __pyx_clineno = 0; __Pyx_RefNannySetupContext("murmurhash3_32_bytes_int"); - /* "sklearn/utils/murmurhash.pyx":44 + /* "sklearn/utils/murmurhash.pyx":39 * cpdef int murmurhash3_32_bytes_int(bytes key, unsigned int seed): * cdef int out * cdef char* key_c = key # <<<<<<<<<<<<<< * MurmurHash3_x86_32(key_c, len(key), seed, &out) * return out */ - __pyx_t_1 = PyBytes_AsString(((PyObject *)__pyx_v_key)); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyBytes_AsString(((PyObject *)__pyx_v_key)); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_key_c = __pyx_t_1; - /* "sklearn/utils/murmurhash.pyx":45 + /* "sklearn/utils/murmurhash.pyx":40 * cdef int out * cdef char* key_c = key * MurmurHash3_x86_32(key_c, len(key), seed, &out) # <<<<<<<<<<<<<< @@ -891,12 +893,12 @@ static int __pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_bytes_int(PyObjec * */ if (unlikely(((PyObject *)__pyx_v_key) == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_2 = PyBytes_GET_SIZE(((PyObject *)__pyx_v_key)); MurmurHash3_x86_32(__pyx_v_key_c, __pyx_t_2, __pyx_v_seed, (&__pyx_v_out)); - /* "sklearn/utils/murmurhash.pyx":46 + /* "sklearn/utils/murmurhash.pyx":41 * cdef char* key_c = key * MurmurHash3_x86_32(key_c, len(key), seed, &out) * return out # <<<<<<<<<<<<<< @@ -916,7 +918,7 @@ static int __pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_bytes_int(PyObjec return __pyx_r; } -/* "sklearn/utils/murmurhash.pyx":42 +/* "sklearn/utils/murmurhash.pyx":37 * * * cpdef int murmurhash3_32_bytes_int(bytes key, unsigned int seed): # <<<<<<<<<<<<<< @@ -957,11 +959,11 @@ static PyObject *__pyx_pf_7sklearn_5utils_10murmurhash_3murmurhash3_32_bytes_int values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__seed); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("murmurhash3_32_bytes_int", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("murmurhash3_32_bytes_int", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "murmurhash3_32_bytes_int") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "murmurhash3_32_bytes_int") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -970,19 +972,19 @@ static PyObject *__pyx_pf_7sklearn_5utils_10murmurhash_3murmurhash3_32_bytes_int values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_key = ((PyObject*)values[0]); - __pyx_v_seed = __Pyx_PyInt_AsUnsignedInt(values[1]); if (unlikely((__pyx_v_seed == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_seed = __Pyx_PyInt_AsUnsignedInt(values[1]); if (unlikely((__pyx_v_seed == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("murmurhash3_32_bytes_int", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("murmurhash3_32_bytes_int", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.utils.murmurhash.murmurhash3_32_bytes_int", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyBytes_Type), 1, "key", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyBytes_Type), 1, "key", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(__pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_bytes_int(__pyx_v_key, __pyx_v_seed, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_bytes_int(__pyx_v_key, __pyx_v_seed, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -1000,7 +1002,7 @@ static PyObject *__pyx_pf_7sklearn_5utils_10murmurhash_3murmurhash3_32_bytes_int return __pyx_r; } -/* "sklearn/utils/murmurhash.pyx":49 +/* "sklearn/utils/murmurhash.pyx":44 * * * def murmurhash3_32(key, seed=0, positive=False): # <<<<<<<<<<<<<< @@ -1059,7 +1061,7 @@ static PyObject *__pyx_pf_7sklearn_5utils_10murmurhash_4murmurhash3_32(PyObject } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "murmurhash3_32") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "murmurhash3_32") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -1076,14 +1078,14 @@ static PyObject *__pyx_pf_7sklearn_5utils_10murmurhash_4murmurhash3_32(PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("murmurhash3_32", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("murmurhash3_32", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.utils.murmurhash.murmurhash3_32", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - /* "sklearn/utils/murmurhash.pyx":71 + /* "sklearn/utils/murmurhash.pyx":66 * * """ * if isinstance(key, bytes): # <<<<<<<<<<<<<< @@ -1096,17 +1098,17 @@ static PyObject *__pyx_pf_7sklearn_5utils_10murmurhash_4murmurhash3_32(PyObject __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "sklearn/utils/murmurhash.pyx":72 + /* "sklearn/utils/murmurhash.pyx":67 * """ * if isinstance(key, bytes): * if positive: # <<<<<<<<<<<<<< * return murmurhash3_32_bytes_uint(key, seed) * else: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_positive); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_positive); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { - /* "sklearn/utils/murmurhash.pyx":73 + /* "sklearn/utils/murmurhash.pyx":68 * if isinstance(key, bytes): * if positive: * return murmurhash3_32_bytes_uint(key, seed) # <<<<<<<<<<<<<< @@ -1114,11 +1116,11 @@ static PyObject *__pyx_pf_7sklearn_5utils_10murmurhash_4murmurhash3_32(PyObject * return murmurhash3_32_bytes_int(key, seed) */ __Pyx_XDECREF(__pyx_r); - if (!(likely(PyBytes_CheckExact(__pyx_v_key))||((__pyx_v_key) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_v_key)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyBytes_CheckExact(__pyx_v_key))||((__pyx_v_key) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_v_key)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __pyx_v_key; __Pyx_INCREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_seed); if (unlikely((__pyx_t_3 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyLong_FromUnsignedLong(__pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_bytes_uint(((PyObject*)__pyx_t_1), __pyx_t_3, 0)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_seed); if (unlikely((__pyx_t_3 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyLong_FromUnsignedLong(__pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_bytes_uint(((PyObject*)__pyx_t_1), __pyx_t_3, 0)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; @@ -1128,7 +1130,7 @@ static PyObject *__pyx_pf_7sklearn_5utils_10murmurhash_4murmurhash3_32(PyObject } /*else*/ { - /* "sklearn/utils/murmurhash.pyx":75 + /* "sklearn/utils/murmurhash.pyx":70 * return murmurhash3_32_bytes_uint(key, seed) * else: * return murmurhash3_32_bytes_int(key, seed) # <<<<<<<<<<<<<< @@ -1136,11 +1138,11 @@ static PyObject *__pyx_pf_7sklearn_5utils_10murmurhash_4murmurhash3_32(PyObject * if positive: */ __Pyx_XDECREF(__pyx_r); - if (!(likely(PyBytes_CheckExact(__pyx_v_key))||((__pyx_v_key) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_v_key)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyBytes_CheckExact(__pyx_v_key))||((__pyx_v_key) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_v_key)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __pyx_v_key; __Pyx_INCREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_seed); if (unlikely((__pyx_t_3 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyInt_FromLong(__pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_bytes_int(((PyObject*)__pyx_t_4), __pyx_t_3, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_seed); if (unlikely((__pyx_t_3 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_bytes_int(((PyObject*)__pyx_t_4), __pyx_t_3, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_1; @@ -1151,7 +1153,7 @@ static PyObject *__pyx_pf_7sklearn_5utils_10murmurhash_4murmurhash3_32(PyObject goto __pyx_L6; } - /* "sklearn/utils/murmurhash.pyx":76 + /* "sklearn/utils/murmurhash.pyx":71 * else: * return murmurhash3_32_bytes_int(key, seed) * elif isinstance(key, unicode): # <<<<<<<<<<<<<< @@ -1164,17 +1166,17 @@ static PyObject *__pyx_pf_7sklearn_5utils_10murmurhash_4murmurhash3_32(PyObject __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "sklearn/utils/murmurhash.pyx":77 + /* "sklearn/utils/murmurhash.pyx":72 * return murmurhash3_32_bytes_int(key, seed) * elif isinstance(key, unicode): * if positive: # <<<<<<<<<<<<<< * return murmurhash3_32_bytes_uint(key.encode('utf-8'), seed) * else: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_positive); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_positive); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { - /* "sklearn/utils/murmurhash.pyx":78 + /* "sklearn/utils/murmurhash.pyx":73 * elif isinstance(key, unicode): * if positive: * return murmurhash3_32_bytes_uint(key.encode('utf-8'), seed) # <<<<<<<<<<<<<< @@ -1182,14 +1184,14 @@ static PyObject *__pyx_pf_7sklearn_5utils_10murmurhash_4murmurhash3_32(PyObject * return murmurhash3_32_bytes_int(key.encode('utf-8'), seed) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_GetAttr(__pyx_v_key, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_key, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_seed); if (unlikely((__pyx_t_3 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_bytes_uint(((PyObject*)__pyx_t_4), __pyx_t_3, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_seed); if (unlikely((__pyx_t_3 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_bytes_uint(((PyObject*)__pyx_t_4), __pyx_t_3, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_1; @@ -1199,7 +1201,7 @@ static PyObject *__pyx_pf_7sklearn_5utils_10murmurhash_4murmurhash3_32(PyObject } /*else*/ { - /* "sklearn/utils/murmurhash.pyx":80 + /* "sklearn/utils/murmurhash.pyx":75 * return murmurhash3_32_bytes_uint(key.encode('utf-8'), seed) * else: * return murmurhash3_32_bytes_int(key.encode('utf-8'), seed) # <<<<<<<<<<<<<< @@ -1207,14 +1209,14 @@ static PyObject *__pyx_pf_7sklearn_5utils_10murmurhash_4murmurhash3_32(PyObject * if positive: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_GetAttr(__pyx_v_key, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_key, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_seed); if (unlikely((__pyx_t_3 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyInt_FromLong(__pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_bytes_int(((PyObject*)__pyx_t_4), __pyx_t_3, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_seed); if (unlikely((__pyx_t_3 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_bytes_int(((PyObject*)__pyx_t_4), __pyx_t_3, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_1; @@ -1225,7 +1227,7 @@ static PyObject *__pyx_pf_7sklearn_5utils_10murmurhash_4murmurhash3_32(PyObject goto __pyx_L6; } - /* "sklearn/utils/murmurhash.pyx":81 + /* "sklearn/utils/murmurhash.pyx":76 * else: * return murmurhash3_32_bytes_int(key.encode('utf-8'), seed) * elif isinstance(key, int): # <<<<<<<<<<<<<< @@ -1238,17 +1240,17 @@ static PyObject *__pyx_pf_7sklearn_5utils_10murmurhash_4murmurhash3_32(PyObject __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "sklearn/utils/murmurhash.pyx":82 + /* "sklearn/utils/murmurhash.pyx":77 * return murmurhash3_32_bytes_int(key.encode('utf-8'), seed) * elif isinstance(key, int): * if positive: # <<<<<<<<<<<<<< * return murmurhash3_32_int_uint(key, seed) * else: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_positive); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_positive); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { - /* "sklearn/utils/murmurhash.pyx":83 + /* "sklearn/utils/murmurhash.pyx":78 * elif isinstance(key, int): * if positive: * return murmurhash3_32_int_uint(key, seed) # <<<<<<<<<<<<<< @@ -1256,9 +1258,9 @@ static PyObject *__pyx_pf_7sklearn_5utils_10murmurhash_4murmurhash3_32(PyObject * return murmurhash3_32_int_int(key, seed) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_key); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_seed); if (unlikely((__pyx_t_3 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_int_uint(__pyx_t_5, __pyx_t_3, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_key); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_seed); if (unlikely((__pyx_t_3 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_int_uint(__pyx_t_5, __pyx_t_3, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -1267,7 +1269,7 @@ static PyObject *__pyx_pf_7sklearn_5utils_10murmurhash_4murmurhash3_32(PyObject } /*else*/ { - /* "sklearn/utils/murmurhash.pyx":85 + /* "sklearn/utils/murmurhash.pyx":80 * return murmurhash3_32_int_uint(key, seed) * else: * return murmurhash3_32_int_int(key, seed) # <<<<<<<<<<<<<< @@ -1275,9 +1277,9 @@ static PyObject *__pyx_pf_7sklearn_5utils_10murmurhash_4murmurhash3_32(PyObject * raise ValueError( */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_key); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_seed); if (unlikely((__pyx_t_3 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyInt_FromLong(__pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_int_int(__pyx_t_5, __pyx_t_3, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_key); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_seed); if (unlikely((__pyx_t_3 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_int_int(__pyx_t_5, __pyx_t_3, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -1288,12 +1290,12 @@ static PyObject *__pyx_pf_7sklearn_5utils_10murmurhash_4murmurhash3_32(PyObject } /*else*/ { - /* "sklearn/utils/murmurhash.pyx":89 + /* "sklearn/utils/murmurhash.pyx":84 * raise ValueError( * "key %r with type %s is not supported. " * "Explicit conversion to bytes is required" % (key, type(key))) # <<<<<<<<<<<<<< */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_INCREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key); @@ -1301,20 +1303,20 @@ static PyObject *__pyx_pf_7sklearn_5utils_10murmurhash_4murmurhash3_32(PyObject __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_key))); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_TYPE(__pyx_v_key))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_key))); - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4)); __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L6:; @@ -1368,7 +1370,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; @@ -1378,28 +1380,28 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants"); - /* "sklearn/utils/murmurhash.pyx":78 + /* "sklearn/utils/murmurhash.pyx":73 * elif isinstance(key, unicode): * if positive: * return murmurhash3_32_bytes_uint(key.encode('utf-8'), seed) # <<<<<<<<<<<<<< * else: * return murmurhash3_32_bytes_int(key.encode('utf-8'), seed) */ - __pyx_k_tuple_3 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_3 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_3)); __Pyx_INCREF(((PyObject *)__pyx_kp_s_2)); PyTuple_SET_ITEM(__pyx_k_tuple_3, 0, ((PyObject *)__pyx_kp_s_2)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_3)); - /* "sklearn/utils/murmurhash.pyx":80 + /* "sklearn/utils/murmurhash.pyx":75 * return murmurhash3_32_bytes_uint(key.encode('utf-8'), seed) * else: * return murmurhash3_32_bytes_int(key.encode('utf-8'), seed) # <<<<<<<<<<<<<< * elif isinstance(key, int): * if positive: */ - __pyx_k_tuple_4 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_4 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_4)); __Pyx_INCREF(((PyObject *)__pyx_kp_s_2)); PyTuple_SET_ITEM(__pyx_k_tuple_4, 0, ((PyObject *)__pyx_kp_s_2)); @@ -1478,27 +1480,31 @@ PyMODINIT_FUNC PyInit_murmurhash(void) /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ + if (__Pyx_ExportFunction("murmurhash3_32_int_uint", (void (*)(void))__pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_int_uint, "unsigned int (int, unsigned int, int __pyx_skip_dispatch)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_ExportFunction("murmurhash3_32_int_int", (void (*)(void))__pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_int_int, "int (int, unsigned int, int __pyx_skip_dispatch)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_ExportFunction("murmurhash3_32_bytes_uint", (void (*)(void))__pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_bytes_uint, "unsigned int (PyObject *, unsigned int, int __pyx_skip_dispatch)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_ExportFunction("murmurhash3_32_bytes_int", (void (*)(void))__pyx_f_7sklearn_5utils_10murmurhash_murmurhash3_32_bytes_int, "int (PyObject *, unsigned int, int __pyx_skip_dispatch)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Type init code ---*/ /*--- Type import code ---*/ /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ - /* "sklearn/utils/murmurhash.pyx":49 + /* "sklearn/utils/murmurhash.pyx":44 * * * def murmurhash3_32(key, seed=0, positive=False): # <<<<<<<<<<<<<< * """Compute the 32bit murmurhash3_32 of key at seed. * */ - __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_k_1 = __pyx_t_1; __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7sklearn_5utils_10murmurhash_4murmurhash3_32, NULL, __pyx_n_s_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7sklearn_5utils_10murmurhash_4murmurhash3_32, NULL, __pyx_n_s_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__murmurhash3_32, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__murmurhash3_32, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "sklearn/utils/murmurhash.pyx":1 @@ -2298,6 +2304,43 @@ static int __Pyx_check_binary_version(void) { return 0; } +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + + d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); + if (!d) { + PyErr_Clear(); + d = PyDict_New(); + if (!d) + goto bad; + Py_INCREF(d); + if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) + goto bad; + } + tmp.fp = f; +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + cobj = PyCapsule_New(tmp.p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItemString(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + #include "compile.h" #include "frameobject.h" #include "traceback.h" diff --git a/sklearn/utils/murmurhash.pxd b/sklearn/utils/murmurhash.pxd new file mode 100644 index 0000000000000000000000000000000000000000..9817abbc260d7264064ee4c459a40199bbcaabbd --- /dev/null +++ b/sklearn/utils/murmurhash.pxd @@ -0,0 +1,15 @@ +cdef extern from "MurmurHash3.h": + void MurmurHash3_x86_32(void* key, int len, unsigned int seed, + void* out) + + +cpdef unsigned int murmurhash3_32_int_uint(int key, unsigned int seed) + + +cpdef int murmurhash3_32_int_int(int key, unsigned int seed) + + +cpdef unsigned int murmurhash3_32_bytes_uint(bytes key, unsigned int seed) + + +cpdef int murmurhash3_32_bytes_int(bytes key, unsigned int seed) diff --git a/sklearn/utils/murmurhash.pyx b/sklearn/utils/murmurhash.pyx index 5558f84fafc375061d0de552009febe74679382e..20db04c2f5676dda70963773a41f31615b7a4cf4 100644 --- a/sklearn/utils/murmurhash.pyx +++ b/sklearn/utils/murmurhash.pyx @@ -15,11 +15,6 @@ and can be found here: # License: BSD Style. -cdef extern from "MurmurHash3.h": - void MurmurHash3_x86_32(void* key, int len, unsigned int seed, - void* out) - - cpdef unsigned int murmurhash3_32_int_uint(int key, unsigned int seed): cdef unsigned int out MurmurHash3_x86_32(&key, sizeof(int), seed, &out)