code: def test_univariate_Wasserstein(self):
      # univariate example
      np.random.seed(42)
  
      np_train_wasserstein = np.abs(
          np.random.normal(loc=0, scale=0.1, size=100)
      )
      train_wasserstein = TimeSeries.from_times_and_values(
          self.train._time_index, np_train_wasserstein
      )
  
      np_test_wasserstein = np.abs(
          np.random.normal(loc=0, scale=0.1, size=100)
      )
      np_first_anomaly = np.abs(
          np.random.normal(loc=0, scale=0.25, size=10)
      )
      np_second_anomaly = np.abs(
          np.random.normal(loc=0.25, scale=0.05, size=5)
      )
      np_third_anomaly = np.abs(
          np.random.normal(loc=0, scale=0.15, size=15)
      )
  
      np_test_wasserstein[10:20] = np_first_anomaly
      np_test_wasserstein[40:45] = np_second_anomaly
      np_test_wasserstein[70:85] = np_third_anomaly
      test_wasserstein = TimeSeries.from_times_and_values(
          self.train._time_index, np_test_wasserstein
      )
  
      # create the anomaly series
      np_anomalies = np.zeros(len(test_wasserstein))
      np_anomalies[10:17] = 1
      np_anomalies[40:42] = 1
      np_anomalies[70:85] = 1
      anomalies_wasserstein = TimeSeries.from_times_and_values(
          test_wasserstein.time_index,
          np_anomalies,
          columns=["is_anomaly"],
      )
  
      # test model with window of 10
      scorer_10 = WassersteinScorer(window=10)
      scorer_10.fit(train_wasserstein)
      auc_roc_w10 = scorer_10.eval_accuracy(
          anomalies_wasserstein, test_wasserstein, metric="AUC_ROC"
      )
      auc_pr_w10 = scorer_10.eval_accuracy(
          anomalies_wasserstein, test_wasserstein, metric="AUC_PR"
      )
  
      # test model with window of 20
      scorer_20 = WassersteinScorer(window=20)
      scorer_20.fit(train_wasserstein)
      auc_roc_w20 = scorer_20.eval_accuracy(
          anomalies_wasserstein, test_wasserstein, metric="AUC_ROC"
      )
      auc_pr_w20 = scorer_20.eval_accuracy(
          anomalies_wasserstein, test_wasserstein, metric="AUC_PR"
      )
  
      assert abs(auc_roc_w10 - 0.80637) < 1e-05
      assert abs(auc_pr_w10 - 0.83390) < 1e-05
      assert abs(auc_roc_w20 - 0.77828) < 1e-05
      assert abs(auc_pr_w20 - 0.93934) < 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 9 for calling the TestADAnomalyScorer obj's underlying member method code with example usage: obj.test_univariate_Wasserstein() without return types