class_docstr: If num_to_sample is provided, sample exactly
  num_to_sample points. Otherwise sample floor(pos[0] * ratio) points
class_docstr_tok: ["If","num_to_sample","is","provided",",","sample","exactly","num_to_sample","points",".","Otherwise","sample","floor","(","pos","[","0","]","*","ratio",")","points"]
code: def _get_num_to_sample(self, batch_size) -> int:
      if hasattr(self, "_num_to_sample"):
          return self._num_to_sample
      else:
          return math.floor(batch_size * self._ratio)
  
imports: from abc import ABC, abstractmethod
  import math
  import torch
  from torch_geometric.nn import voxel_grid
  from torch_geometric.nn.pool.consecutive import consecutive_cluster
  from torch_geometric.nn.pool.pool import pool_pos, pool_batch
  import torch_points_kernels
  from torch_points3d.utils.config import is_list
  from torch_points3d.utils.enums import ConvolutionFormat
label_desc: Use image node_id 3 for calling the BaseSampler obj's underlying member method code with example usage: obj._get_num_to_sample(batch_size) and returns: self, math