code: def _sampler_output_from_sampling_results_homogeneous_csr(
      major_offsets: torch.Tensor,
      minors: torch.Tensor,
      renumber_map: torch.Tensor,
      graph_store: CuGraphStore,
      label_hop_offsets: torch.Tensor,
      batch_id: int,
      metadata: Sequence = None,
  ) -> HeteroSamplerOutput:
      """
      Parameters
      ----------
      major_offsets: torch.Tensor
          The major offsets for the CSC/CSR matrix ("row pointer")
      minors: torch.Tensor
          The minors for the CSC/CSR matrix ("col index")
      renumber_map: torch.Tensor
          The tensor containing the renumber map.
          Required.
      graph_store: CuGraphStore
          The graph store containing the structure of the sampled graph.
      label_hop_offsets: torch.Tensor
          The tensor containing the label-hop offsets.
      batch_id: int
          The current batch id, whose samples are being retrieved
          from the sampling results and data index.
      metadata: Tensor
          The metadata for the sampled batch.
  
      Returns
      -------
      HeteroSamplerOutput
      """
  
      if (
          len(graph_store.edge_types) > 1
          or len(graph_store.node_types) > 1
      ):
          raise ValueError("Graph is heterogeneous")
  
      if renumber_map is None:
          raise ValueError(
              "Renumbered input is expected for homogeneous graphs"
          )
      node_type = graph_store.node_types[0]
      edge_type = graph_store.edge_types[0]
  
      major_offsets = major_offsets.clone() - major_offsets[0]
      label_hop_offsets = (
          label_hop_offsets.clone() - label_hop_offsets[0]
      )
  
      num_edges_per_hop_dict = {
          edge_type: major_offsets[label_hop_offsets].diff().cpu()
      }
  
      label_hop_offsets = label_hop_offsets.cpu()
      num_nodes_per_hop_dict = {
          node_type: torch.concat(
              [
                  label_hop_offsets.diff(),
                  (
                      renumber_map.shape[0] - label_hop_offsets[-1]
                  ).reshape((1,)),
              ]
          ).cpu()
      }
  
      noi_index = {
          node_type: torch.as_tensor(renumber_map, device="cuda")
      }
  
      col_dict = {
          edge_type: major_offsets,
      }
  
      row_dict = {
          edge_type: minors,
      }
  
      if HeteroSamplerOutput is None:
          raise ImportError("Error importing from pyg")
  
      return HeteroSamplerOutput(
          node=noi_index,
          row=row_dict,
          col=col_dict,
          edge=None,
          num_sampled_nodes=num_nodes_per_hop_dict,
          num_sampled_edges=num_edges_per_hop_dict,
          metadata=metadata,
      )
  
file_path: cugraph/python/cugraph-pyg/cugraph_pyg/sampler/cugraph_sampler.py
imports: from typing import Sequence, Dict, Tuple
  from cugraph_pyg.data import CuGraphStore
  from cugraph.utilities.utils import import_optional
  import cudf
label_desc: Use image node_id 3 for calling a global function with example usage: _sampler_output_from_sampling_results_homogeneous_csr(major_offsets, minors, renumber_map, graph_store, label_hop_offsets, batch_id, metadata) and returns: HeteroSamplerOutput