code: def avg_pool_neighbor_x(
      data: Data,
      flow: Optional[str] = "source_to_target",
  ) -> Data:
      r"""Average pools neighboring node features, where each feature in
      :obj:`data.x` is replaced by the average feature values from the central
      node and its neighbors.
      """
      x, edge_index = data.x, data.edge_index
  
      edge_index, _ = add_self_loops(
          edge_index, num_nodes=data.num_nodes
      )
  
      row, col = edge_index
      row, col = (
          (row, col) if flow == "source_to_target" else (col, row)
      )
  
      data.x = scatter(
          x[row], col, dim=0, dim_size=data.num_nodes, reduce="mean"
      )
      return data
  
file_path: pytorch_geometric/torch_geometric/nn/pool/avg_pool.py
imports: from typing import Callable, Optional, Tuple
  from torch import Tensor
  from torch_geometric.data import Batch, Data
  from torch_geometric.nn.pool.consecutive import consecutive_cluster
  from torch_geometric.nn.pool.pool import pool_batch, pool_edge, pool_pos
  from torch_geometric.utils import add_self_loops, scatter
label_desc: Use image node_id 4 for calling a global function with example usage: avg_pool_neighbor_x(data, flow) and returns: data