<commit_before>typedef struct {
    PyObject_HEAD
    PyObject *it;
    Py_ssize_t times;
    PyObject *fillvalue;
    int truncate;

    PyObject *result;
} recipes_grouper_object;


static PyObject *
recipes_grouper_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
    static char *kwargs[] = {"iterable", "n", "fillvalue", "truncate", NULL};
    PyObject *iterable;
    Py_ssize_t times;
    PyObject *fillvalue = NULL;
    int truncate = 0;

    PyObject *it;
    PyObject *result = NULL;

    recipes_grouper_object *lz;

    if (!PyArg_ParseTupleAndKeywords(args, kwds, "On|Oi:grouper", kwargs,
                                     &iterable, &times, &fillvalue, &truncate)) {
        return NULL;
    }

    if (fillvalue != NULL && truncate != 0) {
        PyErr_Format(PyExc_TypeError,
                     "only one of `truncate` and `fillvalue` can be set.");
        return NULL;
    }

    if (times <= 0) {
        PyErr_Format(PyExc_ValueError,
                     "times must be greater than 0.");
        return NULL;
    }

    it = PyObject_GetIter(iterable);
    if (it == NULL) {
        return NULL;
    }

    /* create recipes_grouper_object structure */
    lz = (recipes_grouper_object *)type->tp_alloc(type, 0);
    if (lz == NULL) {
        Py_DECREF(it);
        return NULL;
    }

    lz->it = it;
    lz->times = times;
    Py_XINCREF(fillvalue);  // no idea why this is important!!!
    lz->fillvalue = fillvalue;
    lz->truncate = truncate;
    lz->result = result;

    return (PyObject *)lz;
}<commit_msg>edited one error message<commit_after>typedef struct {
    PyObject_HEAD
    PyObject *it;
    Py_ssize_t times;
    PyObject *fillvalue;
    int truncate;

    PyObject *result;
} recipes_grouper_object;


static PyObject *
recipes_grouper_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
    static char *kwargs[] = {"iterable", "n", "fillvalue", "truncate", NULL};
    PyObject *iterable;
    Py_ssize_t times;
    PyObject *fillvalue = NULL;
    int truncate = 0;

    PyObject *it;
    PyObject *result = NULL;

    recipes_grouper_object *lz;

    if (!PyArg_ParseTupleAndKeywords(args, kwds, "On|Oi:grouper", kwargs,
                                     &iterable, &times, &fillvalue, &truncate)) {
        return NULL;
    }

    if (fillvalue != NULL && truncate != 0) {
        PyErr_Format(PyExc_TypeError,
                     "wither `truncate` or `fillvalue` can be set.");
        return NULL;
    }

    if (times <= 0) {
        PyErr_Format(PyExc_ValueError,
                     "times must be greater than 0.");
        return NULL;
    }

    it = PyObject_GetIter(iterable);
    if (it == NULL) {
        return NULL;
    }

    /* create recipes_grouper_object structure */
    lz = (recipes_grouper_object *)type->tp_alloc(type, 0);
    if (lz == NULL) {
        Py_DECREF(it);
        return NULL;
    }

    lz->it = it;
    lz->times = times;
    Py_XINCREF(fillvalue);  // no idea why this is important!!!
    lz->fillvalue = fillvalue;
    lz->truncate = truncate;
    lz->result = result;

    return (PyObject *)lz;
}
{'fraction_non_alphanumeric': 0.11836603409456417, 'fraction_numerical': 0.0032164683177870698, 'mean_word_length': 2.336909871244635, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '775192', 'n_tokens_mistral': 1068, 'n_tokens_neox': 1049, 'n_words': 255}