code: def test_node_mask():
      explanation = HeteroExplanation()
      explanation["paper"].node_mask = torch.tensor(
          [[1.0], [0.0], [1.0], [1.0]]
      )
      explanation["author"].node_mask = torch.tensor(
          [[1.0], [0.0], [1.0], [1.0]]
      )
      with pytest.warns(UserWarning, match="are isolated"):
          explanation.validate(raise_on_error=True)
  
      out = explanation.get_explanation_subgraph()
      assert out["paper"].node_mask.size() == (3, 1)
      assert out["author"].node_mask.size() == (3, 1)
  
      out = explanation.get_complement_subgraph()
      assert out["paper"].node_mask.size() == (1, 1)
      assert out["author"].node_mask.size() == (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 4 for calling a global function with example usage: test_node_mask() without return types