code: def convert_forecast_to_output(
      pre_history_data: Union[InputData, MultiModalData],
      forecast: np.array,
      idx: Optional[np.array] = None,
  ) -> OutputData:
      """Converts forecast array to OutputData
  
      Args:
          pre_history_data: data which was used for prediction
          forecast: array with predicted values
          idx: array with idx values. If None sets next idx after `pre_history_data` with length of forecast for InputData
          and idx from 0 to forecast length for MultimodalData.
      """
      features = (
          pre_history_data.features
          if isinstance(pre_history_data, InputData)
          else None
      )
      if forecast.ndim > 1:
          forecast = np.squeeze(forecast)
      if idx is None:
          if features is not None:
              idx = np.arange(
                  len(features), len(features) + len(forecast)
              )
          else:
              idx = np.arange(len(forecast))
      prediction = OutputData(
          idx=idx,
          features=features,
          predict=forecast,
          task=pre_history_data.task,
          data_type=DataTypesEnum.ts,
      )
      return prediction
  
file_path: FEDOT/fedot/core/pipelines/ts_wrappers.py
imports: import math
  from copy import copy
  from typing import Union, Optional
  import numpy
  from fedot.core.data.data import InputData, OutputData
  from fedot.core.data.multi_modal import MultiModalData
  from fedot.core.operations.evaluation.operation_implementations.data_operations.ts_transformations import ts_to_table
  from fedot.core.pipelines.pipeline import Pipeline
  from fedot.core.repository.dataset_types import DataTypesEnum
  from fedot.core.repository.tasks import TaskTypesEnum
label_desc: Use image node_id 10 for calling a global function with example usage: convert_forecast_to_output(pre_history_data, forecast, idx) and returns: prediction