code: def test_dynamic_stacking_hps(
      fit_helper, dataset_loader_helper, stacked_overfitting_assert_func
  ):
      """Tests dynamic stacking arguments."""
      fit_args = dict(
          hyperparameters={"DUMMY": {}},
          fit_weighted_ensemble=False,
          dynamic_stacking=True,
          num_stack_levels=1,
          num_bag_folds=2,
          num_bag_sets=1,
          time_limit=None,
          ag_args_ensemble={
              "fold_fitting_strategy": "sequential_local"
          },
      )
  
      # Get custom val data (the test data)
      (
          train_data,
          test_data,
          dataset_info,
      ) = dataset_loader_helper.load_dataset(
          name="adult", directory_prefix="./datasets/"
      )
      label = dataset_info["label"]
      allowed_cols = ["age", label]
      train_data = train_data[allowed_cols]
      test_data = test_data[allowed_cols]
      n_test_data = len(test_data)
  
      for ds_args_update in [
          dict(
              validation_procedure="holdout", holdout_frac=1 / 5
          ),  # holdout
          dict(validation_procedure="cv"),  # 2-fold CV
          dict(
              validation_procedure="cv", n_repeats=2
          ),  # 2-repeated 2-fold CV
          dict(
              memory_safe_fits=False, clean_up_fits=False
          ),  # fit options False
          dict(holdout_data=test_data),
          dict(
              holdout_data=test_data,
              validation_procedure="cv",
              expect_raise=ValueError,
          ),
      ]:
          expect_raise = ds_args_update.pop("expect_raise", None)
          tmp_ds_args = DS_ARGS_TEST_DEFAULTS.copy()
          if ds_args_update is not None:
              tmp_ds_args.update(ds_args_update)
          tmp_fit_args = fit_args.copy()
          tmp_fit_args["ds_args"] = tmp_ds_args
          if expect_raise is None:
              predictor = fit_helper.fit_dataset(
                  train_data=train_data,
                  init_args=dict(label=label),
                  fit_args=tmp_fit_args,
                  sample_size=1000,
              )
              if ("holdout_data" in ds_args_update) and (
                  ds_args_update["holdout_data"] is not None
              ):
                  n_expected = 1000 + n_test_data
                  assert (
                      len(predictor.predict_oof()) == n_expected
                  ), "Verify that holdout data was used for training"
              lb = predictor.leaderboard(test_data, extra_info=True)
              stacked_overfitting_assert_func(
                  lb, predictor, False, False
              )
              shutil.rmtree(predictor.path)
          else:
              with pytest.raises(expect_raise):
                  fit_helper.fit_dataset(
                      train_data=train_data,
                      init_args=dict(label=label),
                      fit_args=tmp_fit_args,
                      sample_size=1000,
                  )
  
file_path: autogluon/tabular/tests/unittests/dynamic_stacking/test_dynamic_stacking.py
imports: import shutil
  import pytest
  from autogluon.core.constants import BINARY
  from autogluon.core.metrics import METRICS
label_desc: Use image node_id 2 for calling a global function with example usage: test_dynamic_stacking_hps(fit_helper, dataset_loader_helper, stacked_overfitting_assert_func) without return types