<commit_before>from ppb_vector import Vector2
from math import isclose
import pytest  # type: ignore
from hypothesis import assume, given, note
from utils import angle_isclose, vectors


@pytest.mark.parametrize("left, right, expected", [
    (Vector2(1, 1), Vector2(0, -1), -135),
    (Vector2(1, 1), Vector2(-1, 0), 135),
    (Vector2(0, 1), Vector2(0, -1), 180),
    (Vector2(-1, -1), Vector2(1, 0), 135),
    (Vector2(-1, -1), Vector2(-1, 0), -45),
    (Vector2(1, 0), Vector2(0, 1), 90),
    (Vector2(1, 0), Vector2(1, 0), 0),
])
def test_angle(left, right, expected):
    lr = left.angle(right)
    rl = right.angle(left)
    assert -180 < lr <= 180
    assert -180 < rl <= 180
    assert isclose(lr, expected)
    assert isclose(rl, 180 if expected == 180 else -expected)


@given(
    left=vectors(),
    right=vectors(),
)
def test_angle_prop(left, right):
    lr = left.angle(right)
    rl = right.angle(left)
    assert -180 < lr <= 180
    assert -180 < rl <= 180
    assert angle_isclose(lr, -rl)<commit_msg>Rename test_angle_prop to test_angle_range<commit_after>from ppb_vector import Vector2
from math import isclose
import pytest  # type: ignore
from hypothesis import assume, given, note
from utils import angle_isclose, vectors


@pytest.mark.parametrize("left, right, expected", [
    (Vector2(1, 1), Vector2(0, -1), -135),
    (Vector2(1, 1), Vector2(-1, 0), 135),
    (Vector2(0, 1), Vector2(0, -1), 180),
    (Vector2(-1, -1), Vector2(1, 0), 135),
    (Vector2(-1, -1), Vector2(-1, 0), -45),
    (Vector2(1, 0), Vector2(0, 1), 90),
    (Vector2(1, 0), Vector2(1, 0), 0),
])
def test_angle(left, right, expected):
    lr = left.angle(right)
    rl = right.angle(left)
    assert -180 < lr <= 180
    assert -180 < rl <= 180
    assert isclose(lr, expected)
    assert isclose(rl, 180 if expected == 180 else -expected)


@given(
    left=vectors(),
    right=vectors(),
)
def test_angle_range(left, right):
    lr = left.angle(right)
    rl = right.angle(left)
    assert -180 < lr <= 180
    assert -180 < rl <= 180
    assert angle_isclose(lr, -rl)
{'fraction_non_alphanumeric': 0.16602316602316602, 'fraction_numerical': 0.08687258687258688, 'mean_word_length': 3.4294871794871793, 'pattern_counts': {'":': 0, '<': 19, '<?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': '1655326', 'n_tokens_mistral': 881, 'n_tokens_neox': 765, 'n_words': 220}