code: def test_hetero_mask_to_index():
      data = HeteroData()
      data["u"].train_mask = torch.tensor(
          [True, True, True, False, False]
      )
      data["u"].test_mask = torch.tensor(
          [False, False, False, True, True]
      )
  
      data["v"].train_mask = torch.tensor(
          [True, True, True, False, False]
      )
      data["v"].test_mask = torch.tensor(
          [False, False, False, True, True]
      )
  
      out = MaskToIndex()(data)
      assert len(out) == len(data) + 2
      assert "train_index" in out["u"]
      assert "test_index" in out["u"]
      assert "train_index" in out["v"]
      assert "test_index" 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 4 for calling a global function with example usage: test_hetero_mask_to_index() without return types