code: def test_dgl_link_predication_hetero(mode):
      # Arrange
      minibatch = create_hetero_minibatch()
      minibatch.compacted_node_pairs = {
          relation: (
              torch.tensor([1, 1]),
              torch.tensor([1, 0]),
          ),
          reverse_relation: (
              torch.tensor([0, 1]),
              torch.tensor([1, 0]),
          ),
      }
      if mode == "neg_graph" or mode == "neg_src":
          minibatch.compacted_negative_srcs = {
              relation: torch.tensor([[2, 0], [1, 2]]),
              reverse_relation: torch.tensor([[1, 2], [0, 2]]),
          }
      if mode == "neg_graph" or mode == "neg_dst":
          minibatch.compacted_negative_dsts = {
              relation: torch.tensor([[1, 3], [2, 1]]),
              reverse_relation: torch.tensor([[2, 1], [3, 1]]),
          }
      # Act
      dgl_blocks = minibatch.blocks
  
      # Assert
      assert len(dgl_blocks) == 2
      check_dgl_blocks_hetero(minibatch, dgl_blocks)
      if mode == "neg_graph" or mode == "neg_src":
          for etype, src in minibatch.compacted_negative_srcs.items():
              assert torch.equal(
                  minibatch.negative_node_pairs[etype][0],
                  src,
              )
      if mode == "neg_graph" or mode == "neg_dst":
          for etype, dst in minibatch.compacted_negative_dsts.items():
              assert torch.equal(
                  minibatch.negative_node_pairs[etype][1],
                  minibatch.compacted_negative_dsts[etype],
              )
  
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 14 for calling a global function with example usage: test_dgl_link_predication_hetero(mode) without return types