code: def test_hard_threshold(hetero_data, threshold_value, node_mask_type):
      explainer = Explainer(
          DummyModel(),
          algorithm=DummyExplainer(),
          explanation_type="model",
          node_mask_type=node_mask_type,
          edge_mask_type="object",
          model_config=dict(
              mode="regression",
              task_level="graph",
          ),
          threshold_config=("hard", threshold_value),
      )
      explanation = explainer(
          hetero_data.x_dict, hetero_data.edge_index_dict
      )
      assert "node_mask" in explanation.available_explanations
      assert "edge_mask" in explanation.available_explanations
  
      for key in explanation.available_explanations:
          for mask in explanation.collect(key).values():
              assert set(mask.unique().tolist()).issubset({0, 1})
  
file_path: pytorch_geometric/test/explain/test_hetero_explainer.py
imports: import pytest
  import torch
  from torch_geometric.explain import DummyExplainer, Explainer, HeteroExplanation
  from torch_geometric.explain.config import ExplanationType
label_desc: Use image node_id 3 for calling a global function with example usage: test_hard_threshold(hetero_data, threshold_value, node_mask_type) without return types