docstr: 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.
docstr_tok: ["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","."]
code: def read(self, source):
      """
      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.
      """
      stream, close_it = self._open(source)
  
      try:
          self._parse_header(stream)
          return self._parse_body(stream)
  
      finally:
          if close_it:
              stream.close()
  
imports: from __future__ import division, print_function, absolute_import
  import os
  import sys
  from numpy import asarray, real, imag, conj, zeros, ndarray, concatenate, ones, can_cast
  from numpy.compat import asbytes, asstr
  from scipy._lib.six import string_types
  from scipy.sparse import coo_matrix, isspmatrix
label_desc: Use image node_id 18 for calling the MMFile obj's underlying member method code with example usage: obj.read(source) and returns: self