code: def test_hetero_index_to_mask():
      data = HeteroData()
      data["u"].train_index = torch.arange(0, 3)
      data["u"].test_index = torch.arange(3, 5)
      data["u"].num_nodes = 5
  
      data["v"].train_index = torch.arange(0, 3)
      data["v"].test_index = torch.arange(3, 5)
      data["v"].num_nodes = 5
  
      out = IndexToMask()(data)
      assert len(out) == len(data) + 2
      assert "train_mask" in out["u"]
      assert "test_mask" in out["u"]
      assert "train_mask" in out["v"]
      assert "test_mask" in out["v"]
  
imports: import torch
  from torch_geometric.data import Data, HeteroData
  from torch_geometric.transforms import IndexToMask, MaskToIndex
label_desc: Use image node_id 3 for calling a global function with example usage: test_hetero_index_to_mask() without return types