code: def _tree_traversal(
      tree_info, lefts, rights, features, thresholds, values
  ):
      """
      Recursive function for parsing a tree and filling the input data structures.
      """
      count = 0
      while count < len(tree_info):
          if "leaf" in tree_info[count]:
              features.append(0)
              thresholds.append(0)
              values.append([float(tree_info[count].split("=")[1])])
              lefts.append(-1)
              rights.append(-1)
              count += 1
          else:
              features.append(
                  int(
                      tree_info[count]
                      .split(":")[1]
                      .split("<")[0]
                      .replace("[f", "")
                  )
              )
              thresholds.append(
                  float(
                      tree_info[count]
                      .split(":")[1]
                      .split("<")[1]
                      .replace("]", "")
                  )
              )
              values.append([-1])
              count += 1
              l_wrong_id = (
                  tree_info[count].split(",")[0].replace("yes=", "")
              )
              l_correct_id = 0
              temp = 0
              while not tree_info[temp].startswith(
                  str(l_wrong_id + ":")
              ):
                  if "leaf" in tree_info[temp]:
                      temp += 1
                  else:
                      temp += 2
                  l_correct_id += 1
              lefts.append(l_correct_id)
  
              r_wrong_id = (
                  tree_info[count].split(",")[1].replace("no=", "")
              )
              r_correct_id = 0
              temp = 0
              while not tree_info[temp].startswith(
                  str(r_wrong_id + ":")
              ):
                  if "leaf" in tree_info[temp]:
                      temp += 1
                  else:
                      temp += 2
                  r_correct_id += 1
              rights.append(r_correct_id)
  
              count += 1
  
file_path: hummingbird/hummingbird/ml/operator_converters/xgb.py
imports: import numpy
  from onnxconverter_common.registration import register_converter
  from .None import constants
  from ._gbdt_commons import convert_gbdt_classifier_common, convert_gbdt_common
  from ._tree_commons import TreeParameters
label_desc: Use image node_id 1 for calling a global function with example usage: _tree_traversal(tree_info, lefts, rights, features, thresholds, values) without return types