code: def test_sanity_check_invalid_start(self):
      timeidx_ = tg.linear_timeseries(length=10)
      rangeidx_step1 = tg.linear_timeseries(start=0, length=10, freq=1)
      rangeidx_step2 = tg.linear_timeseries(start=0, length=10, freq=2)
  
      # label_index (int), too large
      with pytest.raises(ValueError) as msg:
          LinearRegressionModel(lags=1).historical_forecasts(
              timeidx_, start=11
          )
      assert str(msg.value).startswith(
          "`start` index `11` is out of bounds"
      )
      with pytest.raises(ValueError) as msg:
          LinearRegressionModel(lags=1).historical_forecasts(
              rangeidx_step1,
              start=rangeidx_step1.end_time() + rangeidx_step1.freq,
          )
      assert str(msg.value).startswith(
          "`start` index `10` is larger than the last index"
      )
      with pytest.raises(ValueError) as msg:
          LinearRegressionModel(lags=1).historical_forecasts(
              rangeidx_step2,
              start=rangeidx_step2.end_time() + rangeidx_step2.freq,
          )
      assert str(msg.value).startswith(
          "`start` index `20` is larger than the last index"
      )
  
      # label_index (timestamp) too high
      with pytest.raises(ValueError) as msg:
          LinearRegressionModel(lags=1).historical_forecasts(
              timeidx_, start=timeidx_.end_time() + timeidx_.freq
          )
      assert str(msg.value).startswith(
          "`start` time `2000-01-11 00:00:00` is after the last timestamp `2000-01-10 00:00:00`"
      )
  
      # label_index, invalid
      with pytest.raises(ValueError) as msg:
          LinearRegressionModel(lags=1).historical_forecasts(
              rangeidx_step2, start=11
          )
      assert str(msg.value).startswith(
          "The provided point is not a valid index"
      )
  
      # label_index, too low
      with pytest.raises(ValueError) as msg:
          LinearRegressionModel(lags=1).historical_forecasts(
              timeidx_, start=timeidx_.start_time() - timeidx_.freq
          )
      assert str(msg.value).startswith(
          "`start` time `1999-12-31 00:00:00` is before the first timestamp `2000-01-01 00:00:00`"
      )
      with pytest.raises(ValueError) as msg:
          LinearRegressionModel(lags=1).historical_forecasts(
              rangeidx_step1,
              start=rangeidx_step1.start_time() - rangeidx_step1.freq,
          )
      assert str(msg.value).startswith(
          "`start` index `-1` is smaller than the first index `0`"
      )
      with pytest.raises(ValueError) as msg:
          LinearRegressionModel(lags=1).historical_forecasts(
              rangeidx_step2,
              start=rangeidx_step2.start_time() - rangeidx_step2.freq,
          )
      assert str(msg.value).startswith(
          "`start` index `-2` is smaller than the first index `0`"
      )
  
      # positional_index, predicting only the last position
      LinearRegressionModel(lags=1).historical_forecasts(
          timeidx_, start=9, start_format="position"
      )
  
      # positional_index, predicting from the first position with retrain=True
      with pytest.raises(ValueError) as msg:
          LinearRegressionModel(lags=1).historical_forecasts(
              timeidx_, start=-10, start_format="position"
          )
      assert str(msg.value).endswith(
          ", resulting in an empty training set."
      )
  
      # positional_index, beyond boundaries
      with pytest.raises(ValueError) as msg:
          LinearRegressionModel(lags=1).historical_forecasts(
              timeidx_, start=10, start_format="position"
          )
      assert str(msg.value).startswith(
          "`start` index `10` is out of bounds for series of length 10"
      )
      with pytest.raises(ValueError) as msg:
          LinearRegressionModel(lags=1).historical_forecasts(
              timeidx_, start=-11, start_format="position"
          )
      assert str(msg.value).startswith(
          "`start` index `-11` is out of bounds for series of length 10"
      )
  
imports: import itertools
  from itertools import product
  import numpy
  import pandas
  import pytest
  import darts
  from darts import TimeSeries, concatenate
  from darts.dataprocessing.transformers import Scaler
  from darts.datasets import AirPassengersDataset
  from darts.logging import get_logger
  from darts.models import ARIMA, AutoARIMA, CatBoostModel, LightGBMModel, LinearRegressionModel, NaiveSeasonal, NotImportedModule
  from darts.tests.conftest import tfm_kwargs
  from darts.utils import timeseries_generation
label_desc: Use image node_id 8 for calling the TestHistoricalforecast obj's underlying member method code with example usage: obj.test_sanity_check_invalid_start() without return types