code: def test_available_explanations(
      hetero_data, node_mask_type, edge_mask_type
  ):
      expected = []
      if node_mask_type:
          expected.append("node_mask")
      if edge_mask_type:
          expected.append("edge_mask")
  
      explanation = create_random_explanation(
          hetero_data,
          node_mask_type=node_mask_type,
          edge_mask_type=edge_mask_type,
      )
  
      assert set(explanation.available_explanations) == set(expected)
  
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 2 for calling a global function with example usage: test_available_explanations(hetero_data, node_mask_type, edge_mask_type) without return types