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()

    # -------------------------------------------------------------------------
Reads the contents of a Matrix Market file-like 'source' into a matrix.
dataset/ETHPy150Open scipy/scipy/scipy/io/mmio.py/MMFile.read