<commit_before>static PyObject *
reduce_first(PyObject *self, PyObject *args, PyObject *kwds)
{
    PyObject *sequence, *iterator;
    PyObject *defaultitem = NULL, *func = NULL;
    PyObject *item = NULL, *val = NULL;
    long ok;

    static char *kwlist[] = {"iterable", "default", "pred", NULL};

    if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|OO:first", kwlist,
                                     &sequence, &defaultitem, &func)) {
        return NULL;
    }

    iterator = PyObject_GetIter(sequence);
    if (iterator == NULL) {
        return NULL;
    }

    // Iterate over the sequence
    while (( item = PyIter_Next(iterator) )) {

        // Sequence contains an element and func is None: return it.
        if (func == NULL) {
            Py_DECREF(iterator);
            return item;

        } else if (func == Py_None || func == (PyObject *)&PyBool_Type) {
            ok = PyObject_IsTrue(item);

        } else {
            val = PyObject_CallFunctionObjArgs(func, item, NULL);
            if (val == NULL) {
                Py_DECREF(iterator);
                return NULL;
            }
            ok = PyObject_IsTrue(val);
            Py_DECREF(val);
        }

        if (ok == 1) {
            Py_DECREF(iterator);
            return item;

        } else if (ok < 0) {<commit_msg>fix last commit again<commit_after>static PyObject *
reduce_first(PyObject *self, PyObject *args, PyObject *kwds)
{
    PyObject *sequence, *iterator;
    PyObject *defaultitem = NULL, *func = NULL;
    PyObject *item = NULL, *val = NULL;
    long ok;

    static char *kwlist[] = {"iterable", "default", "pred", NULL};

    if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|OO:first", kwlist,
                                     &sequence, &defaultitem, &func)) {
        return NULL;
    }

    iterator = PyObject_GetIter(sequence);
    if (iterator == NULL) {
        return NULL;
    }

    // Iterate over the sequence
    while (( item = PyIter_Next(iterator) )) {

        // Sequence contains an element and func is None: return it.
        if (func == NULL) {
            Py_DECREF(iterator);
            return item;

        } else if (func == Py_None || func == (PyObject *)&PyBool_Type) {
            ok = PyObject_IsTrue(item);

        } else {
            val = PyObject_CallFunctionObjArgs(func, item, NULL);
            if (val == NULL) {
                Py_DECREF(iterator);
                Py_DECREF(item);
                return NULL;
            }
            ok = PyObject_IsTrue(val);
            Py_DECREF(val);
        }

        if (ok == 1) {
            Py_DECREF(iterator);
            return item;

        } else if (ok < 0) {
{'fraction_non_alphanumeric': 0.11925233644859813, 'fraction_numerical': 0.0014953271028037382, 'mean_word_length': 1.8138801261829653, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '1262453', 'n_tokens_mistral': 786, 'n_tokens_neox': 789, 'n_words': 210}