code: def from_model(cls, model, tree_id=0):
      import turicreate as _tc
      import json as _json
  
      _raise_error_if_not_of_type(tree_id, [int, long], "tree_id")
      _numeric_param_check_range(
          "tree_id", tree_id, 0, model.num_trees - 1
      )
  
      tree = DecisionTree()
      tree_str = _tc.extensions._xgboost_get_tree(
          model.__proxy__, tree_id
      )
      metadata_mapping = (
          _tc.extensions._supervised_learning._get_metadata_mapping(
              model.__proxy__
          )
      )
      trees_json = _json.loads(tree_str)
  
      # Parse the tree from the JSON.
      tree._make_tree(trees_json, metadata_mapping)
      tree.root_id = 0
  
      # Keep track of the attributes.
      for key in {
          "num_examples",
          "num_features",
          "num_unpacked_features",
          "max_depth",
      }:
          setattr(tree, key, model._get(key))
      return tree
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  from turicreate.util import _raise_error_if_not_of_type
  from turicreate.toolkits._internal_utils import _numeric_param_check_range
  import sys
label_desc: Use image node_id 2 for calling the DecisionTree obj's underlying member method code with example usage: obj.from_model(cls, model, tree_id) and returns: tree