<commit_before>#include <Python.h>
#define NPY_NO_DEPRECATED_API NPY_1_11_API_VERSION
#include <numpy/arrayobject.h>

#define error_converting(x) (((x) == -1) && PyErr_Occurred())

#if PY_MAJOR_VERSION >= 3
#define PyString_FromString PyBytes_FromString
#define PyInt_FromLong PyLong_FromLong
#define PyInt_AsLong PyLong_AsLong
#endif


/* docstrings ------------------------------------------------------------- */

static char module_docstring[] =
    "Bottleneck functions that reduce the input array along a specified axis.";

static char nansum_docstring[] =
    "Sum of array elements along given axis treating NaNs as zero.";


/* python strings -------------------------------------------------------- */

PyObject *pystr_arr = NULL;
PyObject *pystr_axis = NULL;
PyObject *pystr_ddof = NULL;

static int
intern_strings(void) {
    pystr_arr = PyString_FromString("arr");
    pystr_axis = PyString_FromString("axis");
    pystr_ddof = PyString_FromString("ddof");
    return pystr_arr && pystr_axis && pystr_ddof;
}

/* function pointers ----------------------------------------------------- */

typedef PyObject *(*fall_ss_t)(char *, npy_intp, npy_intp);
typedef PyObject *(*fall_t)(PyObject *, Py_ssize_t, Py_ssize_t);
typedef PyObject *(*fone_t)(PyObject *, Py_ssize_t, Py_ssize_t, int,
                            npy_intp*);
typedef PyObject *(*f0d_t)(PyArrayObject *);


/* prototypes ------------------------------------------------------------ */

static PyObject *
nansum(PyObject *self, PyObject *args, PyObject *kwds);

static PyObject *
nansum_all_ss_float64(char *p, npy_intp stride, npy_intp length);
static PyObject *
nansum_all_ss_float32(char *p, npy_intp stride, npy_intp length);
static PyObject *
nansum_all_ss_int64(char *p, npy_intp stride, npy_intp length);
static PyObject *<commit_msg>fix py3 compat bugs in reduce2.c<commit_after>#include <Python.h>
#define NPY_NO_DEPRECATED_API NPY_1_11_API_VERSION
#include <numpy/arrayobject.h>

#define error_converting(x) (((x) == -1) && PyErr_Occurred())

#if PY_MAJOR_VERSION >= 3
#define PyString_FromString PyBytes_FromString
#define PyInt_FromLong PyLong_FromLong
#define PyInt_AsLong PyLong_AsLong
#define PyString_InternFromString PyUnicode_InternFromString
#endif


/* docstrings ------------------------------------------------------------- */

static char module_docstring[] =
    "Bottleneck functions that reduce the input array along a specified axis.";

static char nansum_docstring[] =
    "Sum of array elements along given axis treating NaNs as zero.";


/* python strings -------------------------------------------------------- */

PyObject *pystr_arr = NULL;
PyObject *pystr_axis = NULL;
PyObject *pystr_ddof = NULL;

static int
intern_strings(void) {
    pystr_arr = PyString_InternFromString("arr");
    pystr_axis = PyString_InternFromString("axis");
    pystr_ddof = PyString_InternFromString("ddof");
    return pystr_arr && pystr_axis && pystr_ddof;
}

/* function pointers ----------------------------------------------------- */

typedef PyObject *(*fall_ss_t)(char *, npy_intp, npy_intp);
typedef PyObject *(*fall_t)(PyObject *, Py_ssize_t, Py_ssize_t);
typedef PyObject *(*fone_t)(PyObject *, Py_ssize_t, Py_ssize_t, int,
                            npy_intp*);
typedef PyObject *(*f0d_t)(PyArrayObject *);


/* prototypes ------------------------------------------------------------ */

static PyObject *
nansum(PyObject *self, PyObject *args, PyObject *kwds);

static PyObject *
nansum_all_ss_float64(char *p, npy_intp stride, npy_intp length);
static PyObject *
nansum_all_ss_float32(char *p, npy_intp stride, npy_intp length);
static PyObject *
nansum_all_ss_int64(char *p, npy_intp stride, npy_intp length);
static PyObject *
{'fraction_non_alphanumeric': 0.2170418006430868, 'fraction_numerical': 0.006966773847802787, 'mean_word_length': 2.8326488706365502, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5298113', 'n_tokens_mistral': 1214, 'n_tokens_neox': 1172, 'n_words': 278}