code: def _check_lags(
      lags: Optional[Union[Sequence[int], Dict[str, List[int]]]],
      lags_past_covariates: Optional[
          Union[Sequence[int], Dict[str, List[int]]]
      ],
      lags_future_covariates: Optional[
          Union[Sequence[int], Dict[str, List[int]]]
      ],
  ) -> None:
      """
      Throws `ValueError` if any `lag` values aren't negative OR if no lags have been specified.
      """
      all_lags = [lags, lags_past_covariates, lags_future_covariates]
      suffixes = ["", "_past_covariates", "_future_covariates"]
      lags_is_none = []
      for i, (suffix, lags_i) in enumerate(zip(suffixes, all_lags)):
          lags_is_none.append(lags_i is None)
          if not lags_is_none[-1]:
              is_target_or_past = i < 2
              max_lag = -1 if is_target_or_past else inf
  
              if isinstance(lags_i, dict):
                  lags_i = list(set(chain(*lags_i.values())))
  
              raise_if(
                  any(
                      (lag > max_lag or not isinstance(lag, int))
                      for lag in lags_i
                  ),
                  f"`lags{suffix}` must be a `Sequence` or `Dict` containing only `int` values less than {max_lag + 1}.",
              )
      raise_if(
          all(lags_is_none),
          "Must specify at least one of: `lags`, `lags_past_covariates`, `lags_future_covariates`.",
      )
      return None
  
imports: import warnings
  from functools import reduce
  from math import inf
  from typing import Dict, List, Optional, Sequence, Tuple, Union
  from itertools import chain
  import numpy
  import pandas
  from numpy.lib.stride_tricks import as_strided
  from darts.logging import get_logger, raise_if, raise_if_not, raise_log
  from darts.timeseries import TimeSeries
  from darts.utils.utils import get_single_series, series2seq
label_desc: Use image node_id 16 for calling a global function with example usage: _check_lags(lags, lags_past_covariates, lags_future_covariates) and returns: None