code: def run_model_json_io(self, parameters: dict, ext: str) -> None:
      config = xgb.config.get_config()
      assert config["verbosity"] == 1
  
      if ext == "ubj" and tm.no_ubjson()["condition"]:
          pytest.skip(tm.no_ubjson()["reason"])
  
      loc = locale.getpreferredencoding(False)
      model_path = "test_model_json_io." + ext
      j_model = json_model(model_path, parameters)
      assert isinstance(j_model["learner"], dict)
  
      bst = xgb.Booster(model_file=model_path)
  
      bst.save_model(fname=model_path)
      if ext == "ubj":
          import ubjson
  
          with open(model_path, "rb") as ubjfd:
              j_model = ubjson.load(ubjfd)
      else:
          with open(model_path, "r") as fd:
              j_model = json.load(fd)
  
      assert isinstance(j_model["learner"], dict)
  
      os.remove(model_path)
      assert locale.getpreferredencoding(False) == loc
  
      json_raw = bst.save_raw(raw_format="json")
      from_jraw = xgb.Booster()
      from_jraw.load_model(json_raw)
  
      ubj_raw = bst.save_raw(raw_format="ubj")
      from_ubjraw = xgb.Booster()
      from_ubjraw.load_model(ubj_raw)
  
      if parameters.get("multi_strategy", None) != "multi_output_tree":
          # Old binary model is not supported for vector leaf.
          with pytest.warns(
              Warning, match="Model format is default to UBJSON"
          ):
              old_from_json = from_jraw.save_raw(
                  raw_format="deprecated"
              )
              old_from_ubj = from_ubjraw.save_raw(
                  raw_format="deprecated"
              )
  
          assert old_from_json == old_from_ubj
  
      raw_json = bst.save_raw(raw_format="json")
      pretty = json.dumps(json.loads(raw_json), indent=2) + "\n\n"
      bst.load_model(bytearray(pretty, encoding="ascii"))
  
      if parameters.get("multi_strategy", None) != "multi_output_tree":
          # old binary model is not supported.
          with pytest.warns(
              Warning, match="Model format is default to UBJSON"
          ):
              old_from_json = from_jraw.save_raw(
                  raw_format="deprecated"
              )
              old_from_ubj = from_ubjraw.save_raw(
                  raw_format="deprecated"
              )
  
          assert old_from_json == old_from_ubj
  
      rng = np.random.default_rng()
      X = rng.random(size=from_jraw.num_features() * 10).reshape(
          (10, from_jraw.num_features())
      )
      predt_from_jraw = from_jraw.predict(xgb.DMatrix(X))
      predt_from_bst = bst.predict(xgb.DMatrix(X))
      np.testing.assert_allclose(predt_from_jraw, predt_from_bst)
  
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 1 for calling the TestBoosterIO obj's underlying member method code with example usage: obj.run_model_json_io(parameters, ext) without return types