code: def test_OnDiskDataset_preprocess_auto_force_preprocess(capsys):
      """Test force preprocess of OnDiskDataset."""
      with tempfile.TemporaryDirectory() as test_dir:
          # All metadata fields are specified.
          dataset_name = "graphbolt_test"
          num_nodes = 4000
          num_edges = 20000
          num_classes = 10
  
          # Generate random graph.
          yaml_content = gbt.random_homo_graphbolt_graph(
              test_dir,
              dataset_name,
              num_nodes,
              num_edges,
              num_classes,
          )
          yaml_file = os.path.join(test_dir, "metadata.yaml")
          with open(yaml_file, "w") as f:
              f.write(yaml_content)
  
          # First preprocess on-disk dataset.
          preprocessed_metadata_path = (
              gb.ondisk_dataset.preprocess_ondisk_dataset(
                  test_dir, include_original_edge_id=False
              )
          )
          captured = capsys.readouterr().out.split("\n")
          assert captured == [
              "Start to preprocess the on-disk dataset.",
              "Finish preprocessing the on-disk dataset.",
              "",
          ]
          with open(preprocessed_metadata_path, "r") as f:
              target_yaml_data = yaml.safe_load(f)
          assert (
              target_yaml_data["tasks"][0]["name"] == "link_prediction"
          )
  
          # 1. Change yaml_data.
          with open(yaml_file, "r") as f:
              yaml_data = yaml.safe_load(f)
          yaml_data["tasks"][0]["name"] = "fake_name"
          with open(yaml_file, "w") as f:
              yaml.dump(yaml_data, f)
          preprocessed_metadata_path = (
              gb.ondisk_dataset.preprocess_ondisk_dataset(
                  test_dir, include_original_edge_id=False
              )
          )
          captured = capsys.readouterr().out.split("\n")
          assert captured == [
              "The on-disk dataset is re-preprocessing, so the existing "
              + "preprocessed dataset has been removed.",
              "Start to preprocess the on-disk dataset.",
              "Finish preprocessing the on-disk dataset.",
              "",
          ]
          with open(preprocessed_metadata_path, "r") as f:
              target_yaml_data = yaml.safe_load(f)
          assert target_yaml_data["tasks"][0]["name"] == "fake_name"
  
          # 2. Change edge feature.
          edge_feats = np.random.rand(num_edges, num_classes)
          edge_feat_path = os.path.join("data", "edge-feat.npy")
          np.save(os.path.join(test_dir, edge_feat_path), edge_feats)
          preprocessed_metadata_path = (
              gb.ondisk_dataset.preprocess_ondisk_dataset(
                  test_dir, include_original_edge_id=False
              )
          )
          captured = capsys.readouterr().out.split("\n")
          assert captured == [
              "The on-disk dataset is re-preprocessing, so the existing "
              + "preprocessed dataset has been removed.",
              "Start to preprocess the on-disk dataset.",
              "Finish preprocessing the on-disk dataset.",
              "",
          ]
          preprocessed_edge_feat = np.load(
              os.path.join(test_dir, "preprocessed", edge_feat_path)
          )
          assert preprocessed_edge_feat.all() == edge_feats.all()
          with open(preprocessed_metadata_path, "r") as f:
              target_yaml_data = yaml.safe_load(f)
          assert target_yaml_data["include_original_edge_id"] == False
  
          # 3. Change include_original_edge_id.
          preprocessed_metadata_path = (
              gb.ondisk_dataset.preprocess_ondisk_dataset(
                  test_dir, include_original_edge_id=True
              )
          )
          captured = capsys.readouterr().out.split("\n")
          assert captured == [
              "The on-disk dataset is re-preprocessing, so the existing "
              + "preprocessed dataset has been removed.",
              "Start to preprocess the on-disk dataset.",
              "Finish preprocessing the on-disk dataset.",
              "",
          ]
          with open(preprocessed_metadata_path, "r") as f:
              target_yaml_data = yaml.safe_load(f)
          assert target_yaml_data["include_original_edge_id"] == True
  
          # 4. Change nothing.
          preprocessed_metadata_path = (
              gb.ondisk_dataset.preprocess_ondisk_dataset(
                  test_dir, include_original_edge_id=True
              )
          )
          captured = capsys.readouterr().out.split("\n")
          assert captured == [
              "The dataset is already preprocessed.",
              "",
          ]
  
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 24 for calling a global function with example usage: test_OnDiskDataset_preprocess_auto_force_preprocess(capsys) without return types