code: def run_nemo_based_forecasting(
      time_series, exog_variable, len_forecast=60, visualization=False
  ):
      errors_df = {}
  
      (
          train_input,
          predict_input,
          train_input_exog,
          predict_input_exog,
          test_data,
      ) = prepare_data(
          time_series=time_series,
          exog_variable=exog_variable,
          len_forecast=len_forecast,
      )
  
      pipelines = {
          "ARIMA": {
              "tr_nodes_data": {"arima": train_input},
              "pr_nodes_data": {"arima": predict_input},
              "model": get_arima_pipeline(),
          },
          "STL_ARIMA": {
              "tr_nodes_data": {"stl_arima": train_input},
              "pr_nodes_data": {"stl_arima": predict_input},
              "model": get_stlarima_pipeline(),
          },
          "RIDGE": {
              "tr_nodes_data": {
                  "lagged/1": train_input,
                  "lagged/2": train_input,
              },
              "pr_nodes_data": {
                  "lagged/1": predict_input,
                  "lagged/2": predict_input,
              },
              "model": get_ridge_pipeline(),
          },
          "ARIMA_NEMO": {
              "tr_nodes_data": {
                  "arima": train_input,
                  "exog_ts": train_input_exog,
              },
              "pr_nodes_data": {
                  "arima": predict_input,
                  "exog_ts": predict_input_exog,
              },
              "model": get_arima_nemo_pipeline(),
          },
          "STL_ARIMA_NEMO": {
              "tr_nodes_data": {
                  "stl_arima": train_input,
                  "exog_ts": train_input_exog,
              },
              "pr_nodes_data": {
                  "stl_arima": predict_input,
                  "exog_ts": predict_input_exog,
              },
              "model": get_stlarima_nemo_pipeline(),
          },
          "RIDGE_NEMO": {
              "tr_nodes_data": {
                  "lagged/1": train_input,
                  "lagged/2": train_input,
                  "exog_ts": train_input_exog,
              },
              "pr_nodes_data": {
                  "lagged/1": predict_input,
                  "lagged/2": predict_input,
                  "exog_ts": predict_input_exog,
              },
              "model": get_ridge_nemo_pipeline(),
          },
      }
  
      def multimodal_data_preparing(name):
          pipeline = pipelines[name]["model"]
          train_dict = {}
          predict_dict = {}
          for key in pipelines[name]["tr_nodes_data"].keys():
              train_dict[key] = deepcopy(
                  pipelines[name]["tr_nodes_data"][key]
              )
          for key in pipelines[name]["pr_nodes_data"].keys():
              predict_dict[key] = deepcopy(
                  pipelines[name]["pr_nodes_data"][key]
              )
  
          train_dataset = MultiModalData(train_dict)
          predict_dataset = MultiModalData(predict_dict)
          return pipeline, train_dataset, predict_dataset
  
      for model_name in pipelines.keys():
          (
              pipeline,
              train_dataset,
              predict_dataset,
          ) = multimodal_data_preparing(model_name)
  
          pipeline.fit_from_scratch(train_dataset)
          predicted_values = pipeline.predict(predict_dataset)
          predicted_values = predicted_values.predict
          predicted = np.ravel(np.array(predicted_values))
          test_data = np.ravel(test_data)
  
          mse_before = mean_squared_error(
              test_data, predicted, squared=False
          )
          mae_before = mean_absolute_error(test_data, predicted)
          mape_before = mean_absolute_percentage_error(
              test_data, predicted
          )
  
          errors_df[model_name + "_MSE"] = mse_before
          errors_df[model_name + "_MAE"] = mae_before
          errors_df[model_name + "_MAPE"] = mape_before
  
          if visualization:
              compare_plot(
                  predicted, test_data, len_forecast, model_name
              )
              print(model_name)
              print(f" MSE - {mse_before:.4f}")
              print(f" MAE - {mae_before:.4f}")
              print(f" MAPE - {mape_before:.4f}\n")
  
      return errors_df
  
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 10 for calling a global function with example usage: run_nemo_based_forecasting(time_series, exog_variable, len_forecast, visualization) and returns: errors_df, pipeline,  train_dataset,  predict_dataset