def assert_qubo_equal(qubo1, qubo2):
    """ Assert the given QUBOs are identical.
    
    Args:
        qubo1 (dict[(label, label), float]): QUBO to be compared.
        
        qubo2 (dict[(label, label), float]): QUBO to be compared.
    """
    msg = 'QUBO should be an dict instance.'
    assert isinstance(qubo1, dict), msg
    assert isinstance(qubo2, dict), msg
    assert len(qubo1) == len(qubo2
        ), "Number of elements in QUBO doesn't match."
    for (label1, label2), value in qubo1.items():
        if (label1, label2) in qubo2:
            if qubo2[label1, label2] != value:
                assert qubo2[label1, label2
                    ] == value, "Value of {key} doesn't match".format(key=(
                    label1, label2))
        elif (label2, label1) in qubo2:
            if qubo2[label2, label1] != value:
                assert qubo2[label2, label1
                    ] == value, "Value of {key} doesn't match".format(key=(
                    label2, label1))
        else:
            raise AssertionError("Key: {key} of qubo1 isn't contained in qubo2"
                .format(key=(label1, label2)))
