code: def test_ts_cv_generator_correct():
      """Checks if the split into training and test for time series cross
      validation is correct
  
      By default, the number of validation blocks for each fold is five
      """
      folds = 2
      (
          forecast_len,
          validation_blocks,
          time_series,
      ) = configure_experiment()
      ts_len = len(time_series.idx)
  
      # The "in-sample validation" is carried out for each fold
      validation_elements_per_fold = forecast_len * validation_blocks
      # Entire length of validation for all folds
      validation_horizon = validation_elements_per_fold * folds
  
      i = 0
      for train_data, test_data in cv_generator(
          time_series,
          cv_folds=folds,
          validation_blocks=validation_blocks,
      ):
          train_len = len(train_data.idx)
          assert train_len == ts_len - validation_horizon
          validation_horizon -= validation_elements_per_fold
          i += 1
      assert i == folds
  
imports: import datetime
  import logging
  from hyperopt import hp
  from golem.core.log import default_log
  from golem.core.optimisers.genetic.gp_params import GPAlgorithmParameters
  from golem.core.tuning.simultaneous import SimultaneousTuner
  from fedot.core.pipelines.pipeline_composer_requirements import PipelineComposerRequirements
  from examples.advanced.time_series_forecasting.composing_pipelines import get_available_operations
  from fedot import Fedot
  from fedot.core.composer.composer_builder import ComposerBuilder
  from fedot.core.pipelines.pipeline import Pipeline
  from fedot.core.pipelines.tuning.tuner_builder import TunerBuilder
  from fedot.core.repository.metrics_repository import MetricsRepository, RegressionMetricsEnum
  from fedot.core.repository.tasks import TsForecastingParams
  from fedot.core.pipelines.tuning.search_space import PipelineSearchSpace
  from fedot.core.data.cv_folds import cv_generator
  from test.unit.tasks.test_forecasting import get_simple_ts_pipeline, get_ts_data
label_desc: Use image node_id 2 for calling a global function with example usage: test_ts_cv_generator_correct() without return types