code: def prepare_train_test_input(train_part, len_forecast):
      """Function return prepared data for fit and predict
  
      :param len_forecast: forecast length
      :param train_part: time series which can be used as predictors for train
  
      :return train_input: Input Data for fit
      :return predict_input: Input Data for predict
      :return task: Time series forecasting task with parameters
      """
  
      task = Task(
          TaskTypesEnum.ts_forecasting,
          TsForecastingParams(forecast_length=len_forecast),
      )
  
      train_input = InputData(
          idx=np.arange(0, len(train_part)),
          features=train_part,
          target=train_part,
          task=task,
          data_type=DataTypesEnum.ts,
      )
  
      start_forecast = len(train_part)
      end_forecast = start_forecast + len_forecast
      predict_input = InputData(
          idx=np.arange(start_forecast, end_forecast),
          features=train_part,
          target=None,
          task=task,
          data_type=DataTypesEnum.ts,
      )
  
      return train_input, predict_input, task
  
file_path: FEDOT/examples/advanced/time_series_forecasting/sparse_lagged_tuning.py
imports: import os
  import timeit
  import warnings
  import matplotlib.pyplot
  import numpy
  import pandas
  from golem.core.tuning.simultaneous import SimultaneousTuner
  from sklearn.metrics import mean_absolute_error
  from examples.simple.time_series_forecasting.ts_pipelines import ts_complex_dtreg_pipeline
  from fedot.core.data.data import InputData
  from fedot.core.pipelines.tuning.tuner_builder import TunerBuilder
  from fedot.core.repository.dataset_types import DataTypesEnum
  from fedot.core.repository.metrics_repository import RegressionMetricsEnum
  from fedot.core.repository.tasks import Task, TaskTypesEnum, TsForecastingParams
  from fedot.core.utils import fedot_project_root
label_desc: Use image node_id 1 for calling a global function with example usage: prepare_train_test_input(train_part, len_forecast) and returns: train_input,  predict_input,  task