code: def test_nonbagged_model_with_total_resources_and_model_resources(
      mock_system_resources_ctx_mgr, mock_num_cpus, mock_num_gpus
  ):
      with mock_system_resources_ctx_mgr(
          num_cpus=mock_num_cpus, num_gpus=mock_num_gpus
      ):
          model_base = DummyModel(
              hyperparameters={
                  "ag_args_fit": {"num_cpus": 2, "num_gpus": 1}
              }
          )
          total_resources = {
              "num_cpus": 1,
              "num_gpus": 1,
          }
          with pytest.raises(AssertionError) as e:
              model_base._preprocess_fit_resources(
                  total_resources=total_resources
              )
  
          ag_args_fit = {"num_cpus": 1, "num_gpus": 0}
          model_base = DummyModel(
              hyperparameters={"ag_args_fit": ag_args_fit}
          )
          total_resources = {
              "num_cpus": 8,
              "num_gpus": 1,
          }
          resources = model_base._preprocess_fit_resources(
              total_resources=total_resources
          )
          # Here both total_resources and ag_args_fit are specified, respect ag_args_fit
          assert resources == ag_args_fit
  
imports: import pytest
  from autogluon.common.utils.resource_utils import ResourceManager
  from autogluon.core.models.ensemble.bagged_ensemble_model import BaggedEnsembleModel
  from autogluon.tabular.models import AbstractModel
label_desc: Use image node_id 8 for calling a global function with example usage: test_nonbagged_model_with_total_resources_and_model_resources(mock_system_resources_ctx_mgr, mock_num_cpus, mock_num_gpus) without return types