code: def test_OnDiskDataset_TVTSet_ItemSet_node_pairs_labels():
      """Test TVTSet which returns ItemSet with node pairs and labels."""
      with tempfile.TemporaryDirectory() as test_dir:
          train_node_pairs = np.arange(2000).reshape(1000, 2)
          train_node_pairs_path = os.path.join(
              test_dir, "train_node_pairs.npy"
          )
          np.save(train_node_pairs_path, train_node_pairs)
          train_labels = np.random.randint(0, 10, size=1000)
          train_labels_path = os.path.join(test_dir, "train_labels.npy")
          np.save(train_labels_path, train_labels)
  
          validation_node_pairs = np.arange(2000, 4000).reshape(1000, 2)
          validation_node_pairs_path = os.path.join(
              test_dir, "validation_node_pairs.npy"
          )
          np.save(validation_node_pairs_path, validation_node_pairs)
          validation_labels = np.random.randint(0, 10, size=1000)
          validation_labels_path = os.path.join(
              test_dir, "validation_labels.npy"
          )
          np.save(validation_labels_path, validation_labels)
  
          test_node_pairs = np.arange(4000, 6000).reshape(1000, 2)
          test_node_pairs_path = os.path.join(
              test_dir, "test_node_pairs.npy"
          )
          np.save(test_node_pairs_path, test_node_pairs)
          test_labels = np.random.randint(0, 10, size=1000)
          test_labels_path = os.path.join(test_dir, "test_labels.npy")
          np.save(test_labels_path, test_labels)
  
          yaml_content = f"""
              tasks:
                - name: link_prediction
                  train_set:
                    - type: null
                      data:
                        - name: node_pairs
                          format: numpy
                          in_memory: true
                          path: {train_node_pairs_path}
                        - name: labels
                          format: numpy
                          in_memory: true
                          path: {train_labels_path}
                  validation_set:
                    - data:
                        - name: node_pairs
                          format: numpy
                          in_memory: true
                          path: {validation_node_pairs_path}
                        - name: labels
                          format: numpy
                          in_memory: true
                          path: {validation_labels_path}
                  test_set:
                    - type: null
                      data:
                        - name: node_pairs
                          format: numpy
                          in_memory: true
                          path: {test_node_pairs_path}
                        - name: labels
                          format: numpy
                          in_memory: true
                          path: {test_labels_path}
          """
          dataset = write_yaml_and_load_dataset(yaml_content, test_dir)
  
          # Verify train set.
          train_set = dataset.tasks[0].train_set
          assert len(train_set) == 1000
          assert isinstance(train_set, gb.ItemSet)
          for i, (node_pair, label) in enumerate(train_set):
              assert node_pair[0] == train_node_pairs[i][0]
              assert node_pair[1] == train_node_pairs[i][1]
              assert label == train_labels[i]
          assert train_set.names == ("node_pairs", "labels")
          train_set = None
  
          # Verify validation set.
          validation_set = dataset.tasks[0].validation_set
          assert len(validation_set) == 1000
          assert isinstance(validation_set, gb.ItemSet)
          for i, (node_pair, label) in enumerate(validation_set):
              assert node_pair[0] == validation_node_pairs[i][0]
              assert node_pair[1] == validation_node_pairs[i][1]
              assert label == validation_labels[i]
          assert validation_set.names == ("node_pairs", "labels")
          validation_set = None
  
          # Verify test set.
          test_set = dataset.tasks[0].test_set
          assert len(test_set) == 1000
          assert isinstance(test_set, gb.ItemSet)
          for i, (node_pair, label) in enumerate(test_set):
              assert node_pair[0] == test_node_pairs[i][0]
              assert node_pair[1] == test_node_pairs[i][1]
              assert label == test_labels[i]
          assert test_set.names == ("node_pairs", "labels")
          test_set = None
          dataset = None
  
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 9 for calling a global function with example usage: test_OnDiskDataset_TVTSet_ItemSet_node_pairs_labels() without return types