code: def _get_renumber_map(df):
      map = df["map"]
      df.drop(columns=["map"], inplace=True)
  
      map_starting_offset = map.iloc[0]
      renumber_map = (
          map[map_starting_offset:].dropna().reset_index(drop=True)
      )
      renumber_map_batch_indices = map[
          1 : map_starting_offset - 1
      ].reset_index(drop=True)
      renumber_map_batch_indices = (
          renumber_map_batch_indices - map_starting_offset
      )
  
      map_end_offset = map_starting_offset + len(renumber_map)
      # We only need to drop rows if the length of dataframe is determined by the map
      # that is if map_length > sampled edges length
      if map_end_offset == len(df):
          df.dropna(axis=0, how="all", inplace=True)
          df.reset_index(drop=True, inplace=True)
  
      return (
          df,
          cast_to_tensor(renumber_map),
          cast_to_tensor(renumber_map_batch_indices),
      )
  
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 5 for calling a global function with example usage: _get_renumber_map(df) and returns: df,  cast_to_tensor,  cast_to_tensor