code: def test_init_hetero_data():
      data = HeteroData()
      data["v1"].x = 1
      data["paper"].x = x_paper
      data["author"].x = x_author
      data["paper", "paper"].edge_index = edge_index_paper_paper
      data["paper", "author"].edge_index = edge_index_paper_author
      data["author", "paper"].edge_index = edge_index_author_paper
      with pytest.warns(UserWarning, match="{'v1'} are isolated"):
          data.validate(raise_on_error=True)
  
      assert len(data) == 2
      assert data.node_types == ["v1", "paper", "author"]
      assert len(data.node_stores) == 3
      assert len(data.node_items()) == 3
      assert len(data.edge_types) == 3
      assert len(data.edge_stores) == 3
      assert len(data.edge_items()) == 3
  
      data = HeteroData(
          v1={"x": 1},
          paper={"x": x_paper},
          author={"x": x_author},
          paper__paper={"edge_index": edge_index_paper_paper},
          paper__author={"edge_index": edge_index_paper_author},
          author__paper={"edge_index": edge_index_author_paper},
      )
  
      assert len(data) == 2
      assert data.node_types == ["v1", "paper", "author"]
      assert len(data.node_stores) == 3
      assert len(data.node_items()) == 3
      assert len(data.edge_types) == 3
      assert len(data.edge_stores) == 3
      assert len(data.edge_items()) == 3
  
      data = HeteroData(
          {
              "v1": {"x": 1},
              "paper": {"x": x_paper},
              "author": {"x": x_author},
              ("paper", "paper"): {
                  "edge_index": edge_index_paper_paper
              },
              ("paper", "author"): {
                  "edge_index": edge_index_paper_author
              },
              ("author", "paper"): {
                  "edge_index": edge_index_author_paper
              },
          }
      )
  
      assert len(data) == 2
      assert data.node_types == ["v1", "paper", "author"]
      assert len(data.node_stores) == 3
      assert len(data.node_items()) == 3
      assert len(data.edge_types) == 3
      assert len(data.edge_stores) == 3
      assert len(data.edge_items()) == 3
  
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 1 for calling a global function with example usage: test_init_hetero_data() without return types