code: def split_points_by_order(
      tpoints, groups
  ):  # todo check if point have dimension problem
      points = tpoints.numpy()
      num_groups = len(groups)
      bs = points.shape[0]
      num_points = points.shape[1] // 2
  
      groups = [x if x > 0 else num_points for x in groups]
      group_points = [
          np.full((bs, 2 * x, 3), -1, dtype=np.float32) for x in groups
      ]
  
      last_point_indx_group = np.zeros(
          (bs, num_groups, 2), dtype=np.int
      )
      for group_indx, group_size in enumerate(groups):
          last_point_indx_group[:, group_indx, 1] = group_size
  
      for bindx in range(bs):
          for pindx in range(2 * num_points):
              point = points[bindx, pindx, :]
              group_id = int(point[2])
              if group_id < 0:
                  continue
  
              is_negative = int(pindx >= num_points)
              if group_id >= num_groups or (
                  group_id == 0 and is_negative
              ):  # disable negative first click
                  group_id = num_groups - 1
  
              new_point_indx = last_point_indx_group[
                  bindx, group_id, is_negative
              ]
              last_point_indx_group[bindx, group_id, is_negative] += 1
  
              group_points[group_id][bindx, new_point_indx, :] = point
  
      group_points = [
          paddle.to_tensor(x, dtype=tpoints.dtype) for x in group_points
      ]
  
      return group_points
  
imports: import os
  import sys
  import paddle
  import paddle.nn
  import numpy
  from inference.ops import DistMaps3D, ScaleLayer, BatchImageNormalize3D
  from paddleseg.utils import utils
label_desc: Use image node_id 1 for calling a global function with example usage: split_points_by_order(tpoints, groups) and returns: group_points