code: def _csrtodok(csr):
      """Converts a CSR representation to DOK representation.
  
      Examples
      ========
  
      >>> from sympy.matrices.sparsetools import _csrtodok
      >>> _csrtodok([[5, 8, 3, 6], [0, 1, 2, 1], [0, 0, 2, 3, 4], [4, 3]])
      Matrix([
      [0, 0, 0],
      [5, 8, 0],
      [0, 0, 3],
      [0, 6, 0]])
  
      """
      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)
  
file_path: sympy/sympy/matrices/sparsetools.py
imports: from sympy.core.containers import Dict
  from sympy.core.symbol import Dummy
  from sympy.utilities.iterables import is_sequence
  from sympy.utilities.misc import as_int, filldedent
  from .sparse import MutableSparseMatrix
label_desc: Use image node_id 2 for calling a global function with example usage: _csrtodok(csr) and returns: SparseMatrix