code: def test_slice(self, booster):
      from sklearn.datasets import make_classification
  
      num_classes = 3
      X, y = make_classification(
          n_samples=1000, n_informative=5, n_classes=num_classes
      )
      dtrain = xgb.DMatrix(data=X, label=y)
      num_parallel_tree = 4
      num_boost_round = 16
      total_trees = num_parallel_tree * num_classes * num_boost_round
      booster = xgb.train(
          {
              "num_parallel_tree": num_parallel_tree,
              "subsample": 0.5,
              "num_class": num_classes,
              "booster": booster,
              "objective": "multi:softprob",
          },
          num_boost_round=num_boost_round,
          dtrain=dtrain,
      )
      booster.feature_types = ["q"] * X.shape[1]
  
      assert len(booster.get_dump()) == total_trees
  
      self.run_slice(
          booster,
          dtrain,
          num_parallel_tree,
          num_classes,
          num_boost_round,
      )
  
      bytesarray = booster.save_raw(raw_format="ubj")
      booster = xgb.Booster(model_file=bytesarray)
      self.run_slice(
          booster,
          dtrain,
          num_parallel_tree,
          num_classes,
          num_boost_round,
      )
  
      bytesarray = booster.save_raw(raw_format="deprecated")
      booster = xgb.Booster(model_file=bytesarray)
      self.run_slice(
          booster,
          dtrain,
          num_parallel_tree,
          num_classes,
          num_boost_round,
      )
  
imports: import json
  import os
  import tempfile
  import numpy
  import pytest
  import xgboost
  from xgboost import testing
  from xgboost.testing.updater import ResetStrategy
label_desc: Use image node_id 15 for calling the TestModels obj's underlying member method code with example usage: obj.test_slice(booster) without return types