code: def test_get_tensor_d_from_sampled_df():
      df = get_dummy_sampled_df()
      tensor_d = _get_tensor_d_from_sampled_df(df)
  
      expected_maps = {}
      expected_maps[0] = torch.as_tensor(
          [10, 11, 12], dtype=torch.int64, device="cuda"
      )
      expected_maps[1] = torch.as_tensor(
          [13, 14, 15], dtype=torch.int64, device="cuda"
      )
      expected_maps[2] = torch.as_tensor(
          [16, 17, 18], dtype=torch.int64, device="cuda"
      )
  
      for batch_id, batch_td in tensor_d.items():
          batch_df = df[df["batch_id"] == batch_id]
          for hop_id, hop_t in batch_td.items():
              if hop_id != "map":
                  hop_df = batch_df[batch_df["hop_id"] == hop_id]
                  assert torch.equal(
                      hop_t["sources"],
                      cast_to_tensor(hop_df["sources"]),
                  )
                  assert torch.equal(
                      hop_t["destinations"],
                      cast_to_tensor(hop_df["destinations"]),
                  )
  
          assert torch.equal(batch_td["map"], expected_maps[batch_id])
  
file_path: cugraph/python/cugraph-dgl/tests/test_utils.py
imports: import cudf
  import cupy
  import numpy
  from cugraph_dgl.dataloading.utils.sampling_helpers import cast_to_tensor, _get_renumber_map, _split_tensor, _get_tensor_d_from_sampled_df, create_homogeneous_sampled_graphs_from_dataframe, _get_source_destination_range, _create_homogeneous_cugraph_dgl_nn_sparse_graph, create_homogeneous_sampled_graphs_from_dataframe_csc
  from cugraph.utilities.utils import import_optional
label_desc: Use image node_id 5 for calling a global function with example usage: test_get_tensor_d_from_sampled_df() without return types