code: def filter_data(
      data: Data,
      node: Tensor,
      row: Tensor,
      col: Tensor,
      edge: OptTensor,
      perm: OptTensor = None,
  ) -> Data:
      # Filters a data object to only hold nodes in `node` and edges in `edge`:
      out = copy.copy(data)
      filter_node_store_(data._store, out._store, node)
      filter_edge_store_(data._store, out._store, row, col, edge, perm)
      return out
  
imports: import copy
  import logging
  import math
  from typing import Any, Dict, Optional, Tuple, Union
  import numpy
  import torch
  from torch import Tensor
  import torch_geometric.typing
  from torch_geometric import EdgeIndex
  from torch_geometric.data import Data, FeatureStore, GraphStore, HeteroData, TensorAttr, remote_backend_utils
  from torch_geometric.data.storage import EdgeStorage, NodeStorage
  from torch_geometric.typing import EdgeType, FeatureTensorType, InputEdges, InputNodes, NodeType, OptTensor, SparseTensor, TensorFrame
label_desc: Use image node_id 4 for calling a global function with example usage: filter_data(data, node, row, col, edge, perm) and returns: out