code: def test_edge_mask():
      explanation = HeteroExplanation()
      explanation["paper"].num_nodes = 4
      explanation["author"].num_nodes = 4
      explanation["paper", "author"].edge_index = torch.tensor(
          [
              [0, 1, 2, 3],
              [0, 1, 2, 3],
          ]
      )
      explanation["paper", "author"].edge_mask = torch.tensor(
          [1.0, 0.0, 1.0, 1.0]
      )
  
      out = explanation.get_explanation_subgraph()
      assert out["paper"].num_nodes == 4
      assert out["author"].num_nodes == 4
      assert out["paper", "author"].edge_mask.size() == (3,)
      assert torch.equal(
          out["paper", "author"].edge_index,
          torch.tensor([[0, 2, 3], [0, 2, 3]]),
      )
  
      out = explanation.get_complement_subgraph()
      assert out["paper"].num_nodes == 4
      assert out["author"].num_nodes == 4
      assert out["paper", "author"].edge_mask.size() == (1,)
      assert torch.equal(
          out["paper", "author"].edge_index, torch.tensor([[1], [1]])
      )
  
file_path: pytorch_geometric/test/explain/test_hetero_explanation.py
imports: import os.path
  from typing import Optional, Union
  import pytest
  import torch
  from torch_geometric.data import HeteroData
  from torch_geometric.explain import HeteroExplanation
  from torch_geometric.explain.config import MaskType
  from torch_geometric.testing import withPackage
label_desc: Use image node_id 5 for calling a global function with example usage: test_edge_mask() without return types