def __eq__(self, other):
        try:
            if self.shape != other.shape:
                return False
            if isinstance(other, Matrix):
                return self._mat == other._mat
            elif isinstance(other, MatrixBase):
                return self._mat == Matrix(other)._mat
        except __HOLE__:
            return False
dataset/ETHPy150Open sympy/sympy/sympy/matrices/dense.py/DenseMatrix.__eq__