code: def _test_bagging(
      fold_strategy_cls,
      num_jobs,
      num_folds_parallel,
      model_base,
      bagged_model,
      resources,
      expected_answer,
  ):
      fold_fitting_strategy = _construct_dummy_fold_strategy(
          fold_strategy_cls=fold_strategy_cls,
          num_jobs=num_jobs,
          num_folds_parallel=num_folds_parallel,
          resource_granted=resources,
          model_base=model_base,
          bagged_model=bagged_model,
      )
      expected_resources_per_model = expected_answer[
          "resources_per_model"
      ]
      assert (
          fold_fitting_strategy.resources
          == expected_resources_per_model
      )
      if fold_strategy_cls == ParallelLocalFoldFittingStrategy:
          expected_model_in_parallel = expected_answer[
              "model_in_parallel"
          ]
          assert (
              fold_fitting_strategy.num_parallel_jobs
              == expected_model_in_parallel
          )
  
imports: import time
  import numpy
  import pandas
  import pytest
  from autogluon.core.hpo.executors import CustomHpoExecutor, RayHpoExecutor
  from autogluon.core.models.ensemble.bagged_ensemble_model import BaggedEnsembleModel
  from autogluon.core.models.ensemble.fold_fitting_strategy import ParallelLocalFoldFittingStrategy, SequentialLocalFoldFittingStrategy
  from autogluon.tabular.models import AbstractModel
label_desc: Use image node_id 4 for calling a global function with example usage: _test_bagging(fold_strategy_cls, num_jobs, num_folds_parallel, model_base, bagged_model, resources, expected_answer) without return types