code: def _process_sampled_df_csc(
      df: cudf.DataFrame,
      reverse_hop_id: bool = True,
  ) -> Tuple[
      Dict[int, Dict[int, Dict[str, torch.Tensor]]],
      List[torch.Tensor],
      List[List[int, int]],
  ]:
      """
      Convert a dataframe generated by BulkSampler to a dictionary of tensors, to
      facilitate MFG creation. The sampled graphs in the dataframe use CSC-format.
  
      Parameters
      ----------
      df: cudf.DataFrame
          The output from BulkSampler compressed in CSC format. The dataframe
          should be generated with `compression="CSR"` in BulkSampler,
          since the sampling routine treats seed nodes as sources.
  
      reverse_hop_id: bool (default=True)
          Reverse hop id.
  
      Returns
      -------
      tensors_dict: dict
          A nested dictionary keyed by batch id and hop id.
          `tensor_dict[batch_id][hop_id]` holds "minors" and "major_offsets"
          values for CSC MFGs.
  
      renumber_map_list: list
          List of renumbering maps for looking up global indices of nodes. One
          map for each batch.
  
      mfg_sizes: list
          List of the number of nodes in each message passing layer. For the
          k-th hop, mfg_sizes[k] and mfg_sizes[k+1] is the number of sources and
          destinations, respectively.
      """
      # dropna
      major_offsets = cast_to_tensor(df.major_offsets.dropna())
      label_hop_offsets = cast_to_tensor(df.label_hop_offsets.dropna())
      renumber_map_offsets = cast_to_tensor(
          df.renumber_map_offsets.dropna()
      )
      renumber_map = cast_to_tensor(df.map.dropna())
      minors = cast_to_tensor(df.minors.dropna())
  
      n_batches = len(renumber_map_offsets) - 1
      n_hops = int((len(label_hop_offsets) - 1) / n_batches)
  
      # make global offsets local
      # Have to make a clone as pytorch does not allow
      # in-place operations on tensors
      major_offsets -= major_offsets[0].clone()
      label_hop_offsets -= label_hop_offsets[0].clone()
      renumber_map_offsets -= renumber_map_offsets[0].clone()
  
      # get the sizes of each adjacency matrix (for MFGs)
      mfg_sizes = (
          label_hop_offsets[1:] - label_hop_offsets[:-1]
      ).reshape((n_batches, n_hops))
      n_nodes = renumber_map_offsets[1:] - renumber_map_offsets[:-1]
      mfg_sizes = torch.hstack(
          (mfg_sizes, n_nodes.reshape(n_batches, -1))
      )
      if reverse_hop_id:
          mfg_sizes = mfg_sizes.flip(1)
  
      tensors_dict = {}
      renumber_map_list = []
      # Note: minors and major_offsets from BulkSampler are of type int32
      # and int64 respectively. Since pylibcugraphops binding code doesn't
      # support distinct node and edge index type, we simply casting both
      # to int32 for now.
      minors = minors.int()
      major_offsets = major_offsets.int()
      # Note: We transfer tensors to CPU here to avoid the overhead of
      # transferring them in each iteration of the for loop below.
      major_offsets_cpu = major_offsets.to("cpu").numpy()
      label_hop_offsets_cpu = label_hop_offsets.to("cpu").numpy()
  
      for batch_id in range(n_batches):
          batch_dict = {}
          for hop_id in range(n_hops):
              hop_dict = {}
              idx = (
                  batch_id * n_hops + hop_id
              )  # idx in label_hop_offsets
              major_offsets_start = label_hop_offsets_cpu[idx]
              major_offsets_end = label_hop_offsets_cpu[idx + 1]
              minors_start = major_offsets_cpu[major_offsets_start]
              minors_end = major_offsets_cpu[major_offsets_end]
              hop_dict["minors"] = minors[minors_start:minors_end]
              hop_dict["major_offsets"] = (
                  major_offsets[
                      major_offsets_start : major_offsets_end + 1
                  ]
                  - major_offsets[major_offsets_start]
              )
              if reverse_hop_id:
                  batch_dict[n_hops - 1 - hop_id] = hop_dict
              else:
                  batch_dict[hop_id] = hop_dict
  
          tensors_dict[batch_id] = batch_dict
  
          renumber_map_list.append(
              renumber_map[
                  renumber_map_offsets[batch_id] : renumber_map_offsets[
                      batch_id + 1
                  ]
              ],
          )
  
      return tensors_dict, renumber_map_list, mfg_sizes.tolist()
  
imports: from __future__ import annotations
  from typing import List, Tuple, Dict, Optional
  from collections import defaultdict
  import cudf
  from cugraph.utilities.utils import import_optional
  from cugraph_dgl.nn import SparseGraph
label_desc: Use image node_id 15 for calling a global function with example usage: _process_sampled_df_csc(df, reverse_hop_id) and returns: tensors_dict,  renumber_map_list,  mfg_sizes