code: def test_dangling_types():
      data = HeteroData()
      data["src", "to", "dst"].edge_index = torch.randint(
          0, 10, (2, 20)
      )
      with pytest.raises(
          ValueError, match="do not exist as node types"
      ):
          data.validate()
  
      data = HeteroData()
      data["node"].num_nodes = 10
      with pytest.warns(UserWarning, match="{'node'} are isolated"):
          data.validate()
  
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 6 for calling a global function with example usage: test_dangling_types() without return types