code: def test_predict_bootstrapping_ValueError_when_not_out_sample_residuals_for_all_levels():
      """
      Test ValueError is raised when in_sample_residuals=False and
      forecaster.out_sample_residuals is not available for all levels.
      """
      forecaster = ForecasterAutoregMultiSeries(
          LinearRegression(), lags=3
      )
      forecaster.fit(series=series)
      residuals = {
          "2": np.array([1, 2, 3, 4, 5]),
          "3": np.array([1, 2, 3, 4, 5]),
      }
      forecaster.out_sample_residuals = residuals
      levels = ["1"]
  
      err_msg = re.escape(
          (
              f"Not `forecaster.out_sample_residuals` for levels: "
              f"{set(levels) - set(forecaster.out_sample_residuals.keys())}. "
              f"Use method `set_out_sample_residuals()`."
          )
      )
      with pytest.raises(ValueError, match=err_msg):
          forecaster.predict_bootstrapping(
              steps=1, levels=levels, in_sample_residuals=False
          )
  
imports: import re
  import pytest
  import numpy
  import pandas
  from sklearn.exceptions import NotFittedError
  from skforecast.ForecasterAutoregMultiSeries import ForecasterAutoregMultiSeries
  from sklearn.compose import ColumnTransformer
  from sklearn.preprocessing import StandardScaler
  from sklearn.preprocessing import OneHotEncoder
  from sklearn.linear_model import LinearRegression
  from .fixtures_ForecasterAutoregMultiSeries import series
  from .fixtures_ForecasterAutoregMultiSeries import exog
  from .fixtures_ForecasterAutoregMultiSeries import exog_predict
label_desc: Use image node_id 4 for calling a global function with example usage: test_predict_bootstrapping_ValueError_when_not_out_sample_residuals_for_all_levels() without return types