<commit_before>"""
Cython source code: trace_object_boundary
"""
import cython

import numpy as np
cimport numpy as np

from libcpp.vector cimport vector


cdef extern from "trace_boundary_cpp.h":
    cdef cppclass trace_boundary_cpp:
        trace_boundary_cpp() except +
        void rot90(int, int, vector[vector[int]] input,
                   vector[vector[int]] &output)
        vector[vector[vector[int]]] trace_boundary(vector[vector[int]] label, int)
        vector[vector[int]] isbf(int, int, vector[vector[int]] mask, int, int, float)
        vector[vector[int]] moore(int, int, vector[vector[int]] mask, int, int, float)


def trace_object_boundary(np.ndarray[int, ndim=2, mode="c"] imLabel not None, connectivity):

    cdef trace_boundary_cpp res
    res = trace_boundary_cpp()
    cdef vector[vector[vector[int]]] output

    output = res.trace_boundary(imLabel, connectivity)

    return output<commit_msg>Fixed argument number issue on trace_object_boundary.pyx<commit_after>"""
Cython source code: trace_object_boundary
"""
import cython

import numpy as np
cimport numpy as np

from libcpp.vector cimport vector


cdef extern from "trace_boundary_cpp.h":
    cdef cppclass trace_boundary_cpp:
        trace_boundary_cpp() except +
        void rot90(int, int, vector[vector[int]] input,
                   vector[vector[int]] &output)
        vector[vector[vector[int]]] trace_boundary(vector[vector[int]] label, int)
        vector[vector[int]] isbf(int, int, vector[vector[int]] mask, int, int, float)
        vector[vector[int]] moore(int, int, vector[vector[int]] mask, int, int, float)


def trace_object_boundary(np.ndarray[int, ndim=2, mode="c"] imLabel not None, connectivity=4):

    cdef trace_boundary_cpp res
    res = trace_boundary_cpp()
    cdef vector[vector[vector[int]]] output

    output = res.trace_boundary(imLabel, connectivity)

    return output
{'fraction_non_alphanumeric': 0.11011116993118052, 'fraction_numerical': 0.0037056643726839597, 'mean_word_length': 4.294117647058823, 'pattern_counts': {'":': 2, '<': 3, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2272163', 'n_tokens_mistral': 619, 'n_tokens_neox': 580, 'n_words': 156}