code: def prepare_data(time_series, exog_variable, len_forecast=250):
      time_series = np.array(time_series)
      exog_variable = np.array(exog_variable)
  
      train_input, predict_input = train_test_data_setup(
          InputData(
              idx=np.arange(len(time_series)),
              features=time_series,
              target=time_series,
              task=Task(
                  TaskTypesEnum.ts_forecasting,
                  TsForecastingParams(forecast_length=len_forecast),
              ),
              data_type=DataTypesEnum.ts,
          )
      )
  
      # Exogenous time series
      task = Task(
          TaskTypesEnum.ts_forecasting,
          TsForecastingParams(forecast_length=len_forecast),
      )
  
      predict_input_exog = InputData(
          idx=np.arange(len(exog_variable)),
          features=exog_variable,
          target=time_series,
          task=task,
          data_type=DataTypesEnum.ts,
      )
      train_input_exog, predict_input_exog = train_test_data_setup(
          predict_input_exog
      )
  
      return (
          train_input,
          predict_input,
          train_input_exog,
          predict_input_exog,
          predict_input.target,
      )
  
imports: import os
  from copy import deepcopy
  import numpy
  import pandas
  from matplotlib import pyplot
  from sklearn.metrics import mean_squared_error, mean_absolute_error
  from fedot.core.data.data import InputData
  from fedot.core.data.data_split import train_test_data_setup
  from fedot.core.data.multi_modal import MultiModalData
  from fedot.core.pipelines.node import PipelineNode
  from fedot.core.pipelines.pipeline import Pipeline
  from fedot.core.repository.dataset_types import DataTypesEnum
  from fedot.core.repository.tasks import Task, TsForecastingParams, TaskTypesEnum
label_desc: Use image node_id 2 for calling a global function with example usage: prepare_data(time_series, exog_variable, len_forecast) and returns: train_input,  predict_input,  train_input_exog,  predict_input_exog,  predict_input