class_docstr: Tests `_get_feature_times` function defined in `darts.utils.data.tabularization`. There
  are broadly two 'groups' of tests defined in this module:
      1. 'Generated Test Cases': these test that `_get_feature_times` produces the same outputs
      as a simplified implementation of this same function. For these tests, the 'correct answer' is not
      directly specified; instead, it is generated from a set of input parameters using the set of simplified
      functions. The rationale behind this approach is that it allows for many different combinations of input
      values to be effortlessly tested. The drawback of this, however, is that the correctness of these tests
      assumes that the simplified functions have been implemented correctly - if this isn't the case, then these
      tests are not to be trusted. In saying this, these simplified functions are significantly easier to
      understand and debug than the `create_lagged_prediction_data` function they're helping to test.
      2. 'Specified Test Cases': these test that `_get_feature_times` returns an exactly specified output; these
      specified outputs are *not* 'generated' by another function. Although these 'specified' test cases tend to
      be simpler and less extensive than the 'generated' test cases, their correctness does not assume the correct
      implementation of any other function.
docstr: Tests that `_get_feature_times` throws correct warning when
  a series is specified by its corresponding lag is not, or
  vice versa. The only circumstance under which a warning
  should *not* be issued is when `target_series` is specified,
  but `lags` is not when `is_training = True`; this is because
  the user may not want to add auto-regressive features to `X`,
  but they still need to specify `target_series` to create labels.
docstr_tok: ["Tests","that","`","_get_feature_times","`","throws","correct","warning","when","a","series","is","specified","by","its","corresponding","lag","is","not",",","or","vice","versa",".","The","only","circumstance","under","which","a","warning","should","*","not","*","be","issued","is","when","`","target_series","`","is","specified",",","but","`","lags","`","is","not","when","`","is_training","=","True","`",";","this","is","because","the","user","may","not","want","to","add","auto-regressive","features","to","`","X","`",",","but","they","still","need","to","specify","`","target_series","`","to","create","labels","."]
code: def test_feature_times_unspecified_lag_or_series_warning(self):
      """
      Tests that `_get_feature_times` throws correct warning when
      a series is specified by its corresponding lag is not, or
      vice versa. The only circumstance under which a warning
      should *not* be issued is when `target_series` is specified,
      but `lags` is not when `is_training = True`; this is because
      the user may not want to add auto-regressive features to `X`,
      but they still need to specify `target_series` to create labels.
      """
      # Define some arbitrary input values:
      target = linear_timeseries(start=1, length=20, freq=1)
      past = linear_timeseries(start=2, length=25, freq=2)
      future = linear_timeseries(start=3, length=30, freq=3)
      lags = [-1, -2]
      lags_past = [-2, -5]
      lags_future = [-3, -5]
      # Specify `future_covariates` but not `lags_future_covariates` when `is_training = False`
      with warnings.catch_warnings(record=True) as w:
          _ = _get_feature_times(
              past_covariates=past,
              future_covariates=future,
              lags_past_covariates=lags_past,
              is_training=False,
          )
          assert len(w) == 1
          assert issubclass(w[0].category, UserWarning)
          assert str(w[0].message) == (
              "`future_covariates` was specified without accompanying "
              "`lags_future_covariates` and, thus, will be ignored."
          )
      # Specify `lags_future_covariates` but not `future_covariates` when `is_training = False`
      with warnings.catch_warnings(record=True) as w:
          _ = _get_feature_times(
              past_covariates=past,
              lags_past_covariates=lags_past,
              lags_future_covariates=lags_future,
              is_training=False,
          )
          assert len(w) == 1
          assert issubclass(w[0].category, UserWarning)
          assert str(w[0].message) == (
              "`lags_future_covariates` was specified without accompanying "
              "`future_covariates` and, thus, will be ignored."
          )
      # Specify `future_covariates` but not `lags_future_covariates` and
      # `target_series` but not lags, when `is_training = True`
      with warnings.catch_warnings(record=True) as w:
          _ = _get_feature_times(
              target_series=target,
              past_covariates=past,
              future_covariates=future,
              lags_past_covariates=lags_past,
              output_chunk_length=1,
              is_training=True,
          )
          assert len(w) == 1
          assert issubclass(w[0].category, UserWarning)
          assert str(w[0].message) == (
              "`future_covariates` was specified without accompanying "
              "`lags_future_covariates` and, thus, will be ignored."
          )
      # Specify `lags_future_covariates` but not `future_covariates`, and
      # `target_series` but not lags, when `is_training = True`
      with warnings.catch_warnings(record=True) as w:
          _ = _get_feature_times(
              target_series=target,
              past_covariates=past,
              lags_past_covariates=lags_past,
              lags_future_covariates=lags_future,
              output_chunk_length=1,
              is_training=True,
          )
          assert len(w) == 1
          assert issubclass(w[0].category, UserWarning)
          assert str(w[0].message) == (
              "`lags_future_covariates` was specified without accompanying "
              "`future_covariates` and, thus, will be ignored."
          )
      # Specify `lags_future_covariates` but not `future_covariates`, and
      # `past_covariates` but not `lags_past_covariates`, when `is_training = True`
      with warnings.catch_warnings(record=True) as w:
          _ = _get_feature_times(
              target_series=target,
              past_covariates=past,
              lags=lags,
              lags_future_covariates=lags_future,
              is_training=False,
          )
          assert len(w) == 2
          assert issubclass(w[0].category, UserWarning)
          assert issubclass(w[1].category, UserWarning)
          assert str(w[0].message) == (
              "`past_covariates` was specified without accompanying "
              "`lags_past_covariates` and, thus, will be ignored."
          )
          assert str(w[1].message) == (
              "`lags_future_covariates` was specified without accompanying "
              "`future_covariates` and, thus, will be ignored."
          )
      # Specify `lags_future_covariates` but not `future_covariates`, and
      # `past_covariates` but not `lags_past_covariates`, and `target_series`
      # but not `lags` when `is_training = False`:
      with warnings.catch_warnings(record=True) as w:
          _ = _get_feature_times(
              target_series=target,
              past_covariates=past,
              lags_future_covariates=lags_future,
              output_chunk_length=1,
              is_training=True,
          )
          assert len(w) == 2
          assert issubclass(w[0].category, UserWarning)
          assert issubclass(w[1].category, UserWarning)
          assert str(w[0].message) == (
              "`past_covariates` was specified without accompanying "
              "`lags_past_covariates` and, thus, will be ignored."
          )
          assert str(w[1].message) == (
              "`lags_future_covariates` was specified without accompanying "
              "`future_covariates` and, thus, will be ignored."
          )
      # Specify `target_series` but not `lags` when `is_training = False`:
      with warnings.catch_warnings(record=True) as w:
          _ = _get_feature_times(
              target_series=target,
              past_covariates=past,
              future_covariates=future,
              lags_past_covariates=lags_past,
              lags_future_covariates=lags_future,
              is_training=False,
          )
          assert len(w) == 1
          assert issubclass(w[0].category, UserWarning)
      # Specify `target_series` but not `lags` when `is_training = True`;
      # this should *not* throw a warning:
      with warnings.catch_warnings(record=True) as w:
          _ = _get_feature_times(
              target_series=target,
              past_covariates=past,
              future_covariates=future,
              lags_past_covariates=lags_past,
              lags_future_covariates=lags_future,
              is_training=True,
          )
          assert len(w) == 0
  
imports: import warnings
  from itertools import product
  from typing import Sequence
  import pandas
  import pytest
  from darts import TimeSeries
  from darts.logging import get_logger, raise_log
  from darts.utils.data.tabularization import _get_feature_times
  from darts.utils.timeseries_generation import linear_timeseries
label_desc: Use image node_id 22 for calling the TestGetFeatureTimes obj's underlying member method code with example usage: obj.test_feature_times_unspecified_lag_or_series_warning() without return types