code: def test_in_sample_ts_models_forecast_correct():
      """
      To be applied in in-sample forecasting method for AR, ARIMA and some other
      models it is required to use refit after each prediction
      """
      simple_length = 2
      multi_length = 10
      train_input, predict_input = prepare_ts_for_in_sample(
          simple_length, multi_length
      )
  
      ts_pipelines = get_ts_pipelines_for_testing()
      full_ts = predict_input.features
      for ts_pipeline in ts_pipelines:
          ts_pipeline.fit(train_input)
  
          multi_predicted = in_sample_ts_forecast(
              pipeline=ts_pipeline,
              input_data=predict_input,
              horizon=multi_length,
          )
  
          # Validate without last element
          metric = mean_absolute_percentage_error(
              full_ts[-multi_length:-1], multi_predicted[:-1]
          )
          # Metric should be low - forecast should almost repeat the actual line
          assert metric < 0.001
  
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 6 for calling a global function with example usage: test_in_sample_ts_models_forecast_correct() without return types