#NEWLINE# def read( self , source ) : #NEWLINE# #INDENT# "\n        Reads the contents of a Matrix Market file-like 'source' into a matrix.\n\n        Parameters\n        ----------\n        source : str or file-like\n            Matrix Market filename (extensions .mtx, .mtz.gz)\n            or open file object.\n\n        Returns\n        -------\n        a : ndarray or coo_matrix\n            Dense or sparse matrix depending on the matrix format in the\n            Matrix Market file.\n        " #NEWLINE# ( stream , close_it ) = self . _open ( source ) #NEWLINE# try : #NEWLINE# #INDENT# self . _parse_header ( stream ) #NEWLINE# return self . _parse_body ( stream ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# if close_it : #NEWLINE# #INDENT# stream . close ( )