code: def run_ts_forecasting_example(
      dataset="australia",
      horizon: int = 30,
      timeout: float = None,
      visualization=False,
      validation_blocks=2,
      with_tuning=True,
  ):
      train_data, test_data, label = get_ts_data(
          dataset, horizon, validation_blocks=validation_blocks
      )
      # init model for the time series forecasting
  
      model = Fedot(
          problem="ts_forecasting",
          task_params=Task(
              TaskTypesEnum.ts_forecasting,
              TsForecastingParams(forecast_length=horizon),
          ).task_params,
          timeout=timeout,
          n_jobs=-1,
          metric="mae",
          with_tuning=with_tuning,
      )
  
      model.fit(train_data)
  
      pred_fedot = model.forecast(test_data)
      if visualization:
          model.current_pipeline.show()
          plt.plot(
              train_data.idx, train_data.features, label="features"
          )
          plt.plot(test_data.idx, test_data.target, label="target")
          plt.plot(test_data.idx, pred_fedot, label="fedot")
          plt.grid()
          plt.legend()
          plt.show()
  
      return pred_fedot
  
file_path: FEDOT/examples/simple/time_series_forecasting/api_forecasting.py
imports: import logging
  import random
  import numpy
  import pandas
  from matplotlib import pyplot
  from fedot import Fedot
  from fedot.core.data.data import InputData
  from fedot.core.data.data_split import train_test_data_setup
  from fedot.core.repository.dataset_types import DataTypesEnum
  from fedot.core.repository.tasks import TsForecastingParams, Task, TaskTypesEnum
  from fedot.core.utils import fedot_project_root
label_desc: Use image node_id 2 for calling a global function with example usage: run_ts_forecasting_example(dataset, horizon, timeout, visualization, validation_blocks, with_tuning) and returns: pred_fedot