code: def test_homogeneous_sampled_graphs_from_dataframe(
      return_type, seed_node
  ):
      g = dgl.graph(([0, 1, 2, 3, 4], [1, 2, 3, 4, 5]))
      fanout = [1, 1, 1]
      seed_node = torch.as_tensor([seed_node])
  
      dgl_seed_nodes, dgl_output_nodes, dgl_mfgs = create_dgl_mfgs(
          g, seed_node, fanout
      )
      (
          cugraph_seed_nodes,
          cugraph_output_nodes,
          cugraph_mfgs,
      ) = create_cugraph_dgl_homogenous_mfgs(
          dgl_mfgs, return_type=return_type
      )
  
      np.testing.assert_equal(
          cugraph_seed_nodes.cpu().numpy().copy().sort(),
          dgl_seed_nodes.cpu().numpy().copy().sort(),
      )
  
      np.testing.assert_equal(
          dgl_output_nodes.cpu().numpy().copy().sort(),
          cugraph_output_nodes.cpu().numpy().copy().sort(),
      )
  
      if return_type == "dgl.Block":
          for dgl_block, cugraph_dgl_block in zip(
              dgl_mfgs, cugraph_mfgs
          ):
              dgl_df = get_edge_df_from_homogenous_block(dgl_block)
              cugraph_dgl_df = get_edge_df_from_homogenous_block(
                  cugraph_dgl_block
              )
              pd.testing.assert_frame_equal(dgl_df, cugraph_dgl_df)
      else:
          for dgl_block, cugraph_dgl_graph in zip(
              dgl_mfgs, cugraph_mfgs
          ):
              # Can not verify edge ids as they are not
              # preserved in cugraph_dgl.nn.SparseGraph
              assert (
                  dgl_block.num_src_nodes()
                  == cugraph_dgl_graph.num_src_nodes()
              )
              assert (
                  dgl_block.num_dst_nodes()
                  == cugraph_dgl_graph.num_dst_nodes()
              )
              dgl_offsets, dgl_indices, _ = dgl_block.adj_tensors("csc")
              (
                  cugraph_offsets,
                  cugraph_indices,
                  _,
              ) = cugraph_dgl_graph.csc()
              assert torch.equal(
                  dgl_offsets.to("cpu"), cugraph_offsets.to("cpu")
              )
              assert torch.equal(
                  dgl_indices.to("cpu"), cugraph_indices.to("cpu")
              )
  
file_path: cugraph/python/cugraph-dgl/tests/test_dataset.py
imports: import pytest
  from dgl.dataloading import MultiLayerNeighborSampler
  import dgl
  import torch
  import cudf
  import pandas
  import cupy
  import numpy
  from cugraph_dgl.dataloading.utils.sampling_helpers import create_homogeneous_sampled_graphs_from_dataframe
label_desc: Use image node_id 4 for calling a global function with example usage: test_homogeneous_sampled_graphs_from_dataframe(return_type, seed_node) without return types