class_docstr: Holds all the obtained explanations of a homogeneous graph.
  
  The explanation object is a :obj:`~torch_geometric.data.Data` object and
  can hold node attributions and edge attributions.
  It can also hold the original graph if needed.
  
  Args:
      node_mask (Tensor, optional): Node-level mask with shape
          :obj:`[num_nodes, 1]`, :obj:`[1, num_features]` or
          :obj:`[num_nodes, num_features]`. (default: :obj:`None`)
      edge_mask (Tensor, optional): Edge-level mask with shape
          :obj:`[num_edges]`. (default: :obj:`None`)
      **kwargs (optional): Additional attributes.
code: def _apply_masks(
      self,
      node_mask: Optional[Tensor] = None,
      edge_mask: Optional[Tensor] = None,
  ) -> "Explanation":
      out = copy.copy(self)
  
      if edge_mask is not None:
          for key, value in self.items():
              if key == "edge_index":
                  out.edge_index = value[:, edge_mask]
              elif self.is_edge_attr(key):
                  out[key] = value[edge_mask]
  
      if node_mask is not None:
          out = out.subgraph(node_mask)
  
      return out
  
imports: import copy
  from typing import Dict, List, Optional, Union
  import torch
  from torch import Tensor
  from torch_geometric.data.data import Data, warn_or_raise
  from torch_geometric.data.hetero_data import HeteroData
  from torch_geometric.explain.config import ThresholdConfig, ThresholdType
  from torch_geometric.typing import EdgeType, NodeType
  from torch_geometric.visualization import visualize_graph
label_desc: Use image node_id 4 for calling the Explanation obj's underlying member method code with example usage: obj._apply_masks(node_mask, edge_mask) and returns: out