code: def __init__(self, model):
      self.multiclass_params_seq_len = model.get_params().get(
          "num_parallel_tree", 1
      )
      feature_names = model.get_booster().feature_names
      self._feature_name_to_idx = {
          name: idx for idx, name in enumerate(feature_names or [])
      }
  
      model_dump = model.get_booster().get_dump(dump_format="json")
      trees = [json.loads(d) for d in model_dump]
  
      # Limit the number of trees that should be used for
      # assembling (if applicable).
      best_ntree_limit = getattr(model, "best_ntree_limit", None)
  
      super().__init__(
          model,
          trees,
          base_score=model.get_params()["base_score"],
          tree_limit=best_ntree_limit,
      )
  
imports: import json
  import math
  import numpy
  from m2cgen import ast
  from m2cgen.assemblers import utils
  from m2cgen.assemblers.base import ModelAssembler
  from m2cgen.assemblers.linear import _linear_to_ast
label_desc: Use image node_id 1 to create a new XGBoostTreeModelAssembler object from inherited base classes: BaseTreeBoostingAssembler with example: obj = XGBoostTreeModelAssembler(model)