class_docstr: Tests the `create_lagged_training_data` 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 `create_lagged_training_data` produces the same outputs
      as a simplified implementation of the 'time intersection' feature generation method (see
      `darts.utils.data.tabularization` for further details). 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_training_data` function they're helping to test.
      2. 'Specified Test Cases': these test that `create_lagged_training_data` 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.
class_docstr_tok: ["Tests","the","`","create_lagged_training_data","`","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","`","create_lagged_training_data","`","produces","the","same","outputs","as","a","simplified","implementation","of","the","'time","intersection","'","feature","generation","method","(","see","`","darts.utils.data.tabularization","`","for","further","details",")",".","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","is","n'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_training_data","`","function","they","'re","helping","to","test",".","2",".","'Specified","Test","Cases","'",":","these","test","that","`","create_lagged_training_data","`","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 `create_lagged_training_data` correctly handles case when
  `0` is included in `lags_future_covariates` (i.e. when we're using the values
  `future_covariates` at time `t` to predict the value of `target_series` at
  that same time point). This particular test checks this behaviour by using
  datetime index timeseries.
docstr_tok: ["Tests","that","`","create_lagged_training_data","`","correctly","handles","case","when","`","0","`","is","included","in","`","lags_future_covariates","`","(","i.e",".","when","we","'re","using","the","values","`","future_covariates","`","at","time","`","t","`","to","predict","the","value","of","`","target_series","`","at","that","same","time","point",")",".","This","particular","test","checks","this","behaviour","by","using","datetime","index","timeseries","."]
code: def test_lagged_training_data_positive_lags_range_idx(self):
      """
      Tests that `create_lagged_training_data` correctly handles case when
      `0` is included in `lags_future_covariates` (i.e. when we're using the values
      `future_covariates` at time `t` to predict the value of `target_series` at
      that same time point). This particular test checks this behaviour by using
      datetime index timeseries.
      """
      # Define `future` so that only value occurs one timestep *after*
      # the only possible label that can be extracted from `target_series`; the
      # only possible feature that can be created using these series utilises
      # the value of `future` one timestep after the time of the label (i.e. a lag
      # of `1` away from the only feature time):
      target = linear_timeseries(
          start=0, length=2, start_value=0, end_value=1
      )
      future = linear_timeseries(
          start=target.end_time() + target.freq,
          length=1,
          start_value=1,
          end_value=2,
      )
      # X comprises of first value of `target` (i.e. 0) and only value in `future`:
      expected_X = np.array([0.0, 1.0]).reshape(1, 2, 1)
      expected_y = np.ones((1, 1, 1))
      # Check correctness for 'moving windows' and 'time intersection' methods, as
      # well as for different `multi_models` values:
      for use_moving_windows, multi_models in product(
          [False, True], [False, True]
      ):
          X, y, times, _ = create_lagged_training_data(
              target,
              output_chunk_length=1,
              future_covariates=future,
              lags=[-1],
              lags_future_covariates=[1],
              uses_static_covariates=False,
              multi_models=multi_models,
              use_moving_windows=use_moving_windows,
          )
          assert np.allclose(expected_X, X)
          assert np.allclose(expected_y, y)
          assert len(times[0]) == 1
          assert times[0][0] == target.end_time()
  
imports: import warnings
  from itertools import product
  from typing import Optional, Sequence
  import numpy
  import pandas
  import pytest
  from darts import TimeSeries
  from darts import concatenate
  from darts.logging import get_logger, raise_if, raise_if_not, raise_log
  from darts.utils.data.tabularization import create_lagged_component_names, create_lagged_training_data
  from darts.utils.timeseries_generation import linear_timeseries
label_desc: Use image node_id 22 for calling the TestCreateLaggedTrainingData obj's underlying member method code with example usage: obj.test_lagged_training_data_positive_lags_range_idx() without return types