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` produces `X`, `y`, and `times`
  outputs that are consistent with those generated by using the helper
  functions `get_feature_times`, `construct_X_block`, and `construct_labels`.
  Consistency is checked over all of the combinations of parameter values
  specified by `self.target_lag_combos`, `self.covariates_lag_combos`,
  `self.output_chunk_length_combos`, `self.multi_models_combos`, and
  `self.max_samples_per_ts_combos`.
  
  This particular test uses timeseries with range time indices of unequal
  frequencies. Since all of the timeseries are *not* of the same frequency,
  the implementation of the 'time intersection' method is being tested here.
docstr_tok: ["Tests","that","`","create_lagged_training_data","`","produces","`","X","`",",","`","y","`",",","and","`","times","`","outputs","that","are","consistent","with","those","generated","by","using","the","helper","functions","`","get_feature_times","`",",","`","construct_X_block","`",",","and","`","construct_labels","`",".","Consistency","is","checked","over","all","of","the","combinations","of","parameter","values","specified","by","`","self.target_lag_combos","`",",","`","self.covariates_lag_combos","`",",","`","self.output_chunk_length_combos","`",",","`","self.multi_models_combos","`",",","and","`","self.max_samples_per_ts_combos","`",".","This","particular","test","uses","timeseries","with","range","time","indices","of","unequal","frequencies",".","Since","all","of","the","timeseries","are","*","not","*","of","the","same","frequency",",","the","implementation","of","the","'time","intersection","'","method","is","being","tested","here","."]
code: def test_lagged_training_data_unequal_freq_range_index(self):
      """
      Tests that `create_lagged_training_data` produces `X`, `y`, and `times`
      outputs that are consistent with those generated by using the helper
      functions `get_feature_times`, `construct_X_block`, and `construct_labels`.
      Consistency is checked over all of the combinations of parameter values
      specified by `self.target_lag_combos`, `self.covariates_lag_combos`,
      `self.output_chunk_length_combos`, `self.multi_models_combos`, and
      `self.max_samples_per_ts_combos`.
  
      This particular test uses timeseries with range time indices of unequal
      frequencies. Since all of the timeseries are *not* of the same frequency,
      the implementation of the 'time intersection' method is being tested here.
      """
      # Define range index timeseries - each has different number of components,
      # different start times, different lengths, different values, and different
      # frequencies:
      target = self.create_multivariate_linear_timeseries(
          n_components=2,
          start_value=0,
          end_value=10,
          start=2,
          length=20,
          freq=1,
      )
      past = self.create_multivariate_linear_timeseries(
          n_components=3,
          start_value=10,
          end_value=20,
          start=4,
          length=10,
          freq=2,
      )
      future = self.create_multivariate_linear_timeseries(
          n_components=4,
          start_value=20,
          end_value=30,
          start=6,
          length=7,
          freq=3,
      )
      # Conduct test for each input parameter combo:
      for (
          lags,
          lags_past,
          lags_future,
          output_chunk_length,
          multi_models,
          max_samples_per_ts,
      ) in product(
          self.target_lag_combos,
          self.past_lag_combos,
          self.future_lag_combos,
          self.output_chunk_length_combos,
          self.multi_models_combos,
          self.max_samples_per_ts_combos,
      ):
          all_lags = (lags, lags_past, lags_future)
          # Skip test where all lags are `None` - can't assemble features and
          # labels for this single combo of input params:
          lags_is_none = [x is None for x in all_lags]
          if all(lags_is_none):
              continue
          X, y, times, _ = create_lagged_training_data(
              target,
              output_chunk_length,
              past_covariates=past if lags_past else None,
              future_covariates=future if lags_future else None,
              lags=lags,
              lags_past_covariates=lags_past,
              lags_future_covariates=lags_future,
              uses_static_covariates=False,
              multi_models=multi_models,
              max_samples_per_ts=max_samples_per_ts,
              use_moving_windows=False,
          )
          feats_times = self.get_feature_times(
              target,
              past,
              future,
              lags,
              lags_past,
              lags_future,
              output_chunk_length,
              max_samples_per_ts,
          )
          # Construct `X` by constructing each block, then concatenate these
          # blocks together along component axis:
          X_target = self.construct_X_block(target, feats_times, lags)
          X_past = self.construct_X_block(past, feats_times, lags_past)
          X_future = self.construct_X_block(
              future, feats_times, lags_future
          )
          all_X = (X_target, X_past, X_future)
          to_concat = [x for x in all_X if x is not None]
          expected_X = np.concatenate(to_concat, axis=1)
          expected_y = self.create_y(
              target, feats_times, output_chunk_length, multi_models
          )
          # Number of observations should match number of feature times:
          assert X.shape[0] == len(feats_times)
          assert y.shape[0] == len(feats_times)
          assert X.shape[0] == len(times[0])
          assert y.shape[0] == len(times[0])
          # Check that outputs match:
          assert np.allclose(expected_X, X[:, :, 0])
          assert np.allclose(expected_y, y[:, :, 0])
          assert feats_times.equals(times[0])
  
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 10 for calling the TestCreateLaggedTrainingData obj's underlying member method code with example usage: obj.test_lagged_training_data_unequal_freq_range_index() without return types