'Reads the contents of a Matrix Market file-like \'source\' into a matrix.
Parameters
source : str or file-like
Matrix Market filename (extensions .mtx, .mtz.gz)
or open file object.
Returns
a : ndarray or coo_matrix
Dense or sparse matrix depending on the matrix format in the
Matrix Market file.'

def read(self, source):

    (stream, close_it) = self._open(source)
    try:
        self._parse_header(stream)
        return self._parse_body(stream)
    finally:
        if close_it:
            stream.close()
