code: def _get_collate_function(
      conv_type, is_multiscale, pre_collate_transform=None
  ):
      is_dense = ConvolutionFormatFactory.check_is_dense_format(
          conv_type
      )
      if is_multiscale:
          if (
              conv_type.lower()
              == ConvolutionFormat.PARTIAL_DENSE.value.lower()
          ):
              fn = PairMultiScaleBatch.from_data_list
          else:
              raise NotImplementedError(
                  "MultiscaleTransform is activated and supported only for partial_dense format"
              )
      else:
          if is_dense:
              fn = DensePairBatch.from_data_list
          else:
              fn = PairBatch.from_data_list
      return partial(
          BaseDataset._collate_fn,
          collate_fn=fn,
          pre_collate_transform=pre_collate_transform,
      )
  
imports: import numpy
  import os.path
  import random
  import torch
  import logging
  from torch_geometric.data import Data
  from torch_points_kernels.points_cpu import ball_query
  from functools import partial
  from torch_points3d.core.data_transform import MultiScaleTransform
  from torch_points3d.core.data_transform import PairTransform
  from torch_points3d.datasets.registration.pair import DensePairBatch
  from torch_points3d.utils.enums import ConvolutionFormat
  from torch_points3d.utils.config import ConvolutionFormatFactory
  from torch_points3d.datasets.registration.pair import PairMultiScaleBatch, PairBatch
  from torch_points3d.datasets.registration.pair import Pair, MultiScalePair
  from torch_points3d.datasets.registration.utils import tracked_matches
  from torch_points3d.datasets.registration.utils import compute_overlap_and_matches
  from torch_points3d.datasets.registration.utils import fps_sampling
  from torch_points3d.datasets.base_dataset import BaseDataset
  from torch_points3d.metrics.registration_tracker import PatchRegistrationTracker
  from torch_points3d.metrics.registration_tracker import FragmentRegistrationTracker
label_desc: Use image node_id 2 for calling the BaseSiameseDataset obj's underlying member method code with example usage: obj._get_collate_function(conv_type, is_multiscale, pre_collate_transform) and returns: partial