code: def test_gridsearch_n_random_samples_bad_arguments(self):
      dummy_series = get_dummy_series(ts_length=50)
  
      params = {
          "lags": list(range(1, 11)),
          "past_covariates": list(range(1, 11)),
      }
  
      with pytest.raises(ValueError):
          RandomForest.gridsearch(
              params,
              dummy_series,
              forecast_horizon=1,
              n_random_samples=-5,
          )
      with pytest.raises(ValueError):
          RandomForest.gridsearch(
              params,
              dummy_series,
              forecast_horizon=1,
              n_random_samples=105,
          )
      with pytest.raises(ValueError):
          RandomForest.gridsearch(
              params,
              dummy_series,
              forecast_horizon=1,
              n_random_samples=-24.56,
          )
      with pytest.raises(ValueError):
          RandomForest.gridsearch(
              params,
              dummy_series,
              forecast_horizon=1,
              n_random_samples=1.5,
          )
  
imports: import random
  from itertools import product
  import numpy
  import pandas
  import pytest
  from darts import TimeSeries
  from darts.datasets import AirPassengersDataset, MonthlyMilkDataset
  from darts.logging import get_logger
  from darts.metrics import mape, r2_score
  from darts.models import ARIMA, FFT, ExponentialSmoothing, NaiveDrift, NaiveSeasonal, Theta
  from darts.tests.conftest import tfm_kwargs
  from darts.utils.timeseries_generation import gaussian_timeseries
  from darts.utils.timeseries_generation import linear_timeseries
  from darts.utils.timeseries_generation import random_walk_timeseries
  from darts.utils.timeseries_generation import sine_timeseries
label_desc: Use image node_id 8 for calling the TestBacktesting obj's underlying member method code with example usage: obj.test_gridsearch_n_random_samples_bad_arguments() without return types