code: def pool_edge(
      cluster, edge_index, edge_attr: Optional[torch.Tensor] = None
  ):
      num_nodes = cluster.size(0)
      edge_index = cluster[edge_index.view(-1)].view(2, -1)
      edge_index, edge_attr = remove_self_loops(edge_index, edge_attr)
      if edge_index.numel() > 0:
          edge_index, edge_attr = coalesce(
              edge_index, edge_attr, num_nodes
          )
      return edge_index, edge_attr
  
imports: from typing import Optional
  import torch
  from torch_geometric.utils import coalesce, remove_self_loops, scatter
label_desc: Use image node_id 1 for calling a global function with example usage: pool_edge(cluster, edge_index, edge_attr) and returns: edge_index,  edge_attr