code: def test_fidelity(explanation_type):
      x = torch.randn(8, 4)
      edge_index = torch.tensor(
          [
              [0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7],
              [1, 0, 2, 1, 3, 2, 4, 3, 5, 4, 6, 5, 7, 6],
          ]
      )
  
      explainer = Explainer(
          DummyModel(),
          algorithm=DummyExplainer(),
          explanation_type=explanation_type,
          node_mask_type="object",
          edge_mask_type="object",
          model_config=dict(
              mode="multiclass_classification",
              return_type="raw",
              task_level="node",
          ),
      )
  
      target = None
      if explanation_type == "phenomenon":
          target = torch.randint(0, x.size(1), (x.size(0),))
  
      explanation = explainer(
          x, edge_index, target=target, index=torch.arange(4)
      )
  
      pos_fidelity, neg_fidelity = fidelity(explainer, explanation)
      assert pos_fidelity == 0.0 and neg_fidelity == 0.0
  
file_path: pytorch_geometric/test/explain/metric/test_fidelity.py
imports: import pytest
  import torch
  from torch_geometric.explain import DummyExplainer, Explainer, characterization_score, fidelity, fidelity_curve_auc
label_desc: Use image node_id 1 for calling a global function with example usage: test_fidelity(explanation_type) without return types