code: def check_dgl_blocks_hetero(minibatch, blocks):
      etype = gb.etype_str_to_tuple(relation)
      sampled_csc = [
          subgraph.sampled_csc
          for subgraph in minibatch.sampled_subgraphs
      ]
      original_edge_ids = [
          subgraph.original_edge_ids
          for subgraph in minibatch.sampled_subgraphs
      ]
      original_row_node_ids = [
          subgraph.original_row_node_ids
          for subgraph in minibatch.sampled_subgraphs
      ]
  
      for i, block in enumerate(blocks):
          edges = block.edges(etype=etype)
          dst_ndoes = torch.arange(
              0, len(sampled_csc[i][relation].indptr) - 1
          ).repeat_interleave(sampled_csc[i][relation].indptr.diff())
          assert torch.equal(edges[0], sampled_csc[i][relation].indices)
          assert torch.equal(edges[1], dst_ndoes)
          assert torch.equal(
              block.edges[etype].data[dgl.EID],
              original_edge_ids[i][relation],
          )
      edges = blocks[0].edges(
          etype=gb.etype_str_to_tuple(reverse_relation)
      )
      dst_ndoes = torch.arange(
          0, len(sampled_csc[0][reverse_relation].indptr) - 1
      ).repeat_interleave(
          sampled_csc[0][reverse_relation].indptr.diff()
      )
      assert torch.equal(
          edges[0], sampled_csc[0][reverse_relation].indices
      )
      assert torch.equal(edges[1], dst_ndoes)
      assert torch.equal(
          blocks[0].srcdata[dgl.NID]["A"], original_row_node_ids[0]["A"]
      )
      assert torch.equal(
          blocks[0].srcdata[dgl.NID]["B"], original_row_node_ids[0]["B"]
      )
  
file_path: dgl/tests/python/pytorch/graphbolt/impl/test_minibatch.py
imports: import dgl
  import dgl.graphbolt
  import pytest
  import torch
label_desc: Use image node_id 8 for calling a global function with example usage: check_dgl_blocks_hetero(minibatch, blocks) without return types