code: def extract_features(X, n_samples, n_windows, indices):
      X_new = np.empty((n_samples, 3 * n_windows))
      for j in range(n_windows):
          start, end = indices[j]
          arange = np.arange(
              (start - end + 1) / 2, (end + 1 - start) / 2
          )
          if end - start == 1:
              var_arange = 1.0
          else:
              var_arange = np.sum(arange**2)
  
          for i in range(n_samples):
              mean = np.mean(X[i, start:end])
              X_new[i, 3 * j] = mean
              X_new[i, 3 * j + 1] = np.std(X[i, start:end])
              X_new[i, 3 * j + 2] = (
                  np.sum((X[i, start:end] - mean) * arange) / var_arange
              )
  
      return X_new
  
imports: from math import ceil
  from numba import njit
  import numpy
  from sklearn.base import BaseEstimator
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.pipeline import Pipeline
  from sklearn.utils.validation import check_array, check_is_fitted, check_random_state
  from ..base import UnivariateClassifierMixin, UnivariateTransformerMixin
label_desc: Use image node_id 1 for calling a global function with example usage: extract_features(X, n_samples, n_windows, indices) and returns: X_new