code: def compute_spaced_time_frame(list_name_frames, path, min_dist):
      """
      compute spaced time frame to have different pairs.
      Inspired by
      """
      list_pair = []
      list_sensor_pos = []
      for name in list_name_frames:
          data = torch.load(osp.join(path, name))
          list_sensor_pos.append(data.pos_sensor)
  
      list_sensor_pos = torch.stack(list_sensor_pos)
  
      mask = (
          (list_sensor_pos.unsqueeze(0) - list_sensor_pos.unsqueeze(1))
          ** 2
      ).sum(2) > (min_dist**2)
      curr_ind = 0
  
      for curr_ind in range(len(list_name_frames)):
          candidates = torch.where(
              mask[curr_ind, curr_ind : curr_ind + 100]
          )[0]
          if len(candidates) > 0:
              new_ind = curr_ind + candidates[0].item()
              list_pair.append((curr_ind, new_ind))
          else:
              continue
      return list_pair
  
imports: import glob
  import json
  import logging
  import numpy
  import os
  import os.path
  import shutil
  import torch
  from torch_geometric.data import Dataset, download_url, extract_zip
  from torch_geometric.data import Data
  from torch_points3d.datasets.registration.detector import RandomDetector
  from torch_points3d.datasets.registration.utils import rgbd2fragment_rough
  from torch_points3d.datasets.registration.utils import rgbd2fragment_fine
  from torch_points3d.datasets.registration.utils import compute_overlap_and_matches
  from torch_points3d.datasets.registration.utils import to_list
  from torch_points3d.datasets.registration.utils import files_exist
  from torch_points3d.datasets.registration.utils import makedirs
  from torch_points3d.datasets.registration.utils import get_urls
  from torch_points3d.datasets.registration.utils import PatchExtractor
label_desc: Use image node_id 2 for calling a global function with example usage: compute_spaced_time_frame(list_name_frames, path, min_dist) and returns: list_pair