code: def test_json_dump_schema(self):
      import jsonschema
  
      def validate_model(parameters):
          X = np.random.random((100, 30))
          y = np.random.randint(0, 4, size=(100,))
  
          parameters["num_class"] = 4
          m = xgb.DMatrix(X, y)
  
          booster = xgb.train(parameters, m)
          dump = booster.get_dump(dump_format="json")
  
          for i in range(len(dump)):
              jsonschema.validate(
                  instance=json.loads(dump[i]), schema=schema
              )
  
      path = os.path.dirname(
          os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
      )
      doc = os.path.join(path, "doc", "dump.schema")
      with open(doc, "r") as fd:
          schema = json.load(fd)
  
      parameters = {
          "tree_method": "hist",
          "booster": "gbtree",
          "objective": "multi:softmax",
      }
      validate_model(parameters)
  
      parameters = {
          "tree_method": "hist",
          "booster": "dart",
          "objective": "multi:softmax",
      }
      validate_model(parameters)
  
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 12 for calling the TestModels obj's underlying member method code with example usage: obj.test_json_dump_schema() without return types