code: def verify_node_partitionids(
      node_partids,
      part_g,
      g,
      gpb,
      graph_schema,
      orig_nids,
      partition_id,
  ):
      """Verify partitioned graph objects node counts with the original graph
  
      Parameters:
      -----------
      params : argparser object
          to access command line arguments for this python script
      part_data : list of tuples
          partitioned graph objects read from the disk
      g : DGL Graph object
          created by reading the original graph from disk
      graph_schema : json object
          created by reading the metadata.json file for the original graph
      orig_nids : dictionary
          which contains the origial(global) node-ids
      partition_id : integer
          partition id of the partitioned graph, part_g
      """
      # read part graphs and verify the counts
      # inner node masks, should give the node counts in each part-g and get the corresponding orig-ids to map to the original graph node-ids
      for ntype_id, ntype in enumerate(
          graph_schema[constants.STR_NODE_TYPE]
      ):
          mask = _get_inner_node_mask(part_g, g.get_ntype_id(ntype))
  
          # map these to orig-nids.
          inner_nids = part_g.ndata[dgl.NID][mask]
          ntype_ids, inner_type_nids = gpb.map_to_per_ntype(inner_nids)
          partid = gpb.nid2partid(inner_type_nids, ntype)
  
          assert np.all(ntype_ids.numpy() == ntype_id)
          assert np.all(partid.numpy() == gpb.partid)
  
          idxes = orig_nids[ntype][inner_type_nids]
          assert np.all(idxes >= 0)
  
          # get the partition-ids for these nodes.
          assert np.all(
              node_partids[ntype][idxes] == partition_id
          ), f"All the nodes in the partition = {partid} does not their nodeid to partition-id maps are defined by the partitioning algorithm. Node-type = {ntype}"
  
file_path: dgl/tools/verification_utils.py
imports: import json
  import os
  import constants
  import dgl
  import numpy
  import pyarrow
  import pyarrow.parquet
  import pytest
  import torch
  from dgl.data.utils import load_tensors
  from dgl.distributed.partition import _etype_str_to_tuple, _etype_tuple_to_str, _get_inner_edge_mask, _get_inner_node_mask, RESERVED_FIELD_DTYPE
  from distpartitioning.utils import get_idranges
label_desc: Use image node_id 7 for calling a global function with example usage: verify_node_partitionids(node_partids, part_g, g, gpb, graph_schema, orig_nids, partition_id) without return types