code: def fps(
      x: Tensor,
      batch: OptTensor = None,
      ratio: float = 0.5,
      random_start: bool = True,
      batch_size: Optional[int] = None,
  ) -> Tensor:
      r"""A sampling algorithm from the `"PointNet++: Deep Hierarchical Feature
      Learning on Point Sets in a Metric Space"
      <https://arxiv.org/abs/1706.02413>`_ paper, which iteratively samples the
      most distant point with regard to the rest points.
  
      .. code-block:: python
  
          import torch
          from torch_geometric.nn import fps
  
          x = torch.tensor([[-1.0, -1.0], [-1.0, 1.0], [1.0, -1.0], [1.0, 1.0]])
          batch = torch.tensor([0, 0, 0, 0])
          index = fps(x, batch, ratio=0.5)
  
      Args:
          x (torch.Tensor): Node feature matrix
              :math:`\mathbf{X} \in \mathbb{R}^{N \times F}`.
          batch (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`)
          ratio (float, optional): Sampling ratio. (default: :obj:`0.5`)
          random_start (bool, optional): If set to :obj:`False`, use the first
              node in :math:`\mathbf{X}` as starting node. (default: obj:`True`)
          batch_size (int, optional): The number of examples :math:`B`.
              Automatically calculated if not given. (default: :obj:`None`)
  
      :rtype: :class:`torch.Tensor`
      """
      if not torch_geometric.typing.WITH_TORCH_CLUSTER_BATCH_SIZE:
          return torch_cluster.fps(x, batch, ratio, random_start)
      return torch_cluster.fps(
          x, batch, ratio, random_start, batch_size
      )
  
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 1 for calling a global function with example usage: fps(x, batch, ratio, random_start, batch_size) and returns: torch_cluster, torch_cluster