def tocoo(self,copy=True):
M,N = self.shape<EOL>R,C = self.blocksize<EOL>indptr_diff = np.diff(self.indptr)<EOL>if indptr_diff.dtype.itemsize > np.dtype(np.intp).itemsize:<EOL><INDENT>indptr_diff_limited = indptr_diff.astype(np.intp)<EOL>if np.any(indptr_diff_limited != indptr_diff):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>indptr_diff = indptr_diff_limited<EOL><DEDENT>row = (R * np.arange(M//R)).repeat(indptr_diff)<EOL>row = row.repeat(R*C).reshape(-<NUM_LIT:1>,R,C)<EOL>row += np.tile(np.arange(R).reshape(-<NUM_LIT:1>,<NUM_LIT:1>), (<NUM_LIT:1>,C))<EOL>row = row.reshape(-<NUM_LIT:1>)<EOL>col = (C * self.indices).repeat(R*C).reshape(-<NUM_LIT:1>,R,C)<EOL>col += np.tile(np.arange(C), (R,<NUM_LIT:1>))<EOL>col = col.reshape(-<NUM_LIT:1>)<EOL>data = self.data.reshape(-<NUM_LIT:1>)<EOL>if copy:<EOL><INDENT>data = data.copy()<EOL><DEDENT>from .coo import coo_matrix<EOL>return coo_matrix((data,(row,col)), shape=self.shape)<EOL>
Convert this matrix to COOrdinate format.

        When copy=False the data array will be shared between
        this matrix and the resultant coo_matrix.