code: def test_pg_explainer_supports():
      # Test unsupported model task level:
      with pytest.raises(
          ValueError, match="not support the given explanation"
      ):
          model_config = ModelConfig(
              mode="binary_classification",
              task_level="edge",
              return_type="raw",
          )
          Explainer(
              model=GCN(model_config),
              algorithm=PGExplainer(epochs=2),
              explanation_type="phenomenon",
              edge_mask_type="object",
              model_config=model_config,
          )
  
      # Test unsupported explanation type:
      with pytest.raises(
          ValueError, match="not support the given explanation"
      ):
          model_config = ModelConfig(
              mode="binary_classification",
              task_level="node",
              return_type="raw",
          )
          Explainer(
              model=GCN(model_config),
              algorithm=PGExplainer(epochs=2),
              explanation_type="model",
              edge_mask_type="object",
              model_config=model_config,
          )
  
      # Test unsupported node mask:
      with pytest.raises(
          ValueError, match="not support the given explanation"
      ):
          model_config = ModelConfig(
              mode="binary_classification",
              task_level="node",
              return_type="raw",
          )
          Explainer(
              model=GCN(model_config),
              algorithm=PGExplainer(epochs=2),
              explanation_type="model",
              node_mask_type="object",
              edge_mask_type="object",
              model_config=model_config,
          )
  
file_path: pytorch_geometric/test/explain/algorithm/test_pg_explainer.py
imports: import pytest
  import torch
  from torch_geometric.explain import Explainer, PGExplainer
  from torch_geometric.explain.config import ModelConfig, ModelMode, ModelTaskLevel
  from torch_geometric.nn import GCNConv, global_add_pool
  from torch_geometric.testing import withCUDA
label_desc: Use image node_id 3 for calling a global function with example usage: test_pg_explainer_supports() without return types