def _assert_ABCD_consistent(A, B, C, D):
    _assert_AB_consistent(A, B)
    assert (len(C.shape) == 2)
    assert (len(D.shape) == 2)
    assert (C.shape[1] == A.shape[0])
    assert (C.shape[0] == D.shape[0])
    assert (D.shape[1] == B.shape[1])
def _assert_ABCD_consistent(A, B, C, D):
    _assert_AB_consistent(A, B)
    assert (len(C.shape) == 2)
    assert (len(D.shape) == 2)
    assert (C.shape[1] == A.shape[0])
    assert (C.shape[0] == D.shape[0])
    assert (D.shape[1] == B.shape[1])