code: def test_model_binary_io(self) -> None:
      model_path = "test_model_binary_io.deprecated"
      parameters = {
          "tree_method": "hist",
          "booster": "gbtree",
          "scale_pos_weight": "0.5",
      }
      X = np.random.random((10, 3))
      y = np.random.random((10,))
      dtrain = xgb.DMatrix(X, y)
      bst = xgb.train(parameters, dtrain, num_boost_round=2)
      with pytest.warns(
          Warning, match="Model format is default to UBJSON"
      ):
          bst.save_model(model_path)
      bst = xgb.Booster(model_file=model_path)
      os.remove(model_path)
      config = json.loads(bst.save_config())
      assert (
          float(
              config["learner"]["objective"]["reg_loss_param"][
                  "scale_pos_weight"
              ]
          )
          == 0.5
      )
  
      buf = bst.save_raw()
      from_raw = xgb.Booster()
      from_raw.load_model(buf)
  
      buf_from_raw = from_raw.save_raw()
      assert buf == buf_from_raw
  
imports: import json
  import locale
  import os
  import pickle
  import tempfile
  from pathlib import Path
  from typing import List
  import numpy
  import pytest
  import xgboost
  from xgboost import testing
label_desc: Use image node_id 5 for calling the TestBoosterIO obj's underlying member method code with example usage: obj.test_model_binary_io() without return types