

def test_is_valid_joint_degree():
    ' Tests for conditions that invalidate a joint degree dict '
    joint_degrees = {
        1: {
            4: 1,
        },
        2: {
            2: 2,
            3: 2,
            4: 2,
        },
        3: {
            2: 2,
            4: 1,
        },
        4: {
            1: 1,
            2: 2,
            3: 1,
        },
    }
    assert_true(is_valid_joint_degree(joint_degrees))
    joint_degrees_1 = {
        1: {
            4: 1.5,
        },
        2: {
            2: 2,
            3: 2,
            4: 2,
        },
        3: {
            2: 2,
            4: 1,
        },
        4: {
            1: 1.5,
            2: 2,
            3: 1,
        },
    }
    assert_false(is_valid_joint_degree(joint_degrees_1))
    joint_degrees_2 = {
        1: {
            4: 1,
        },
        2: {
            2: 2,
            3: 2,
            4: 3,
        },
        3: {
            2: 2,
            4: 1,
        },
        4: {
            1: 1,
            2: 3,
            3: 1,
        },
    }
    assert_false(is_valid_joint_degree(joint_degrees))
    joint_degrees_3 = {
        1: {
            4: 2,
        },
        2: {
            2: 2,
            3: 2,
            4: 2,
        },
        3: {
            2: 2,
            4: 1,
        },
        4: {
            1: 2,
            2: 2,
            3: 1,
        },
    }
    assert_false(is_valid_joint_degree(joint_degrees_3))
    joint_degrees_5 = {
        1: {
            1: 9,
        },
    }
    assert_false(is_valid_joint_degree(joint_degrees_5))

dataset/ETHPy150Open networkx/networkx/networkx/generators/tests/test_joint_degree_seq.py test_is_valid_joint_degree/VarMisuse@268/330 `joint_degrees_2`->`joint_degrees`