code: def test_multivariate_window_PyODScorer(self):
      # multivariate example (with different window)
  
      np.random.seed(1)
  
      # create the train set
      np_series = np.zeros(100)
      np_series[0] = 2
  
      for i in range(1, len(np_series)):
          np_series[i] = np_series[i - 1] + np.random.choice(
              a=[-1, 1], p=[0.5, 0.5]
          )
          if np_series[i] > 3:
              np_series[i] = 3
          if np_series[i] < 0:
              np_series[i] = 0
  
      ts_train = TimeSeries.from_values(np_series, columns=["series"])
  
      # create the test set
      np.random.seed(3)
      np_series = np.zeros(100)
      np_series[0] = 1
  
      for i in range(1, len(np_series)):
          np_series[i] = np_series[i - 1] + np.random.choice(
              a=[-1, 1], p=[0.5, 0.5]
          )
          if np_series[i] > 3:
              np_series[i] = 3
          if np_series[i] < 0:
              np_series[i] = 0
  
      # 3 anomalies per type
      # type 1: sudden shift between state 0 to state 2 without passing by state 1
      np_series[23] = 3
      np_series[44] = 3
      np_series[91] = 0
  
      # type 2: having consecutive timestamps at state 1 or 2
      np_series[3:5] = 2
      np_series[17:19] = 1
      np_series[62:65] = 2
  
      ts_test = TimeSeries.from_values(np_series, columns=["series"])
  
      anomalies_index = [4, 23, 18, 44, 63, 64, 91]
      np_anomalies = np.zeros(100)
      np_anomalies[anomalies_index] = 1
      ts_anomalies = TimeSeries.from_times_and_values(
          ts_test.time_index, np_anomalies, columns=["is_anomaly"]
      )
  
      pyod_scorer_w1 = PyODScorer(
          model=KNN(n_neighbors=10), component_wise=False, window=1
      )
      pyod_scorer_w1.fit(ts_train)
  
      pyod_scorer_w2 = PyODScorer(
          model=KNN(n_neighbors=10), component_wise=False, window=2
      )
      pyod_scorer_w2.fit(ts_train)
  
      auc_roc_w1 = pyod_scorer_w1.eval_accuracy(
          ts_anomalies, ts_test, metric="AUC_ROC"
      )
      auc_pr_w1 = pyod_scorer_w1.eval_accuracy(
          ts_anomalies, ts_test, metric="AUC_PR"
      )
  
      auc_roc_w2 = pyod_scorer_w2.eval_accuracy(
          ts_anomalies, ts_test, metric="AUC_ROC"
      )
      auc_pr_w2 = pyod_scorer_w2.eval_accuracy(
          ts_anomalies, ts_test, metric="AUC_PR"
      )
  
      assert abs(auc_roc_w1 - 0.5) < 1e-05
      assert abs(auc_pr_w1 - 0.07) < 1e-05
      assert abs(auc_roc_w2 - 0.957513) < 1e-05
      assert abs(auc_pr_w2 - 0.88584) < 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 17 for calling the TestADAnomalyScorer obj's underlying member method code with example usage: obj.test_multivariate_window_PyODScorer() without return types