code: def test_FitForecastingAnomalyModelInput(self):
      for anomaly_model in [
          ForecastingAnomalyModel(
              model=RegressionModel(lags=10), scorer=NormScorer()
          ),
          ForecastingAnomalyModel(
              model=RegressionModel(lags=10),
              scorer=[NormScorer(), KMeansScorer()],
          ),
          ForecastingAnomalyModel(
              model=RegressionModel(lags=10), scorer=KMeansScorer()
          ),
      ]:
          # input 'series' must be a series or Sequence of series
          with pytest.raises(ValueError):
              anomaly_model.fit(
                  [self.train, "str"], allow_model_training=True
              )
          with pytest.raises(ValueError):
              anomaly_model.fit(
                  [[self.train, self.train]], allow_model_training=True
              )
          with pytest.raises(ValueError):
              anomaly_model.fit("str", allow_model_training=True)
          with pytest.raises(ValueError):
              anomaly_model.fit([1, 2, 3], allow_model_training=True)
  
          # allow_model_training must be a bool
          with pytest.raises(ValueError):
              anomaly_model.fit(self.train, allow_model_training=1)
          with pytest.raises(ValueError):
              anomaly_model.fit(self.train, allow_model_training="True")
  
          # 'allow_model_training' must be set to True if forecasting model is not fitted
          if anomaly_model.scorers_are_trainable:
              with pytest.raises(ValueError):
                  anomaly_model.fit(
                      self.train, allow_model_training=False
                  )
                  anomaly_model.score(self.train)
  
          with pytest.raises(ValueError):
              # number of 'past_covariates' must be the same as the number of Timeseries in 'series'
              anomaly_model.fit(
                  series=[self.train, self.train],
                  past_covariates=self.covariates,
                  allow_model_training=True,
              )
  
          with pytest.raises(ValueError):
              # number of 'past_covariates' must be the same as the number of Timeseries in 'series'
              anomaly_model.fit(
                  series=self.train,
                  past_covariates=[self.covariates, self.covariates],
                  allow_model_training=True,
              )
  
          with pytest.raises(ValueError):
              # number of 'future_covariates' must be the same as the number of Timeseries in 'series'
              anomaly_model.fit(
                  series=[self.train, self.train],
                  future_covariates=self.covariates,
                  allow_model_training=True,
              )
  
          with pytest.raises(ValueError):
              # number of 'future_covariates' must be the same as the number of Timeseries in 'series'
              anomaly_model.fit(
                  series=self.train,
                  future_covariates=[self.covariates, self.covariates],
                  allow_model_training=True,
              )
  
      fitted_model = RegressionModel(lags=10).fit(self.train)
      # Fittable scorer must be fitted before calling .score(), even if forecasting model is fitted
      with pytest.raises(ValueError):
          ForecastingAnomalyModel(
              model=fitted_model, scorer=KMeansScorer()
          ).score(series=self.test)
      with pytest.raises(ValueError):
          ForecastingAnomalyModel(
              model=fitted_model, scorer=[NormScorer(), KMeansScorer()]
          ).score(series=self.test)
  
      # forecasting model that do not accept past/future covariates
      anomaly_model = ForecastingAnomalyModel(
          model=NaiveSeasonal(), scorer=NormScorer()
      )
      with pytest.raises(TypeError):
          anomaly_model.fit(
              series=self.train,
              past_covariates=self.covariates,
              allow_model_training=True,
          )
      anomaly_model = ForecastingAnomalyModel(
          model=NaiveSeasonal(), scorer=NormScorer()
      )
      with pytest.raises(TypeError):
          anomaly_model.fit(
              series=self.train,
              future_covariates=self.covariates,
              allow_model_training=True,
          )
  
      # check window size
      # max window size is len(series.drop_before(series.get_timestamp_at_point(start))) + 1
      with pytest.raises(ValueError):
          ForecastingAnomalyModel(
              model=RegressionModel(lags=10),
              scorer=KMeansScorer(window=50),
          ).fit(series=self.train, start=0.9)
  
      # forecasting model that cannot be trained on a list of series
      with pytest.raises(ValueError):
          ForecastingAnomalyModel(
              model=NaiveSeasonal(), scorer=NormScorer()
          ).fit(
              series=[self.train, self.train], allow_model_training=True
          )
  
imports: from typing import Dict, Sequence, Tuple
  import numpy
  import pandas
  import pytest
  from pyod.models.knn import KNN
  from darts import TimeSeries
  from darts.ad import AndAggregator
  from darts.ad import EnsembleSklearnAggregator
  from darts.ad import OrAggregator
  from darts.ad import QuantileDetector
  from darts.ad import ThresholdDetector
  from darts.ad import CauchyNLLScorer
  from darts.ad import DifferenceScorer
  from darts.ad import ExponentialNLLScorer, FilteringAnomalyModel, ForecastingAnomalyModel, GammaNLLScorer, GaussianNLLScorer, KMeansScorer, LaplaceNLLScorer, NormScorer, PoissonNLLScorer, PyODScorer, WassersteinScorer
  from darts.ad.utils import eval_accuracy_from_scores, show_anomalies_from_scores
  from darts.models import MovingAverageFilter, NaiveSeasonal, RegressionModel
label_desc: Use image node_id 4 for calling the TestADAnomalyModel obj's underlying member method code with example usage: obj.test_FitForecastingAnomalyModelInput() without return types