class_docstr: implementation of get_fragment and get_name to avoid repetitions
code: def get_fragment(self, idx):
      data_source, data_target, new_pair = self.get_raw_pair(idx)
  
      if self.transform is not None:
          data_source = self.transform(data_source)
          data_target = self.transform(data_target)
      if hasattr(data_source, "multiscale"):
          batch = MultiScalePair.make_pair(data_source, data_target)
      else:
          batch = Pair.make_pair(data_source, data_target)
      if self.is_online_matching:
          new_match = compute_overlap_and_matches(
              Data(pos=data_source.pos),
              Data(pos=data_target.pos),
              self.max_dist_overlap,
          )
          batch.pair_ind = torch.from_numpy(new_match["pair"].copy())
      else:
          pair = tracked_matches(data_source, data_target, new_pair)
          batch.pair_ind = pair
  
      num_pos_pairs = len(batch.pair_ind)
      if self.num_pos_pairs < len(batch.pair_ind):
          num_pos_pairs = self.num_pos_pairs
  
      if not self.use_fps or (
          float(num_pos_pairs) / len(batch.pair_ind) >= 1
      ):
          rand_ind = torch.randperm(len(batch.pair_ind))[:num_pos_pairs]
      else:
          rand_ind = fps_sampling(
              batch.pair_ind, batch.pos, num_pos_pairs
          )
      batch.pair_ind = batch.pair_ind[rand_ind]
      batch.size_pair_ind = torch.tensor([num_pos_pairs])
      if len(batch.pair_ind) == 0:
          log.warning("Warning")
      return batch.contiguous()
  
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 3 for calling the GeneralFragment obj's underlying member method code with example usage: obj.get_fragment(idx) and returns: batch