code: def traverse_tree(
      s: pd.Series, trees: List[List[Node]], sitename: str
  ):
      sample_pos = s["sample_pos"]
      new_sample_pos = np.copy(
          sample_pos
      )  # deepcopy to avoid inplace modification, for spark
  
      tree_idx = 0
      for node_pos, tree in zip(sample_pos, trees):
          if (
              node_pos < 0
          ):  # sample already reaches leaf node in this tree
              tree_idx += 1
              continue
  
          cur_node_id = node_pos
          end_node_id = go_deep(
              s, tree, sitename, cur_node_id, tree_idx=tree_idx
          )
          new_sample_pos[tree_idx] = end_node_id
          tree_idx += 1
  
      return [new_sample_pos]
  
file_path: FATE/python/fate/ml/ensemble/algo/secureboost/common/predict.py
imports: import pandas
  import numpy
  from typing import List
  from fate.arch import Context
  from fate.arch.dataframe import DataFrame
  import copy
  from fate.ml.ensemble.learner.decision_tree.tree_core.decision_tree import DecisionTree, _make_decision, Node
  import functools
  from logging import getLogger
label_desc: Use image node_id 6 for calling a global function with example usage: traverse_tree(s, trees, sitename) and returns: list