code: def _remove_similar_shapelets(scores, start_idx, end_idx):
      """Remove self-similar shapelets."""
  
      kept_idx = []
      remaining_idx = np.full(scores.size, True)
  
      # Sort the indices by scores
      argsorted_scores = np.argsort(scores)
      sorted_start_idx = start_idx[argsorted_scores]
      sorted_end_idx = end_idx[argsorted_scores]
  
      # While there are non-similar shapelets remaining
      while np.any(remaining_idx):
          idx = argsorted_scores[remaining_idx][
              -1
          ]  # Find the best shapelet
          kept_idx.append(idx)
  
          start, end = (
              start_idx[idx],
              end_idx[idx],
          )  # Find start and end indices
  
          # Find non-similar shapelets
          remaining_idx = np.logical_and(
              np.logical_or(
                  sorted_start_idx >= end, sorted_end_idx <= start
              ),
              remaining_idx,
          )
  
      return np.array(kept_idx)
  
imports: from itertools import chain
  from joblib import delayed, Parallel
  from numba import njit, prange
  from numba.typed import List
  import numpy
  from numpy.lib.stride_tricks import as_strided
  from sklearn.base import BaseEstimator
  from sklearn.feature_selection import f_classif, mutual_info_classif
  from sklearn.utils.validation import check_array, check_is_fitted, check_random_state, check_X_y
  from ..base import UnivariateTransformerMixin
  from ..utils.utils import _windowed_view
label_desc: Use image node_id 6 for calling a global function with example usage: _remove_similar_shapelets(scores, start_idx, end_idx) and returns: np