code: def _derive_all_squared_distances_fit(
      X, n_samples, n_timestamps, window_sizes, shapelets, lengths
  ):
      """Derive the squared distances between all shapelets and time series."""
      distances = []  # save the distances in a list
  
      for i in prange(len(lengths)):
          window_size = lengths[i][0]
          X_window = _windowed_view(
              X, n_samples, n_timestamps, window_size, window_step=1
          )
          for j in prange(shapelets[i].shape[0]):
              dist = _derive_shapelet_distances(
                  X_window, shapelets[i][j]
              )
              distances.append(dist)
  
      return distances
  
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 3 for calling a global function with example usage: _derive_all_squared_distances_fit(X, n_samples, n_timestamps, window_sizes, shapelets, lengths) and returns: distances