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 autoregressive 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

        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 autoregressive features to `X`,
        but they still need to specify `target_series` to create labels.
        
darts/tests/utils/tabularization/test_get_feature_times.py