code: def compute_overlap_and_matches(
      data1,
      data2,
      max_distance_overlap,
      reciprocity=False,
      num_pos=1,
      trans_gt=torch.eye(4),
  ):
      # we can use ball query on cpu because the points are sorted
      # print(len(data1.pos), len(data2.pos), max_distance_overlap)
      pair, dist = ball_query(
          data2.pos.to(torch.float),
          data1.pos.to(torch.float) @ trans_gt[:3, :3].T
          + trans_gt[:3, 3],
          radius=max_distance_overlap,
          max_num=num_pos,
          mode=1,
          sorted=True,
      )
      pair = filter_pair(pair, dist)
      pair2 = []
      overlap = [pair.shape[0] / len(data1.pos)]
      if reciprocity:
          pair2, dist2 = ball_query(
              data1.pos.to(torch.float) @ trans_gt[:3, :3].T
              + trans_gt[:3, 3],
              data2.pos.to(torch.float),
              radius=max_distance_overlap,
              max_num=num_pos,
              mode=1,
              sorted=True,
          )
          pair2 = filter_pair(pair2, dist2)
          overlap.append(pair2.shape[0] / len(data2.pos))
      # overlap = pair.shape[0] / \
      #    (len(data1.pos) + len(data2.pos) - pair.shape[0])
      # print(pair)
  
      # print(path1, path2, "overlap=", overlap)
      output = dict(pair=pair, pair2=pair2, overlap=overlap)
      return output
  
imports: import collections
  import errno
  import numpy
  import os
  import os.path
  import torch
  from torch_geometric.data import Data
  from torch_points_kernels.points_cpu import ball_query
  import imageio
  from tqdm.auto import tqdm
  from torch_points3d.core.data_transform import GridSampling3D, SaveOriginalPosId
  from torch_geometric.transforms import Compose
  import torch_points3d.datasets.registration.fusion
  from torch_cluster import fps
label_desc: Use image node_id 9 for calling a global function with example usage: compute_overlap_and_matches(data1, data2, max_distance_overlap, reciprocity, num_pos, trans_gt) and returns: output