code: def nearest(
      x: Tensor,
      y: Tensor,
      batch_x: OptTensor = None,
      batch_y: OptTensor = None,
  ) -> Tensor:
      r"""Finds for each element in :obj:`y` the :obj:`k` nearest point in
      :obj:`x`.
  
      .. code-block:: python
  
          import torch
          from torch_geometric.nn import nearest
  
          x = torch.tensor([[-1.0, -1.0], [-1.0, 1.0], [1.0, -1.0], [1.0, 1.0]])
          batch_x = torch.tensor([0, 0, 0, 0])
          y = torch.tensor([[-1.0, 0.0], [1.0, 0.0]])
          batch_y = torch.tensor([0, 0])
          cluster = nearest(x, y, batch_x, batch_y)
  
      Args:
          x (torch.Tensor): Node feature matrix
              :math:`\mathbf{X} \in \mathbb{R}^{N \times F}`.
          y (torch.Tensor): Node feature matrix
              :math:`\mathbf{Y} \in \mathbb{R}^{M \times F}`.
          batch_x (torch.Tensor, optional): Batch vector
              :math:`\mathbf{b} \in {\{ 0, \ldots, B-1\}}^N`, which assigns each
              node to a specific example. (default: :obj:`None`)
          batch_y (torch.Tensor, optional): Batch vector
              :math:`\mathbf{b} \in {\{ 0, \ldots, B-1\}}^M`, which assigns each
              node to a specific example. (default: :obj:`None`)
  
      :rtype: :class:`torch.Tensor`
      """
      return torch_cluster.nearest(x, y, batch_x, batch_y)
  
imports: import warnings
  from typing import Optional
  from torch import Tensor
  import torch_geometric.typing
  from torch_geometric.typing import OptTensor, torch_cluster
  from .asap import ASAPooling
  from .avg_pool import avg_pool, avg_pool_neighbor_x, avg_pool_x
  from .edge_pool import EdgePooling
  from .glob import global_add_pool, global_max_pool, global_mean_pool
  from .knn import KNNIndex, L2KNNIndex, MIPSKNNIndex
  from .graclus import graclus
  from .max_pool import max_pool, max_pool_neighbor_x, max_pool_x
  from .mem_pool import MemPooling
  from .pan_pool import PANPooling
  from .sag_pool import SAGPooling
  from .topk_pool import TopKPooling
  from .voxel_grid import voxel_grid
  from .approx_knn import approx_knn, approx_knn_graph
label_desc: Use image node_id 6 for calling a global function with example usage: nearest(x, y, batch_x, batch_y) and returns: torch_cluster