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 __init__(
      self, ratio=None, num_to_sample=None, subsampling_param=None
  ):
      if num_to_sample is not None:
          if (ratio is not None) or (subsampling_param is not None):
              raise ValueError(
                  "Can only specify ratio or num_to_sample or subsampling_param, not several !"
              )
          self._num_to_sample = num_to_sample
  
      elif ratio is not None:
          self._ratio = ratio
  
      elif subsampling_param is not None:
          self._subsampling_param = subsampling_param
  
      else:
          raise Exception(
              'At least ["ratio, num_to_sample, subsampling_param"] should be defined'
          )
  
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 1 to create a new BaseSampler object from inherited base classes: ABC with example: obj = BaseSampler(ratio, num_to_sample, subsampling_param)