code: def create_batch_df(dataset: torch.Tensor):
      batch_id_ls = []
      indices_ls = []
      for batch_id, b_indices in enumerate(dataset):
          if isinstance(b_indices, dict):
              b_indices = torch.cat(list(b_indices.values()))
          batch_id_ar = cp.full(
              shape=len(b_indices), fill_value=batch_id, dtype=cp.int32
          )
          batch_id_ls.append(batch_id_ar)
          indices_ls.append(b_indices)
  
      batch_id_ar = cp.concatenate(batch_id_ls)
      indices_ar = cp.asarray(torch.concat(indices_ls))
      batches_df = cudf.DataFrame(
          {
              "start": indices_ar,
              "batch_id": batch_id_ar,
          }
      )
      return batches_df
  
file_path: cugraph/python/cugraph-dgl/cugraph_dgl/dataloading/dataloader.py
imports: from __future__ import annotations
  import os
  import shutil
  import cugraph_dgl
  import cupy
  import cudf
  from cugraph.utilities.utils import import_optional
  from cugraph.gnn import BulkSampler
  from dask.distributed import default_client, Event
  from cugraph_dgl.dataloading import HomogenousBulkSamplerDataset, HeterogenousBulkSamplerDataset
  from cugraph_dgl.dataloading.utils.extract_graph_helpers import create_cugraph_graph_from_edges_dict
label_desc: Use image node_id 2 for calling a global function with example usage: create_batch_df(dataset) and returns: batches_df