code: def test_minibatch_node_pairs_with_labels(mode):
      # Arrange
      minibatch = create_homo_minibatch()
      minibatch.compacted_node_pairs = (
          torch.tensor([0, 1]),
          torch.tensor([1, 0]),
      )
      if mode == "neg_graph" or mode == "neg_src":
          minibatch.compacted_negative_srcs = torch.tensor(
              [[0, 0], [1, 1]]
          )
      if mode == "neg_graph" or mode == "neg_dst":
          minibatch.compacted_negative_dsts = torch.tensor(
              [[1, 0], [0, 1]]
          )
      if mode == "edge_classification":
          minibatch.labels = torch.tensor([0, 1]).long()
      # Act
      node_pairs, labels = minibatch.node_pairs_with_labels
  
      # Assert
      if mode == "neg_src":
          expect_node_pairs = (
              torch.tensor([0, 1, 0, 0, 1, 1]),
              torch.tensor([1, 0, 1, 1, 0, 0]),
          )
          expect_labels = torch.tensor([1, 1, 0, 0, 0, 0]).float()
      elif mode != "edge_classification":
          expect_node_pairs = (
              torch.tensor([0, 1, 0, 0, 1, 1]),
              torch.tensor([1, 0, 1, 0, 0, 1]),
          )
          expect_labels = torch.tensor([1, 1, 0, 0, 0, 0]).float()
      else:
          expect_node_pairs = (
              torch.tensor([0, 1]),
              torch.tensor([1, 0]),
          )
          expect_labels = torch.tensor([0, 1]).long()
      assert torch.equal(node_pairs[0], expect_node_pairs[0])
      assert torch.equal(node_pairs[1], expect_node_pairs[1])
      assert torch.equal(labels, expect_labels)
  
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 5 for calling a global function with example usage: test_minibatch_node_pairs_with_labels(mode) without return types