<commit_before>cdef struct Point:
    double x
    double y
    int color

def test_constructor(x, y, color):
    """
    >>> sorted(test_constructor(1,2,255).items())
    [('color', 255), ('x', 1.0), ('y', 2.0)]
    >>> try: test_constructor(1,None,255)
    ... except TypeError: pass
    """
    cdef Point p = Point(x, y, color)
    return p


def return_constructor(x, y, color):
    """
    >>> sorted(return_constructor(1,2,255).items())
    [('color', 255), ('x', 1.0), ('y', 2.0)]
    >>> try: return_constructor(1, None, 255)
    ... except TypeError: pass
    """
    return Point(x, y, color)


def test_constructor_kwds(x, y, color):
    """
    >>> sorted(test_constructor_kwds(1.25, 2.5, 128).items())
    [('color', 128), ('x', 1.25), ('y', 2.5)]
    >>> test_constructor_kwds(1.25, 2.5, None)
    Traceback (most recent call last):
    ...
    TypeError: an integer is required
    """
    cdef Point p = Point(x=x, y=y, color=color)
    return p


def return_constructor_kwds(x, y, color):
    """
    >>> sorted(return_constructor_kwds(1.25, 2.5, 128).items())
    [('color', 128), ('x', 1.25), ('y', 2.5)]
    >>> return_constructor_kwds(1.25, 2.5, None)
    Traceback (most recent call last):<commit_msg>extend "struct_conversion" test with some more type conversions<commit_after>cdef struct Point:
    double x
    double y
    int color

def test_constructor(x, y, int color):
    """
    >>> sorted(test_constructor(1,2,255).items())
    [('color', 255), ('x', 1.0), ('y', 2.0)]
    >>> try: test_constructor(1,None,255)
    ... except TypeError: pass
    """
    cdef Point p = Point(x, y, color)
    return p


def return_constructor(x, y, int color):
    """
    >>> sorted(return_constructor(1,2,255).items())
    [('color', 255), ('x', 1.0), ('y', 2.0)]
    >>> try: return_constructor(1, None, 255)
    ... except TypeError: pass
    """
    return Point(x, y, color)


def test_constructor_kwds(x, y, color):
    """
    >>> sorted(test_constructor_kwds(1.25, 2.5, 128).items())
    [('color', 128), ('x', 1.25), ('y', 2.5)]
    >>> test_constructor_kwds(1.25, 2.5, None)
    Traceback (most recent call last):
    ...
    TypeError: an integer is required
    """
    cdef Point p = Point(x=x, y=y, color=color)
    return p


def return_constructor_kwds(double x, y, color):
    """
    >>> sorted(return_constructor_kwds(1.25, 2.5, 128).items())
    [('color', 128), ('x', 1.25), ('y', 2.5)]
    >>> return_constructor_kwds(1.25, 2.5, None)
    Traceback (most recent call last):
{'fraction_non_alphanumeric': 0.19976124154397135, 'fraction_numerical': 0.05889375248706725, 'mean_word_length': 3.1553719008264465, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 51, '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': '5754473', 'n_tokens_mistral': 1007, 'n_tokens_neox': 908, 'n_words': 229}