code: def test_ItemSet_node_pairs_labels():
      # Node pairs and labels
      node_pairs = torch.arange(0, 10).reshape(-1, 2)
      labels = torch.randint(0, 3, (5,))
      item_set = gb.ItemSet(
          (node_pairs, labels), names=("node_pairs", "labels")
      )
      assert item_set.names == ("node_pairs", "labels")
      # Iterating over ItemSet and indexing one by one.
      for i, (node_pair, label) in enumerate(item_set):
          assert torch.equal(node_pairs[i], node_pair)
          assert labels[i] == label
          assert torch.equal(node_pairs[i], item_set[i][0])
          assert labels[i] == item_set[i][1]
      # Indexing with a slice.
      assert torch.equal(item_set[:][0], node_pairs)
      assert torch.equal(item_set[:][1], labels)
      # Indexing with an Iterable.
      assert torch.equal(item_set[torch.arange(0, 5)][0], node_pairs)
      assert torch.equal(item_set[torch.arange(0, 5)][1], labels)
  
imports: import re
  import dgl
  import pytest
  import torch
  from dgl import graphbolt
  from torch.testing import assert_close
label_desc: Use image node_id 6 for calling a global function with example usage: test_ItemSet_node_pairs_labels() without return types