<commit_before>"""
Tests for dit.multivariate.secret_key_agreement.two_part_intrinsic_mutual_information
"""

import pytest

from dit.example_dists.intrinsic import intrinsic_1, intrinsic_2, intrinsic_3
from dit.multivariate.secret_key_agreement import (
    two_part_intrinsic_total_correlation,
    two_part_intrinsic_dual_total_correlation,
    two_part_intrinsic_CAEKL_mutual_information
)


@pytest.mark.parametrize('dist', [intrinsic_1, intrinsic_2, intrinsic_3])
def test_tpitc1(dist):
    """
    """
    tpitc = two_part_intrinsic_total_correlation(dist, [[0], [1]], [2])
    assert tpitc == pytest.approx(dist.secret_rate)


@pytest.mark.parametrize('dist', [intrinsic_1, intrinsic_2, intrinsic_3])
def test_tpidtc1(dist):
    """
    """
    tpidtc = two_part_intrinsic_dual_total_correlation(dist, [[0], [1]], [2])
    assert tpidtc == pytest.approx(dist.secret_rate)


@pytest.mark.parametrize('dist', [intrinsic_1, intrinsic_2, intrinsic_3])
def test_tpicaekl1(dist):
    """
    """
    tpicaekl = two_part_intrinsic_CAEKL_mutual_information(dist, [[0], [1]], [2])
    assert tpicaekl == pytest.approx(dist.secret_rate)<commit_msg>faster tests<commit_after>"""
Tests for dit.multivariate.secret_key_agreement.two_part_intrinsic_mutual_information
"""

import pytest

from dit.example_dists import giant_bit, n_mod_m
from dit.multivariate.secret_key_agreement import (
    two_part_intrinsic_total_correlation,
    two_part_intrinsic_dual_total_correlation,
    two_part_intrinsic_CAEKL_mutual_information
)


@pytest.mark.parametrize(['dist', 'value'], [
    (giant_bit(3, 2), 0.0),
    (n_mod_m(3, 2), 0.0)
])
def test_tpitc1(dist, value):
    """
    """
    tpitc = two_part_intrinsic_total_correlation(dist, [[0], [1]], [2])
    assert tpitc == pytest.approx(value)


@pytest.mark.parametrize(['dist', 'value'], [
    (giant_bit(3, 2), 0.0),
    (n_mod_m(3, 2), 0.0)
])
def test_tpidtc1(dist, value):
    """
    """
    tpidtc = two_part_intrinsic_dual_total_correlation(dist, [[0], [1]], [2])
    assert tpidtc == pytest.approx(value)


@pytest.mark.parametrize(['dist', 'value'], [
    (giant_bit(3, 2), 0.0),
    (n_mod_m(3, 2), 0.0)
])
def test_tpicaekl1(dist, value):
    """
    """
    tpicaekl = two_part_intrinsic_CAEKL_mutual_information(dist, [[0], [1]], [2])
    assert tpicaekl == pytest.approx(value)
{'fraction_non_alphanumeric': 0.14652956298200515, 'fraction_numerical': 0.02570694087403599, 'mean_word_length': 5.3108108108108105, 'pattern_counts': {'":': 0, '<': 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': '5632895', 'n_tokens_mistral': 946, 'n_tokens_neox': 904, 'n_words': 134}