code: def test_parse_tree_dump():
      text_dump = """\
  0:[f1793<-9.53674e-07] yes=1,no=2,missing=1,gain=6.112,cover=37.5
  	1:[f371<-9.53674e-07] yes=3,no=4,missing=3,gain=4.09694,cover=28.5
  		3:leaf=-0.0396476,cover=27.375
  		4:leaf=0.105882,cover=1.125
  	2:[f3332<-9.53674e-07] yes=5,no=6,missing=5,gain=3.41271,cover=9
  		5:leaf=0.0892308,cover=7.125
  		6:leaf=-0.0434783,cover=1.875
  """
      assert _parse_tree_dump(text_dump) == {
          "children": [
              {
                  "children": [
                      {
                          "cover": 27.375,
                          "leaf": -0.0396476,
                          "nodeid": 3,
                      },
                      {"cover": 1.125, "leaf": 0.105882, "nodeid": 4},
                  ],
                  "cover": 28.5,
                  "depth": 1,
                  "gain": 4.09694,
                  "missing": 3,
                  "no": 4,
                  "nodeid": 1,
                  "split": "f371",
                  "split_condition": -9.53674e-07,
                  "yes": 3,
              },
              {
                  "children": [
                      {"cover": 7.125, "leaf": 0.0892308, "nodeid": 5},
                      {"cover": 1.875, "leaf": -0.0434783, "nodeid": 6},
                  ],
                  "cover": 9.0,
                  "depth": 1,
                  "gain": 3.41271,
                  "missing": 5,
                  "no": 6,
                  "nodeid": 2,
                  "split": "f3332",
                  "split_condition": -9.53674e-07,
                  "yes": 5,
              },
          ],
          "cover": 37.5,
          "depth": 0,
          "gain": 6.112,
          "missing": 1,
          "no": 2,
          "nodeid": 0,
          "split": "f1793",
          "split_condition": -9.53674e-07,
          "yes": 1,
      }
  
      with pytest.raises(ValueError):
          _parse_tree_dump("foo")
  
      with pytest.raises(ValueError):
          _parse_tree_dump(
              """\
  0:[f1793<-9.53674e-07] yes=1,no=2,missing=1,gain=6.112,cover=37.5
  		1:[f371<-9.53674e-07] yes=3,no=4,missing=3,gain=4.09694,cover=28.5
  """
          )
  
imports: from __future__ import absolute_import
  import pytest
  import numpy
  import scipy.sparse
  from sklearn.feature_extraction.text import CountVectorizer
  import xgboost
  from xgboost import XGBClassifier, XGBRegressor
  from sklearn.pipeline import FeatureUnion
  from sklearn.preprocessing import FunctionTransformer
  from eli5.xgboost import _parse_tree_dump, _xgb_n_targets, _missing_values_set_to_nan, _parent_value, _parse_dump_line, _check_booster_args
  from eli5.explain import explain_prediction, explain_weights
  from eli5.formatters.text import format_as_text
  from eli5.formatters import fields
  from .utils import format_as_all, get_all_features, check_targets_scores
  from .test_sklearn_explain_weights import test_explain_tree_classifier, test_explain_random_forest_and_tree_feature_filter, test_feature_importances_no_remaining, assert_tree_classifier_explained
  from .test_sklearn_explain_prediction import assert_linear_regression_explained, assert_trained_linear_regression_explained, assert_explain_prediction_single_target, test_explain_clf_binary_iris, test_explain_prediction_pandas
label_desc: Use image node_id 21 for calling a global function with example usage: test_parse_tree_dump() without return types