code: def test_OnDiskDataset_TVTSet_exceptions():
      """Test excpetions thrown when parsing TVTSet."""
      with tempfile.TemporaryDirectory() as test_dir:
          # Case 1: ``format`` is invalid.
          yaml_content = """
          tasks:
            - name: node_classification
              train_set:
                - type: paper
                  data:
                    - format: torch_invalid
                      path: set/paper-train.pt
          """
          write_yaml_file(yaml_content, test_dir)
          with pytest.raises(pydantic.ValidationError):
              _ = gb.OnDiskDataset(
                  test_dir, force_preprocess=False
              ).load()
  
          # Case 2: ``type`` is not specified while multiple TVT sets are
          # specified.
          yaml_content = """
              tasks:
                - name: node_classification
                  train_set:
                  - type: null
                    data:
                      - format: numpy
                        path: set/train.npy
                  - type: null
                    data:
                      - format: numpy
                        path: set/train.npy
          """
          write_yaml_file(yaml_content, test_dir)
          with pytest.raises(
              AssertionError,
              match=r"Only one TVT set is allowed if type is not specified.",
          ):
              _ = gb.OnDiskDataset(
                  test_dir, force_preprocess=False
              ).load()
  
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 4 for calling a global function with example usage: test_OnDiskDataset_TVTSet_exceptions() without return types