def load_partition(part_config, part_id, load_feats=True, use_graphbolt=False):
    """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.
    use_graphbolt : bool, optional
        Whether to load GraphBolt partition. Default: False.

    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)]

    exist_dgl_graph = exist_graphbolt_graph = False
    if os.path.exists(os.path.join(config_path, f"part{part_id}", "graph.dgl")):
        use_graphbolt = False
        exist_dgl_graph = True
    if os.path.exists(
        os.path.join(
            config_path, f"part{part_id}", "fused_csc_sampling_graph.pt"
        )
    ):
        use_graphbolt = True
        exist_graphbolt_graph = True

    # Check if both DGL graph and GraphBolt graph exist or not exist. Make sure only one exists.
    if not exist_dgl_graph and not exist_graphbolt_graph:
        raise ValueError("The graph object doesn't exist.")
    if exist_dgl_graph and exist_graphbolt_graph:
        raise ValueError(
            "Both DGL graph and GraphBolt graph exist. Please remove one."
        )

    if use_graphbolt:
        part_graph_field = "part_graph_graphbolt"
    else:
        part_graph_field = "part_graph"
    assert (
        part_graph_field in part_files
    ), f"the partition does not contain graph structure: {part_graph_field}"
    partition_path = relative_to_config(part_files[part_graph_field])
    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 = (
        torch.load(partition_path, weights_only=False)
        if use_graphbolt
        else load_graphs(partition_path)[0][0]
    )
    logging.info("Finished loading partition from %s.", partition_path)

    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:
        _verify_func = (
            _verify_graphbolt_partition
            if use_graphbolt
            else _verify_dgl_partition
        )
        _verify_func(graph, part_id, gpb, ntypes, etypes)

    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,
    )
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.
    use_graphbolt : bool, optional
        Whether to load GraphBolt partition. Default: False.

    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
    
python/dgl/distributed/partition.py