code: def test_captum_explainer_binary_classification(
      method,
      data,
      node_mask_type,
      edge_mask_type,
      task_level,
      index,
  ):
      if node_mask_type is None and edge_mask_type is None:
          return
  
      batch = torch.tensor([0, 0, 1, 1])
      edge_label_index = torch.tensor([[0, 1, 2], [2, 3, 1]])
  
      model_config = ModelConfig(
          mode="binary_classification",
          task_level=task_level,
          return_type="probs",
      )
  
      explainer = Explainer(
          GCN(model_config),
          algorithm=CaptumExplainer(method),
          explanation_type="model",
          edge_mask_type=edge_mask_type,
          node_mask_type=node_mask_type,
          model_config=model_config,
      )
  
      explanation = explainer(
          data.x,
          data.edge_index,
          index=index,
          batch=batch,
          edge_label_index=edge_label_index,
      )
      check_explanation(explanation, node_mask_type, edge_mask_type)
  
file_path: pytorch_geometric/test/explain/algorithm/test_captum_explainer.py
imports: from typing import Optional
  import pytest
  import torch
  from torch_geometric.explain import Explainer, Explanation
  from torch_geometric.explain.algorithm import CaptumExplainer
  from torch_geometric.explain.config import MaskType, ModelConfig, ModelMode, ModelReturnType, ModelTaskLevel
  from torch_geometric.nn import GCNConv, global_add_pool
  from torch_geometric.testing import withPackage
label_desc: Use image node_id 3 for calling a global function with example usage: test_captum_explainer_binary_classification(method, data, node_mask_type, edge_mask_type, task_level, index) without return types