code: def test_basic_feature_store_hetero():
      a = torch.tensor([[1, 2, 4], [2, 5, 3]])
      b = torch.tensor([[[6], [8]], [[8], [9]]])
      metadata = {"max_value": 3}
  
      features = {}
      features[("node", "author", "a")] = gb.TorchBasedFeature(
          a, metadata=metadata
      )
      features[("edge", "paper:cites", "b")] = gb.TorchBasedFeature(b)
  
      feature_store = gb.BasicFeatureStore(features)
  
      # Test read the entire feature.
      assert torch.equal(
          feature_store.read("node", "author", "a"),
          torch.tensor([[1, 2, 4], [2, 5, 3]]),
      )
      assert torch.equal(
          feature_store.read("edge", "paper:cites", "b"),
          torch.tensor([[[6], [8]], [[8], [9]]]),
      )
  
      # Test read with ids.
      assert torch.equal(
          feature_store.read("node", "author", "a", torch.tensor([0])),
          torch.tensor([[1, 2, 4]]),
      )
  
      # Test get the size of the entire feature.
      assert feature_store.size("node", "author", "a") == torch.Size(
          [3]
      )
      assert feature_store.size(
          "edge", "paper:cites", "b"
      ) == torch.Size([2, 1])
  
      # Test get metadata of the feature.
      assert feature_store.metadata("node", "author", "a") == metadata
      assert feature_store.metadata("edge", "paper:cites", "b") == {}
  
      # Test get keys of the features.
      assert feature_store.keys() == [
          ("node", "author", "a"),
          ("edge", "paper:cites", "b"),
      ]
  
imports: import pytest
  import torch
  from dgl import graphbolt
label_desc: Use image node_id 2 for calling a global function with example usage: test_basic_feature_store_hetero() without return types