code: def test_to_cugraph(edge_weight, directed, relabel_nodes):
      import cugraph
  
      if directed:
          edge_index = torch.tensor([[0, 1, 1, 2], [1, 0, 2, 1]])
      else:
          edge_index = torch.tensor([[0, 1], [1, 2]])
  
      if edge_weight is not None:
          edge_weight = edge_weight[: edge_index.size(1)]
  
      graph = to_cugraph(
          edge_index, edge_weight, relabel_nodes, directed
      )
      assert isinstance(graph, cugraph.Graph)
      assert graph.number_of_nodes() == 3
  
      edge_list = graph.view_edge_list()
      assert edge_list is not None
  
      edge_list = edge_list.sort_values(by=[0, 1])
  
      cu_edge_index = edge_list[[0, 1]].to_pandas().values
      cu_edge_index = torch.from_numpy(cu_edge_index).t()
      cu_edge_weight = None
      if edge_weight is not None:
          cu_edge_weight = edge_list["2"].to_pandas().values
          cu_edge_weight = torch.from_numpy(cu_edge_weight)
  
      cu_edge_index, cu_edge_weight = sort_edge_index(
          cu_edge_index, cu_edge_weight
      )
  
      assert torch.equal(edge_index, cu_edge_index.cpu())
      if edge_weight is not None:
          assert torch.allclose(edge_weight, cu_edge_weight.cpu())
  
imports: import pytest
  import scipy.sparse
  import torch
  from torch_geometric.data import Data, HeteroData
  from torch_geometric.testing import get_random_edge_index, withPackage
  from torch_geometric.utils import from_cugraph, from_dgl, from_networkit, from_networkx, from_scipy_sparse_matrix, from_trimesh, sort_edge_index, subgraph, to_cugraph, to_dgl, to_networkit, to_networkx, to_scipy_sparse_matrix, to_trimesh
label_desc: Use image node_id 24 for calling a global function with example usage: test_to_cugraph(edge_weight, directed, relabel_nodes) without return types