code: def _get_orig_ids(g, sim_g, orig_nids, orig_eids):
      """Convert/construct the original node IDs and edge IDs.
  
      It handles multiple cases:
       * If the graph has been reshuffled and it's a homogeneous graph, we just return
         the original node IDs and edge IDs in the inputs.
       * If the graph has been reshuffled and it's a heterogeneous graph, we need to
         split the original node IDs and edge IDs in the inputs based on the node types
         and edge types.
       * If the graph is not shuffled, the original node IDs and edge IDs don't change.
  
      Parameters
      ----------
      g : DGLGraph
         The input graph for partitioning.
      sim_g : DGLGraph
          The homogeneous version of the input graph.
      orig_nids : tensor or None
          The original node IDs after the input graph is reshuffled.
      orig_eids : tensor or None
          The original edge IDs after the input graph is reshuffled.
  
      Returns
      -------
      tensor or dict of tensors, tensor or dict of tensors
      """
      is_hetero = not g.is_homogeneous
      if is_hetero:
          # Get the type IDs
          orig_ntype = F.gather_row(sim_g.ndata[NTYPE], orig_nids)
          orig_etype = F.gather_row(sim_g.edata[ETYPE], orig_eids)
          # Mapping between shuffled global IDs to original per-type IDs
          orig_nids = F.gather_row(sim_g.ndata[NID], orig_nids)
          orig_eids = F.gather_row(sim_g.edata[EID], orig_eids)
          orig_nids = {
              ntype: F.boolean_mask(
                  orig_nids, orig_ntype == g.get_ntype_id(ntype)
              )
              for ntype in g.ntypes
          }
          orig_eids = {
              etype: F.boolean_mask(
                  orig_eids, orig_etype == g.get_etype_id(etype)
              )
              for etype in g.canonical_etypes
          }
      return orig_nids, orig_eids
  
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 11 for calling a global function with example usage: _get_orig_ids(g, sim_g, orig_nids, orig_eids) and returns: orig_nids,  orig_eids