code: def disassemble_sparse_matrix(matrix: scipy.sparse.spmatrix) -> dict:
      
      fmt = matrix.getformat()
      if fmt not in ("csr", "csc", "coo"):
          raise ValueError("Unsupported scipy.sparse matrix format: %s." % fmt)
      result = {
          "shape": matrix.shape,
          "format": fmt
      }
      if isinstance(matrix, (scipy.sparse.csr_matrix, scipy.sparse.csc_matrix)):
          lengths = numpy.concatenate(([0], numpy.diff(matrix.indptr)))
          result["data"] = matrix.data, squeeze_bits(matrix.indices), squeeze_bits(lengths)
      elif isinstance(matrix, scipy.sparse.coo_matrix):
          result["data"] = matrix.data, (squeeze_bits(matrix.row), squeeze_bits(matrix.col))
      return result
docs: Transform a scipy.sparse matrix into the serializable collection of \
      :class:`numpy.ndarray`-s. :func:`assemble_sparse_matrix()` does the inverse.
  
      :param matrix: :mod:`scipy.sparse` matrix; csr, csc and coo formats are \
                     supported.
      :return: :class:`dict` with "shape", "format" and "data" - :class:`tuple` \
               of :class:`numpy.ndarray`.