'Return self*other where other is either a scalar or a matrix
of compatible dimensions.
Examples
>>> from sympy.matrices import Matrix
>>> A = Matrix([[1, 2, 3], [4, 5, 6]])
>>> 2*A == A*2 == Matrix([[2, 4, 6], [8, 10, 12]])
True
>>> B = Matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
>>> A*B
Matrix([
[30, 36, 42],
[66, 81, 96]])
>>> B*A
Traceback (most recent call last):
ShapeError: Matrices size mismatch.
See Also
matrix_multiply_elementwise'

@call_highest_priority('__rmul__')
def __mul__(self, other):

    other = _matrixify(other)
    if (hasattr(other, 'shape') and (len(other.shape) == 2)):
        if (self.shape[1] != other.shape[0]):
            raise ShapeError(('Matrix    size    mismatch:    %s    *    %s.' % (self.shape, other.shape)))
    if getattr(other, 'is_Matrix', False):
        return self._eval_matrix_mul(other)
    if getattr(other, 'is_MatrixLike', False):
        return MatrixArithmetic._eval_matrix_mul(self, other)
    try:
        return self._eval_scalar_mul(other)
    except TypeError:
        pass
    raise TypeError(('Cannot    multiply    %s    and    %s' % (type(self), type(other))))
