code: def test_save_and_load_forecaster_persistence():
      """
      Test if a loaded forecaster is exactly the same as the original one.
      """
      forecaster = ForecasterAutoreg(
          regressor=LinearRegression(), lags=3
      )
      rng = np.random.default_rng(123)
      y = pd.Series(rng.normal(size=50))
      forecaster.fit(y=y)
      save_forecaster(
          forecaster=forecaster,
          file_name="forecaster.joblib",
          verbose=True,
      )
      forecaster_loaded = load_forecaster(
          file_name="forecaster.joblib", verbose=True
      )
      os.remove("forecaster.joblib")
  
      for key in vars(forecaster).keys():
          attribute_forecaster = forecaster.__getattribute__(key)
          attribute_forecaster_loaded = (
              forecaster_loaded.__getattribute__(key)
          )
  
          if key == "regressor":
              assert joblib.hash(attribute_forecaster) == joblib.hash(
                  attribute_forecaster_loaded
              )
          elif isinstance(
              attribute_forecaster,
              (np.ndarray, pd.Series, pd.DataFrame, pd.Index),
          ):
              assert (
                  attribute_forecaster == attribute_forecaster_loaded
              ).all()
          else:
              assert attribute_forecaster == attribute_forecaster_loaded
  
imports: import os
  import re
  import joblib
  import pytest
  import inspect
  import warnings
  import numpy
  import pandas
  import skforecast
  from skforecast.ForecasterAutoreg import ForecasterAutoreg
  from skforecast.ForecasterAutoregMultiSeriesCustom import ForecasterAutoregMultiSeriesCustom
  from skforecast.utils import save_forecaster
  from skforecast.utils import load_forecaster
  from skforecast.exceptions import SkforecastVersionWarning
  from sklearn.linear_model import LinearRegression
label_desc: Use image node_id 4 for calling a global function with example usage: test_save_and_load_forecaster_persistence() without return types