code: def create_cugraph_dgl_homogenous_mfgs(dgl_blocks, return_type):
      df_ls = []
      unique_vertices_ls = []
      for hop_id, block in enumerate(reversed(dgl_blocks)):
          block = block.to("cpu")
          src, dst, eid = block.edges("all")
          eid = block.edata[dgl.EID][eid]
  
          og_src = block.srcdata[dgl.NID][src]
          og_dst = block.dstdata[dgl.NID][dst]
          unique_vertices = pd.concat(
              [pd.Series(og_dst.numpy()), pd.Series(og_src.numpy())]
          ).drop_duplicates(keep="first")
          unique_vertices_ls.append(unique_vertices)
          df = cudf.DataFrame(
              {
                  "sources": cp.asarray(src),
                  "destinations": cp.asarray(dst),
                  "edge_id": cp.asarray(eid),
              }
          )
          df["hop_id"] = hop_id
          df_ls.append(df)
      df = cudf.concat(df_ls, ignore_index=True)
      df["batch_id"] = 0
  
      # Add map column
      # to the dataframe
      renumberd_map = (
          pd.concat(unique_vertices_ls)
          .drop_duplicates(keep="first")
          .values
      )
      offsets = np.asarray([2, 2 + len(renumberd_map)])
      map_ar = np.concatenate([offsets, renumberd_map])
      map_ser = cudf.Series(map_ar)
      # Have to reindex cause map_ser can be of larger length than df
      df = df.reindex(df.index.union(map_ser.index))
      df["map"] = map_ser
      return create_homogeneous_sampled_graphs_from_dataframe(
          df, return_type=return_type
      )[0]
  
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 3 for calling a global function with example usage: create_cugraph_dgl_homogenous_mfgs(dgl_blocks, return_type) and returns: create_homogeneous_sampled_graphs_from_dataframe