def can_multiply(matrix1, matrix2):
    """Checks to see if two Matrix objects can be multiplied by ensuring that
    their dimensions are compatible.

    :param Matrix matrix1: the first matrix.
    :param Matrix matrix2: the second matrix.
    :rtype: ``bool``"""
    return matrix1.size()[1] == matrix2.size()[0]
