code: def l_shapley(
      coalition: list,
      data: Data,
      local_radius: int,
      value_func: str,
      subgraph_building_method="zero_filling",
  ):
      """shapley value where players are local neighbor nodes"""
      graph = to_networkx(data)
      num_nodes = graph.number_of_nodes()
      subgraph_build_func = get_graph_build_func(
          subgraph_building_method
      )
  
      local_region = copy.copy(coalition)
      for k in range(local_radius - 1):
          k_neiborhoood = []
          for node in local_region:
              k_neiborhoood += list(graph.neighbors(node))
          local_region += k_neiborhoood
          local_region = list(set(local_region))
  
      set_exclude_masks = []
      set_include_masks = []
      nodes_around = [
          node for node in local_region if node not in coalition
      ]
      num_nodes_around = len(nodes_around)
  
      for subset_len in range(0, num_nodes_around + 1):
          node_exclude_subsets = combinations(nodes_around, subset_len)
          for node_exclude_subset in node_exclude_subsets:
              set_exclude_mask = np.ones(num_nodes)
              set_exclude_mask[local_region] = 0.0
              if node_exclude_subset:
                  set_exclude_mask[list(node_exclude_subset)] = 1.0
              set_include_mask = set_exclude_mask.copy()
              set_include_mask[coalition] = 1.0
  
              set_exclude_masks.append(set_exclude_mask)
              set_include_masks.append(set_include_mask)
  
      exclude_mask = np.stack(set_exclude_masks, axis=0)
      include_mask = np.stack(set_include_masks, axis=0)
      num_players = len(nodes_around) + 1
      num_player_in_set = (
          num_players
          - 1
          + len(coalition)
          - (1 - exclude_mask).sum(axis=1)
      )
      p = num_players
      S = num_player_in_set
      coeffs = torch.tensor(1.0 / comb(p, S) / (p - S + 1e-6))
  
      marginal_contributions = marginal_contribution(
          data,
          exclude_mask,
          include_mask,
          value_func,
          subgraph_build_func,
      )
  
      l_shapley_value = (
          (marginal_contributions.squeeze().cpu() * coeffs).sum().item()
      )
      return l_shapley_value
  
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 7 for calling a global function with example usage: l_shapley(coalition, data, local_radius, value_func, subgraph_building_method) and returns: l_shapley_value