code: def test_hetero_data_to_from_dict():
      data = HeteroData()
      data.global_id = "1"
      data["v1"].x = torch.randn(5, 16)
      data["v2"].y = torch.randn(4, 16)
      data["v1", "v2"].edge_index = torch.tensor(
          [[0, 1, 2, 3], [0, 1, 2, 3]]
      )
  
      out = HeteroData.from_dict(data.to_dict())
      assert out.global_id == data.global_id
      assert torch.equal(out["v1"].x, data["v1"].x)
      assert torch.equal(out["v2"].y, data["v2"].y)
      assert torch.equal(
          out["v1", "v2"].edge_index, data["v1", "v2"].edge_index
      )
  
imports: import copy
  import pytest
  import torch
  from torch_geometric.data import HeteroData
  from torch_geometric.data.storage import EdgeStorage
  from torch_geometric.testing import get_random_edge_index, get_random_tensor_frame, withPackage
  from torch_geometric.typing import TensorFrame
label_desc: Use image node_id 2 for calling a global function with example usage: test_hetero_data_to_from_dict() without return types