code: def check_model(
      bst: xgb.Booster | xgb.XGBModel, resources: dict[str, t.Any]
  ):
      if not isinstance(bst, xgb.Booster):
          bst = bst.get_booster()
      config = json.loads(bst.save_config())
      if (
          "nvidia.com/gpu" in resources
          and resources["nvidia.com/gpu"] > 0
      ):
          assert config["learner"]["generic_param"]["nthread"] == str(1)
      elif "cpu" in resources and resources["cpu"] > 0:
          assert config["learner"]["generic_param"]["nthread"] == str(
              int(resources["cpu"])
          )
  
file_path: BentoML/tests/integration/frameworks/models/xgboost.py
imports: from __future__ import annotations
  import json
  import typing
  from typing import TYPE_CHECKING
  import numpy
  import pandas
  import xgboost
  from sklearn.datasets import load_breast_cancer
  from sklearn.datasets import load_iris
  import bentoml
  from .None import FrameworkTestModel
  from .None import FrameworkTestModelConfiguration
  from .None import FrameworkTestModelInput
label_desc: Use image node_id 1 for calling a global function with example usage: check_model(bst, resources) without return types