code: def marginal_contribution(
      data: Data,
      exclude_mask: np.array,
      include_mask: np.array,
      value_func,
      subgraph_build_func,
  ):
      """Calculate the marginal value for each pair. Here exclude_mask and include_mask are node mask."""
      marginal_subgraph_dataset = MarginalSubgraphDataset(
          data, exclude_mask, include_mask, subgraph_build_func
      )
      dataloader = DataLoader(
          marginal_subgraph_dataset,
          batch_size=256,
          shuffle=False,
          num_workers=0,
      )
  
      marginal_contribution_list = []
  
      for exclude_data, include_data in dataloader:
          exclude_values = value_func(exclude_data)
          include_values = value_func(include_data)
          margin_values = include_values - exclude_values
          marginal_contribution_list.append(margin_values)
  
      marginal_contributions = torch.cat(
          marginal_contribution_list, dim=0
      )
      return marginal_contributions
  
imports: import copy
  import torch
  import numpy
  from scipy.special import comb
  from itertools import combinations
  import torch.nn.functional
  from torch_geometric.utils import to_networkx
  from torch_geometric.data import Data, Batch, Dataset
  from torch_geometric.loader import DataLoader
label_desc: Use image node_id 4 for calling a global function with example usage: marginal_contribution(data, exclude_mask, include_mask, value_func, subgraph_build_func) and returns: marginal_contributions