code: def test_pgm_explainer_classification(
      node_idx, task_level, perturbation_mode
  ):
      model_config = ModelConfig(
          mode="multiclass_classification",
          task_level=task_level,
          return_type="raw",
      )
  
      model = GCN(model_config)
      logits = model(x, edge_index)
      target = logits.argmax(dim=1)
  
      explainer = Explainer(
          model=model,
          algorithm=PGMExplainer(
              feature_index=[0], perturbation_mode=perturbation_mode
          ),
          explanation_type="phenomenon",
          node_mask_type="object",
          model_config=model_config,
      )
  
      explanation = explainer(
          x=x,
          edge_index=edge_index,
          index=node_idx,
          target=target,
      )
  
      assert "node_mask" in explanation
      assert "pgm_stats" in explanation
      assert explanation.node_mask.size(0) == explanation.num_nodes
      assert explanation.node_mask.min() >= 0
      assert explanation.node_mask.max() <= 1
  
file_path: pytorch_geometric/test/contrib/explain/test_pgm_explainer.py
imports: import pytest
  import torch
  from torch_geometric.contrib.explain import PGMExplainer
  from torch_geometric.explain import Explainer
  from torch_geometric.explain.config import ModelConfig
  from torch_geometric.nn import GCNConv, global_add_pool
  from torch_geometric.testing import withPackage
label_desc: Use image node_id 1 for calling a global function with example usage: test_pgm_explainer_classification(node_idx, task_level, perturbation_mode) without return types