<commit_before># distutils: language = c++

import numpy as np
cimport numpy as np
import cython

from libcpp.vector cimport vector
from libc.math cimport sqrt, pow

cdef extern from "stdlib.h" nogil:
    ctypedef unsigned long size_t
    void free(void *ptr)
    void *malloc(size_t size)

ctypedef float[:,:] float2d
ctypedef double[:,:] double2d

ctypedef fused Streamline:
    float2d
    double2d

ctypedef vector[Streamline] Streamlines

cdef extern from *:
    void __PYX_XDEC_MEMVIEW(float2d* memslice, int have_gil)
    void __PYX_XDEC_MEMVIEW(double2d* memslice, int have_gil)


cdef void XDEC_vector_of_memview(Streamlines streamlines) nogil:
    # Cython automatically convert list of numpy array into vector of memoryviews but
    # we need to decrease ref count manually if not there will be memory leaks
    # (see https://groups.google.com/d/topic/cython-users/KF3nkHll89M/discussion).
    cdef int i
    with gil:
        for i in range(streamlines.size()):
            __PYX_XDEC_MEMVIEW(&streamlines[i], 1)

@cython.wraparound(False)<commit_msg>Fixed typos<commit_after># distutils: language = c++

import numpy as np
cimport numpy as np
import cython

from libcpp.vector cimport vector
from libc.math cimport sqrt, pow

cdef extern from "stdlib.h" nogil:
    ctypedef unsigned long size_t
    void free(void *ptr)
    void *malloc(size_t size)

ctypedef float[:,:] float2d
ctypedef double[:,:] double2d

ctypedef fused Streamline:
    float2d
    double2d

ctypedef vector[Streamline] Streamlines

cdef extern from *:
    void __PYX_XDEC_MEMVIEW(float2d* memslice, int have_gil)
    void __PYX_XDEC_MEMVIEW(double2d* memslice, int have_gil)


cdef void XDEC_vector_of_memview(Streamlines streamlines) nogil:
    # Cython can convert a list of numpy array into a vector of memoryviews but
    # we need to decrease ref count manually, otherwise there will be memory leaks
    # (see https://groups.google.com/d/topic/cython-users/KF3nkHll89M/discussion).
    cdef int i
    with gil:
        for i in range(streamlines.size()):
            __PYX_XDEC_MEMVIEW(&streamlines[i], 1)

@cython.wraparound(False)
{'fraction_non_alphanumeric': 0.07674199623352165, 'fraction_numerical': 0.009416195856873822, 'mean_word_length': 4.071599045346062, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '4131027', 'n_tokens_mistral': 745, 'n_tokens_neox': 713, 'n_words': 221}