code: def _get_part_ranges(id_ranges):
      res = {}
      for key in id_ranges:
          # Normally, each element has two values that represent the starting ID and the ending ID
          # of the ID range in a partition.
          # If not, the data is probably still in the old format, in which only the ending ID is
          # stored. We need to convert it to the format we expect.
          if not isinstance(id_ranges[key][0], list):
              start = 0
              for i, end in enumerate(id_ranges[key]):
                  id_ranges[key][i] = [start, end]
                  start = end
          res[key] = np.concatenate(
              [np.array(l) for l in id_ranges[key]]
          ).reshape(-1, 2)
      return res
  
imports: import json
  import logging
  import os
  import time
  import numpy
  import torch
  from ..None import backend
  from ..base import DGLError, EID, ETYPE, NID, NTYPE
  from ..convert import to_homogeneous
  from ..data.utils import load_graphs, load_tensors, save_graphs, save_tensors
  from ..partition import get_peak_mem, metis_partition_assignment, partition_graph_with_halo
  from ..random import choice
  from ..transforms import sort_csc_by_tag, sort_csr_by_tag
  from .constants import DEFAULT_ETYPE, DEFAULT_NTYPE
  from .graph_partition_book import _etype_str_to_tuple, _etype_tuple_to_str, RangePartitionBook
label_desc: Use image node_id 7 for calling a global function with example usage: _get_part_ranges(id_ranges) and returns: res