code: def test_multivariate_componentwise_Wasserstein(self):
      # example multivariate WassersteinScorer component wise (True and False)
      np.random.seed(3)
      np_mts_train_wasserstein = np.abs(
          np.random.normal(loc=[0, 0], scale=[0.1, 0.2], size=[100, 2])
      )
      mts_train_wasserstein = TimeSeries.from_times_and_values(
          self.train._time_index, np_mts_train_wasserstein
      )
  
      np_mts_test_wasserstein = np.abs(
          np.random.normal(loc=[0, 0], scale=[0.1, 0.2], size=[100, 2])
      )
      np_first_anomaly_width1 = np.abs(
          np.random.normal(loc=0.5, scale=0.4, size=10)
      )
      np_first_anomaly_width2 = np.abs(
          np.random.normal(loc=0, scale=0.5, size=10)
      )
      np_first_commmon_anomaly = np.abs(
          np.random.normal(loc=0.5, scale=0.5, size=[10, 2])
      )
  
      np_mts_test_wasserstein[5:15, 0] = np_first_anomaly_width1
      np_mts_test_wasserstein[35:45, 1] = np_first_anomaly_width2
      np_mts_test_wasserstein[65:75, :] = np_first_commmon_anomaly
  
      mts_test_wasserstein = TimeSeries.from_times_and_values(
          mts_train_wasserstein._time_index, np_mts_test_wasserstein
      )
  
      # create the anomaly series width 1
      np_anomalies_width1 = np.zeros(len(mts_test_wasserstein))
      np_anomalies_width1[5:15] = 1
      np_anomalies_width1[65:75] = 1
  
      # create the anomaly series width 2
      np_anomaly_width2 = np.zeros(len(mts_test_wasserstein))
      np_anomaly_width2[35:45] = 1
      np_anomaly_width2[65:75] = 1
  
      anomalies_wasserstein_per_width = (
          TimeSeries.from_times_and_values(
              mts_test_wasserstein.time_index,
              list(zip(*[np_anomalies_width1, np_anomaly_width2])),
              columns=["is_anomaly_0", "is_anomaly_1"],
          )
      )
  
      # create the anomaly series for the entire series
      np_commmon_anomaly = np.zeros(len(mts_test_wasserstein))
      np_commmon_anomaly[5:15] = 1
      np_commmon_anomaly[35:45] = 1
      np_commmon_anomaly[65:75] = 1
      anomalies_common_wasserstein = TimeSeries.from_times_and_values(
          mts_test_wasserstein.time_index,
          np_commmon_anomaly,
          columns=["is_anomaly"],
      )
  
      # test scorer with component_wise=False
      scorer_w10_cwfalse = WassersteinScorer(
          window=10, component_wise=False
      )
      scorer_w10_cwfalse.fit(mts_train_wasserstein)
      auc_roc_cwfalse = scorer_w10_cwfalse.eval_accuracy(
          anomalies_common_wasserstein,
          mts_test_wasserstein,
          metric="AUC_ROC",
      )
  
      # test scorer with component_wise=True
      scorer_w10_cwtrue = WassersteinScorer(
          window=10, component_wise=True
      )
      scorer_w10_cwtrue.fit(mts_train_wasserstein)
      auc_roc_cwtrue = scorer_w10_cwtrue.eval_accuracy(
          anomalies_wasserstein_per_width,
          mts_test_wasserstein,
          metric="AUC_ROC",
      )
  
      assert abs(auc_roc_cwfalse - 0.94637) < 1e-05
      assert abs(auc_roc_cwtrue[0] - 0.98606) < 1e-05
      assert abs(auc_roc_cwtrue[1] - 0.96722) < 1e-05
  
imports: from typing import Sequence
  import numpy
  import pytest
  import sklearn
  from pyod.models.knn import KNN
  from scipy.stats import cauchy, expon, gamma, laplace, norm, poisson
  from darts import TimeSeries
  from darts.ad.scorers import CauchyNLLScorer
  from darts.ad.scorers import DifferenceScorer
  from darts.ad.scorers import ExponentialNLLScorer, GammaNLLScorer, GaussianNLLScorer, KMeansScorer, LaplaceNLLScorer
  from darts.ad.scorers import NormScorer
  from darts.ad.scorers import PoissonNLLScorer, PyODScorer, WassersteinScorer
  from darts.models import MovingAverageFilter
label_desc: Use image node_id 10 for calling the TestADAnomalyScorer obj's underlying member method code with example usage: obj.test_multivariate_componentwise_Wasserstein() without return types