docstr: Convert `covariates` into Sequence, if not already, and checks if their length is equal to the one of `series`.
  
  Parameters
  ----------
  covariates
      Covariate ("future" or "past") of `series`.
  series
      The series to be trained on.
  name_covariates
      Internal parameter for error message, a string indicating if it is a "future" or "past" covariates.
  
  Returns
  -------
  Sequence[TimeSeries]
      Covariate time series
docstr_tok: ["Convert","`","covariates","`","into","Sequence",",","if","not","already",",","and","checks","if","their","length","is","equal","to","the","one","of","`","series","`",".","Parameters","--","--","--","--","--","covariates","Covariate","(","``","future","''","or","``","past","''",")","of","`","series","`",".","series","The","series","to","be","trained","on",".","name_covariates","Internal","parameter","for","error","message",",","a","string","indicating","if","it","is","a","``","future","''","or","``","past","''","covariates",".","Returns","--","--","--","-","Sequence","[","TimeSeries","]","Covariate","time","series"]
code: def _prepare_covariates(
      self,
      covariates: Union[TimeSeries, Sequence[TimeSeries]],
      series: Sequence[TimeSeries],
      name_covariates: str,
  ) -> Sequence[TimeSeries]:
      """Convert `covariates` into Sequence, if not already, and checks if their length is equal to the one of `series`.
  
      Parameters
      ----------
      covariates
          Covariate ("future" or "past") of `series`.
      series
          The series to be trained on.
      name_covariates
          Internal parameter for error message, a string indicating if it is a "future" or "past" covariates.
  
      Returns
      -------
      Sequence[TimeSeries]
          Covariate time series
      """
  
      if covariates is not None:
          list_covariates = _to_list(covariates)
  
          for covariates in list_covariates:
              _assert_timeseries(
                  covariates,
                  name_covariates + "_covariates input series",
              )
  
          raise_if_not(
              len(list_covariates) == len(series),
              f"Number of {name_covariates}_covariates must match the number of given "
              + f"series, found length {len(list_covariates)} and expected {len(series)}.",
          )
  
      return list_covariates if covariates is not None else None
  
file_path: darts/darts/ad/anomaly_model/forecasting_am.py
imports: import inspect
  from typing import Dict, Optional, Sequence, Union
  import pandas
  from darts.ad.anomaly_model.anomaly_model import AnomalyModel
  from darts.ad.scorers.scorers import AnomalyScorer
  from darts.ad.utils import _assert_same_length, _assert_timeseries, _to_list
  from darts.logging import get_logger, raise_if_not
  from darts.models.forecasting.forecasting_model import ForecastingModel
  from darts.timeseries import TimeSeries
label_desc: Use image node_id 3 for calling the ForecastingAnomalyModel obj's underlying member method code with example usage: obj._prepare_covariates(covariates, series, name_covariates) and returns: unknown