code: def test_hetero_data_to_canonical():
      data = HeteroData()
      assert isinstance(data["user", "product"], EdgeStorage)
      assert len(data.edge_types) == 1
      assert isinstance(data["user", "to", "product"], EdgeStorage)
      assert len(data.edge_types) == 1
  
      data = HeteroData()
      assert isinstance(data["user", "buys", "product"], EdgeStorage)
      assert isinstance(data["user", "clicks", "product"], EdgeStorage)
      assert len(data.edge_types) == 2
  
      with pytest.raises(TypeError, match="missing 1 required"):
          data["user", "product"]
  
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 12 for calling a global function with example usage: test_hetero_data_to_canonical() without return types