code: def test_predict_bootstrapping_ValueError_when_out_sample_residuals_is_None():
      """
      Test ValueError is raised when in_sample_residuals=False and
      forecaster.out_sample_residuals is None.
      """
      forecaster = ForecasterAutoregDirect(
          LinearRegression(), lags=3, steps=2
      )
      forecaster.fit(y=pd.Series(np.arange(10)))
  
      err_msg = re.escape(
          (
              "`forecaster.out_sample_residuals` is `None`. Use "
              "`in_sample_residuals=True` or method `set_out_sample_residuals()` "
              "before `predict_interval()`, `predict_bootstrapping()`, "
              "`predict_quantiles()` or `predict_dist()`."
          )
      )
      with pytest.raises(ValueError, match=err_msg):
          forecaster.predict_bootstrapping(
              steps=1, in_sample_residuals=False
          )
  
file_path: skforecast/skforecast/ForecasterAutoregDirect/tests/test_predict_bootstrapping.py
imports: import re
  import pytest
  import numpy
  import pandas
  from sklearn.exceptions import NotFittedError
  from skforecast.ForecasterAutoregDirect import ForecasterAutoregDirect
  from sklearn.linear_model import LinearRegression
  from sklearn.preprocessing import StandardScaler
  from .fixtures_ForecasterAutoregDirect import y
  from .fixtures_ForecasterAutoregDirect import exog
  from .fixtures_ForecasterAutoregDirect import exog_predict
label_desc: Use image node_id 3 for calling a global function with example usage: test_predict_bootstrapping_ValueError_when_out_sample_residuals_is_None() without return types