<commit_before># mode: run
# tag: METH_FASTCALL

from collections import deque


def deque_methods(v):
    """
    >>> deque_methods(2)
    [1, 2, 3, 4]
    """
    d = deque([1, 3, 4])
    assert list(d) == [1,3,4]
    d.insert(1, v)
    assert list(d) == [1,2,3,4]
    d.rotate(len(d) // 2)
    assert list(d) == [3,4,1,2]
    d.rotate(len(d) // 2)
    assert list(d) == [1,2,3,4]

    return list(d)<commit_msg>extend fastcall tests with more Python calls that use METH_FASTCALL in Py3.6+<commit_after># mode: run
# tag: METH_FASTCALL

import struct
from collections import deque


def deque_methods(v):
    """
    >>> deque_methods(2)
    [1, 2, 3, 4]
    """
    d = deque([1, 3, 4])
    assert list(d) == [1,3,4]
    d.insert(1, v)
    assert list(d) == [1,2,3,4]
    d.rotate(len(d) // 2)
    assert list(d) == [3,4,1,2]
    d.rotate(len(d) // 2)
    assert list(d) == [1,2,3,4]

    return list(d)


def struct_methods(v):
    """
    >>> i, lf = struct_methods(2)
    >>> struct.unpack('i', i)
    (2,)
    >>> struct.unpack('lf', lf)
    (2, 4.0)
    """
    return [
        struct.pack('i', v),
        struct.pack('lf', v, v*2),
    ]
{'fraction_non_alphanumeric': 0.20644599303135888, 'fraction_numerical': 0.05226480836236934, 'mean_word_length': 2.5245398773006134, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 18, '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': '3912783', 'n_tokens_mistral': 523, 'n_tokens_neox': 498, 'n_words': 110}