code: def load_partition(part_config, part_id, load_feats=True):
      """Load data of a partition from the data path.
  
      A partition data includes a graph structure of the partition, a dict of node tensors,
      a dict of edge tensors and some metadata. The partition may contain the HALO nodes,
      which are the nodes replicated from other partitions. However, the dict of node tensors
      only contains the node data that belongs to the local partition. Similarly, edge tensors
      only contains the edge data that belongs to the local partition. The metadata include
      the information of the global graph (not the local partition), which includes the number
      of nodes, the number of edges as well as the node assignment of the global graph.
  
      The function currently loads data through the local filesystem interface.
  
      Parameters
      ----------
      part_config : str
          The path of the partition config file.
      part_id : int
          The partition ID.
      load_feats : bool, optional
          Whether to load node/edge feats. If False, the returned node/edge feature
          dictionaries will be empty. Default: True.
  
      Returns
      -------
      DGLGraph
          The graph partition structure.
      Dict[str, Tensor]
          Node features.
      Dict[(str, str, str), Tensor]
          Edge features.
      GraphPartitionBook
          The graph partition information.
      str
          The graph name
      List[str]
          The node types
      List[(str, str, str)]
          The edge types
      """
      config_path = os.path.dirname(part_config)
      relative_to_config = lambda path: os.path.join(config_path, path)
  
      with open(part_config) as conf_f:
          part_metadata = json.load(conf_f)
      assert (
          "part-{}".format(part_id) in part_metadata
      ), "part-{} does not exist".format(part_id)
      part_files = part_metadata["part-{}".format(part_id)]
      assert (
          "part_graph" in part_files
      ), "the partition does not contain graph structure."
      partition_path = relative_to_config(part_files["part_graph"])
      logging.info(
          "Start to load partition from %s which is "
          "%d bytes. It may take non-trivial "
          "time for large partition.",
          partition_path,
          os.path.getsize(partition_path),
      )
      graph = load_graphs(partition_path)[0][0]
      logging.info("Finished loading partition.")
  
      assert (
          NID in graph.ndata
      ), "the partition graph should contain node mapping to global node ID"
      assert (
          EID in graph.edata
      ), "the partition graph should contain edge mapping to global edge ID"
  
      gpb, graph_name, ntypes, etypes = load_partition_book(
          part_config, part_id
      )
      ntypes_list = list(ntypes.keys())
      etypes_list = list(etypes.keys())
      if "DGL_DIST_DEBUG" in os.environ:
          for ntype in ntypes:
              ntype_id = ntypes[ntype]
              # graph.ndata[NID] are global homogeneous node IDs.
              nids = F.boolean_mask(
                  graph.ndata[NID],
                  _get_inner_node_mask(graph, ntype_id),
              )
              partids1 = gpb.nid2partid(nids)
              _, per_type_nids = gpb.map_to_per_ntype(nids)
              partids2 = gpb.nid2partid(per_type_nids, ntype)
              assert np.all(F.asnumpy(partids1 == part_id)), (
                  "Unexpected partition IDs are found in the loaded partition "
                  "while querying via global homogeneous node IDs."
              )
              assert np.all(F.asnumpy(partids2 == part_id)), (
                  "Unexpected partition IDs are found in the loaded partition "
                  "while querying via type-wise node IDs."
              )
          for etype in etypes:
              etype_id = etypes[etype]
              # graph.edata[EID] are global homogeneous edge IDs.
              eids = F.boolean_mask(
                  graph.edata[EID],
                  _get_inner_edge_mask(graph, etype_id),
              )
              partids1 = gpb.eid2partid(eids)
              _, per_type_eids = gpb.map_to_per_etype(eids)
              partids2 = gpb.eid2partid(per_type_eids, etype)
              assert np.all(F.asnumpy(partids1 == part_id)), (
                  "Unexpected partition IDs are found in the loaded partition "
                  "while querying via global homogeneous edge IDs."
              )
              assert np.all(F.asnumpy(partids2 == part_id)), (
                  "Unexpected partition IDs are found in the loaded partition "
                  "while querying via type-wise edge IDs."
              )
  
      node_feats = {}
      edge_feats = {}
      if load_feats:
          node_feats, edge_feats = load_partition_feats(
              part_config, part_id
          )
  
      return (
          graph,
          node_feats,
          edge_feats,
          gpb,
          graph_name,
          ntypes_list,
          etypes_list,
      )
  
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 8 for calling a global function with example usage: load_partition(part_config, part_id, load_feats) and returns: graph,  node_feats,  edge_feats,  gpb,  graph_name,  ntypes_list,  etypes_list