code: def _score_core(self, series: TimeSeries) -> TimeSeries:
      raise_if_not(
          self.width_trained_on == series.width,
          "Input must have the same number of components as the data used for"
          + " training the Wasserstein model, found number of components equal"
          + f" to {series.width} and expected {self.width_trained_on}.",
      )
  
      np_series = series.all_values(copy=False)
      np_anomaly_score = []
  
      if not self.component_wise:
          np_anomaly_score = [
              wasserstein_distance(self.training_data, window_samples)
              for window_samples in sliding_window_view(
                  np_series, window_shape=self.window, axis=0
              )
              .transpose(0, 3, 1, 2)
              .reshape(-1, self.window * series.width)
          ]
  
          return TimeSeries.from_times_and_values(
              series.time_index[self.window - 1 :], np_anomaly_score
          )
  
      else:
          for component_idx in range(self.width_trained_on):
              score = [
                  wasserstein_distance(
                      self.training_data[component_idx, :],
                      window_samples,
                  )
                  for window_samples in sliding_window_view(
                      np_series[:, component_idx],
                      window_shape=self.window,
                      axis=0,
                  )
                  .transpose(0, 2, 1)
                  .reshape(-1, self.window)
              ]
  
              np_anomaly_score.append(score)
  
          return TimeSeries.from_times_and_values(
              series.time_index[self.window - 1 :],
              list(zip(*np_anomaly_score)),
          )
  
file_path: darts/darts/ad/scorers/wasserstein_scorer.py
imports: from typing import Sequence
  import numpy
  from numpy.lib.stride_tricks import sliding_window_view
  from scipy.stats import wasserstein_distance
  from darts.ad.scorers.scorers import FittableAnomalyScorer
  from darts.logging import get_logger, raise_if_not
  from darts.timeseries import TimeSeries
label_desc: Use image node_id 4 for calling the WassersteinScorer obj's underlying member method code with example usage: obj._score_core(series) and returns: TimeSeries, TimeSeries