code: def test_csc_to_coo(dense_dim, indptr, indices, shape):
      ctx = F.ctx()
      val_shape = (len(indices),)
      if dense_dim is not None:
          val_shape += (dense_dim,)
      val = torch.randn(val_shape).to(ctx)
      indptr = torch.tensor(indptr).to(ctx)
      indices = torch.tensor(indices).to(ctx)
      mat = from_csc(indptr, indices, val, shape)
  
      if shape is None:
          shape = (torch.max(indices).item() + 1, indptr.numel() - 1)
  
      col = (
          torch.arange(0, indptr.shape[0] - 1)
          .to(ctx)
          .repeat_interleave(torch.diff(indptr))
      )
      row = indices
      mat_row, mat_col = mat.coo()
      mat_val = mat.val
  
      assert mat.shape == shape
      assert mat.nnz == row.numel()
      assert mat.device == row.device
      assert mat.dtype == val.dtype
      assert torch.allclose(mat_val, val)
      assert torch.allclose(mat_row, row)
      assert torch.allclose(mat_col, col)
  
imports: import unittest
  import warnings
  import backend
  import pytest
  import torch
  from dgl.sparse import diag, from_coo, from_csc, from_csr, from_torch_sparse, identity, to_torch_sparse_coo, to_torch_sparse_csc, to_torch_sparse_csr, val_like
  from .utils import rand_coo, rand_csc, rand_csr, rand_diag, sparse_matrix_to_dense
label_desc: Use image node_id 7 for calling a global function with example usage: test_csc_to_coo(dense_dim, indptr, indices, shape) without return types