code: def check_explanation(
      edge_mask_type: MaskType,
      node_mask_type: MaskType,
      explanation: Explanation,
  ):
      if node_mask_type == MaskType.attributes:
          assert explanation.node_mask.size() == explanation.x.size()
          assert explanation.node_mask.min() >= 0
          assert explanation.node_mask.max() <= 1
      elif node_mask_type == MaskType.object:
          assert explanation.node_mask.size() == (
              explanation.num_nodes,
              1,
          )
          assert explanation.node_mask.min() >= 0
          assert explanation.node_mask.max() <= 1
      elif node_mask_type == MaskType.common_attributes:
          assert explanation.node_mask.size() == (
              1,
              explanation.num_features,
          )
          assert explanation.node_mask.min() >= 0
          assert explanation.node_mask.max() <= 1
  
      if edge_mask_type == MaskType.object:
          assert explanation.edge_mask.size() == (
              explanation.num_edges,
          )
          assert explanation.edge_mask.min() >= 0
          assert explanation.edge_mask.max() <= 1
  
file_path: pytorch_geometric/test/explain/algorithm/test_graphmask_explainer.py
imports: import pytest
  import torch
  from torch_geometric.explain import Explainer, Explanation, GraphMaskExplainer
  from torch_geometric.explain.config import MaskType, ModelConfig, ModelMode, ModelReturnType, ModelTaskLevel
  from torch_geometric.nn import GCNConv, global_add_pool
label_desc: Use image node_id 1 for calling a global function with example usage: check_explanation(edge_mask_type, node_mask_type, explanation) without return types