code: def _calc_knn_labels(knn_mask, split_idx, m):
      """Compute kNN indices relabeling at a given split index.
  
      Parameters
      ----------
      knn_mask : array-like, shape = [k, n-m+1], dtype=int
          The knn indices for each subsequence
      split_idx : int
          The split index to use
      m : int
          The window size to generate sliding windows
  
      Returns
      -------
      Tuple (array-like of shape=[n-m+1], array-like of shape=[n-m+1]):
          True labels and predicted labels
      """
      k_neighbours, n_timepoints = knn_mask.shape
  
      # create labels for given potential split
      y_true = np.concatenate(
          (
              np.zeros(split_idx, dtype=np.int64),
              np.ones(n_timepoints - split_idx, dtype=np.int64),
          )
      )
  
      knn_mask_labels = np.zeros(
          shape=(k_neighbours, n_timepoints), dtype=np.int64
      )
  
      # relabel the kNN indices
      for i_neighbor in range(k_neighbours):
          neighbours = knn_mask[i_neighbor]
          knn_mask_labels[i_neighbor] = y_true[neighbours]
  
      # compute kNN prediction
      ones = np.sum(knn_mask_labels, axis=0)
      zeros = k_neighbours - ones
      y_pred = np.asarray(ones > zeros, dtype=np.int64)
  
      # apply exclusion zone at split point
      exclusion_zone = np.arange(split_idx - m, split_idx)
  
      # Remove indexes outside the range of y_pred
      exclusion_zone = exclusion_zone[
          (exclusion_zone >= -len(y_pred))
          & (exclusion_zone < len(y_pred))
      ]
  
      y_pred[exclusion_zone] = np.ones(
          len(exclusion_zone), dtype=np.int64
      )
  
      return y_true, y_pred
  
file_path: sktime/sktime/transformations/series/_clasp_numba.py
imports: import numpy
  import pandas
  from sktime.transformations.panel.matrix_profile import _sliding_dot_products
  from sktime.utils.numba.njit import njit
label_desc: Use image node_id 4 for calling a global function with example usage: _calc_knn_labels(knn_mask, split_idx, m) and returns: y_true,  y_pred