code: def test_OnDiskDataset_Feature_heterograph():
      """Test Feature storage."""
      with tempfile.TemporaryDirectory() as test_dir:
          # Generate node data.
          node_data_paper = np.random.rand(1000, 10)
          node_data_paper_path = os.path.join(
              test_dir, "node_data_paper.npy"
          )
          np.save(node_data_paper_path, node_data_paper)
          node_data_label = torch.tensor(
              [[random.randint(0, 10)] for _ in range(1000)]
          )
          node_data_label_path = os.path.join(
              test_dir, "node_data_label.npy"
          )
          np.save(node_data_label_path, node_data_label)
  
          # Generate edge data.
          edge_data_writes = np.random.rand(1000, 10)
          edge_data_writes_path = os.path.join(
              test_dir, "edge_writes_paper.npy"
          )
          np.save(edge_data_writes_path, edge_data_writes)
          edge_data_label = torch.tensor(
              [[random.randint(0, 10)] for _ in range(1000)]
          )
          edge_data_label_path = os.path.join(
              test_dir, "edge_data_label.npy"
          )
          np.save(edge_data_label_path, edge_data_label)
  
          # Generate YAML.
          yaml_content = f"""
              feature_data:
                - domain: node
                  type: paper
                  name: feat
                  format: numpy
                  in_memory: false
                  path: {node_data_paper_path}
                  num_categories: 10
                - domain: node
                  type: paper
                  name: labels
                  format: numpy
                  in_memory: true
                  path: {node_data_label_path}
                - domain: edge
                  type: "author:writes:paper"
                  name: feat
                  format: numpy
                  in_memory: false
                  path: {edge_data_writes_path}
                  num_categories: 10
                - domain: edge
                  type: "author:writes:paper"
                  name: labels
                  format: numpy
                  in_memory: true
                  path: {edge_data_label_path}
          """
          dataset = write_yaml_and_load_dataset(yaml_content, test_dir)
  
          # Verify feature data storage.
          feature_data = dataset.feature
          assert len(feature_data) == 4
  
          # Verify node feature data.
          assert torch.equal(
              feature_data.read("node", "paper", "feat"),
              torch.tensor(node_data_paper),
          )
          assert (
              feature_data.metadata("node", "paper", "feat")[
                  "num_categories"
              ]
              == 10
          )
          assert torch.equal(
              feature_data.read("node", "paper", "labels"),
              node_data_label.clone().detach(),
          )
          assert (
              len(feature_data.metadata("node", "paper", "labels")) == 0
          )
  
          # Verify edge feature data.
          assert torch.equal(
              feature_data.read("edge", "author:writes:paper", "feat"),
              torch.tensor(edge_data_writes),
          )
          assert (
              feature_data.metadata(
                  "edge", "author:writes:paper", "feat"
              )["num_categories"]
              == 10
          )
          assert torch.equal(
              feature_data.read(
                  "edge", "author:writes:paper", "labels"
              ),
              edge_data_label.clone().detach(),
          )
          assert (
              len(
                  feature_data.metadata(
                      "edge", "author:writes:paper", "labels"
                  )
              )
              == 0
          )
  
          feature_data = 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 13 for calling a global function with example usage: test_OnDiskDataset_Feature_heterograph() without return types