code: def test_not_simple_in_sample_ts_forecast_correct_for_ar_and_arima():
      """
      Test for checking if AR and ARIMA works correctly in insample forecasting task
      """
      # horizon
      forecast_length = 20
      # one-step horizon
      one_step_length = 10
      path = os.path.join(
          fedot_project_root(), "examples", "data", "ts", "M4Yearly.csv"
      )
      time_series = pd.read_csv(path)
      time_series = time_series[time_series["label"] == "Y15626"][
          "value"
      ]
      task = Task(
          TaskTypesEnum.ts_forecasting,
          TsForecastingParams(forecast_length=forecast_length),
      )
  
      # generate train/test data
      idx = np.arange(len(time_series.values))
      time_series = time_series.values
      full_series = InputData(
          idx=idx,
          features=time_series,
          target=time_series,
          task=task,
          data_type=DataTypesEnum.ts,
      )
  
      train_data, test_data = train_test_data_setup(full_series)
      train_data.task = Task(
          TaskTypesEnum.ts_forecasting,
          TsForecastingParams(forecast_length=one_step_length),
      )
      full_series.task = Task(
          TaskTypesEnum.ts_forecasting,
          TsForecastingParams(forecast_length=one_step_length),
      )
  
      pipelines = [
          PipelineBuilder().add_node("arima").build(),
          PipelineBuilder()
          .add_node("smoothing")
          .add_node("ar")
          .build(),
      ]
      for pipeline in pipelines:
          pipeline.fit(train_data)
          # making insample forecast
          predict = in_sample_ts_forecast(
              pipeline=pipeline,
              input_data=full_series,
              horizon=forecast_length,
          )
  
          assert (
              mean_absolute_percentage_error(
                  y_true=test_data.target, y_pred=predict
              )
              < 1
          )
  
imports: import os
  import numpy
  import pandas
  from sklearn.metrics import mean_absolute_percentage_error
  from fedot.core.data.data import InputData
  from fedot.core.data.data_split import train_test_data_setup
  from fedot.core.pipelines.node import PipelineNode
  from fedot.core.pipelines.pipeline import Pipeline
  from fedot.core.pipelines.pipeline_builder import PipelineBuilder
  from fedot.core.pipelines.ts_wrappers import fitted_values
  from fedot.core.pipelines.ts_wrappers import in_sample_ts_forecast, out_of_sample_ts_forecast, in_sample_fitted_values
  from fedot.core.repository.dataset_types import DataTypesEnum
  from fedot.core.repository.tasks import Task, TaskTypesEnum, TsForecastingParams
  from fedot.core.utils import fedot_project_root
label_desc: Use image node_id 5 for calling a global function with example usage: test_not_simple_in_sample_ts_forecast_correct_for_ar_and_arima() without return types