def _csrtodok(csr):
 smat = {}
 (A, JA, IA, shape) = csr
 for i in range((len(IA) - 1)):
  indices = slice(IA[i], IA[(i + 1)])
  for (l, m) in zip(A[indices], JA[indices]):
   smat[(i, m)] = l
 return SparseMatrix(*(shape + [smat]))

def _csrtodok ( csr ) : smat = { } ( A , JA , IA , shape ) = csr for i in range ( ( len ( IA ) - 1 ) ) : indices = slice ( IA [ i ] , IA [ ( i + 1 ) ] ) for ( l , m ) in zip ( A [ indices ] , JA [ indices ] ) : smat [ ( i , m ) ] = l return SparseMatrix ( * ( shape + [ smat ] ) )
converts a csr representation to dok representation .