code: def test_index_select(
      create_func, shape, dense_dim, select_dim, index
  ):
      ctx = F.ctx()
      A = create_func(shape, 20, ctx, dense_dim)
      index = torch.tensor(index).to(ctx)
      A_select = A.index_select(select_dim, index)
  
      dense = sparse_matrix_to_dense(A)
      dense_select = torch.index_select(dense, select_dim, index)
  
      A_select_to_dense = sparse_matrix_to_dense(A_select)
  
      assert A_select_to_dense.shape == dense_select.shape
      assert torch.allclose(A_select_to_dense, dense_select)
  
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 17 for calling a global function with example usage: test_index_select(create_func, shape, dense_dim, select_dim, index) without return types