code: def _split_time_series(
      data: InputData, validation_blocks: Optional[int] = None, **kwargs
  ):
      """Split time series data into train and test parts
  
      :param data: InputData object to split
      :param validation_blocks: validation blocks are used for test
      """
  
      forecast_length = data.task.task_params.forecast_length
      if validation_blocks is not None:
          forecast_length *= validation_blocks
  
      target_length = len(data.target)
      train_data = _split_input_data_by_indexes(
          data,
          index=np.arange(0, target_length - forecast_length),
      )
      test_data = _split_input_data_by_indexes(
          data,
          index=np.arange(
              target_length - forecast_length, target_length
          ),
          retain_first_target=True,
      )
  
      if validation_blocks is None:
          # for in-sample
          test_data.features = train_data.features
      else:
          # for out-of-sample
          test_data.features = data.features
  
      return train_data, test_data
  
file_path: FEDOT/fedot/core/data/data_split.py
imports: from copy import deepcopy
  from typing import Tuple, Optional, Union
  import numpy
  from sklearn.model_selection import train_test_split
  from fedot.core.data.data import InputData
  from fedot.core.data.multi_modal import MultiModalData
  from fedot.core.repository.dataset_types import DataTypesEnum
  from fedot.core.repository.tasks import TaskTypesEnum
label_desc: Use image node_id 2 for calling a global function with example usage: _split_time_series(data, validation_blocks) and returns: train_data,  test_data