code: def _fit_core(
      self,
      list_series: Sequence[TimeSeries],
  ):
      list_np_series = [
          series.all_values(copy=False) for series in list_series
      ]
  
      if not self.component_wise:
          self.model = KMeans(**self.kmeans_kwargs)
          self.model.fit(
              np.concatenate(
                  [
                      sliding_window_view(
                          ar, window_shape=self.window, axis=0
                      )
                      .transpose(0, 3, 1, 2)
                      .reshape(-1, self.window * len(ar[0]))
                      for ar in list_np_series
                  ],
                  axis=0,
              )
          )
      else:
          models = []
          for component_idx in range(self.width_trained_on):
              model = KMeans(**self.kmeans_kwargs)
              model.fit(
                  np.concatenate(
                      [
                          sliding_window_view(
                              ar[:, component_idx],
                              window_shape=self.window,
                              axis=0,
                          )
                          .transpose(0, 2, 1)
                          .reshape(-1, self.window)
                          for ar in list_np_series
                      ],
                      axis=0,
                  )
              )
              models.append(model)
          self.models = models
  
file_path: darts/darts/ad/scorers/kmeans_scorer.py
imports: from typing import Sequence
  import numpy
  from numpy.lib.stride_tricks import sliding_window_view
  from sklearn.cluster import KMeans
  from darts.ad.scorers.scorers import FittableAnomalyScorer
  from darts.logging import raise_if_not
  from darts.timeseries import TimeSeries
label_desc: Use image node_id 3 for calling the KMeansScorer obj's underlying member method code with example usage: obj._fit_core(list_series) without return types