code: def test_OnDiskDataset_Graph_heterogeneous():
      """Test heterogeneous graph topology."""
      (
          csc_indptr,
          indices,
          node_type_offset,
          type_per_edge,
          node_type_to_id,
          edge_type_to_id,
      ) = gbt.random_hetero_graph(1000, 10 * 1000, 3, 4)
      graph = gb.fused_csc_sampling_graph(
          csc_indptr,
          indices,
          node_type_offset=node_type_offset,
          type_per_edge=type_per_edge,
          node_type_to_id=node_type_to_id,
          edge_type_to_id=edge_type_to_id,
      )
  
      with tempfile.TemporaryDirectory() as test_dir:
          graph_path = os.path.join(
              test_dir, "fused_csc_sampling_graph.pt"
          )
          torch.save(graph, graph_path)
  
          yaml_content = f"""
              graph_topology:
                type: FusedCSCSamplingGraph
                path: {graph_path}
          """
          dataset = write_yaml_and_load_dataset(yaml_content, test_dir)
          graph2 = dataset.graph
  
          assert graph.total_num_nodes == graph2.total_num_nodes
          assert graph.total_num_edges == graph2.total_num_edges
  
          assert torch.equal(graph.csc_indptr, graph2.csc_indptr)
          assert torch.equal(graph.indices, graph2.indices)
          assert torch.equal(
              graph.node_type_offset, graph2.node_type_offset
          )
          assert torch.equal(graph.type_per_edge, graph2.type_per_edge)
          assert graph.node_type_to_id == graph2.node_type_to_id
          assert graph.edge_type_to_id == graph2.edge_type_to_id
  
imports: import os
  import pickle
  import random
  import re
  import tempfile
  import unittest
  import warnings
  import numpy
  import pandas
  import pydantic
  import pytest
  import torch
  import yaml
  from dgl import graphbolt
  from dgl.base import DGLWarning
  from ..None import gb_test_utils
label_desc: Use image node_id 17 for calling a global function with example usage: test_OnDiskDataset_Graph_heterogeneous() without return types