code: def _update_sample_pos(
      self,
      ctx: Context,
      cur_layer_nodes: List[Node],
      sample_pos: DataFrame,
      data: DataFrame,
      node_map: dict,
      local_update=False,
  ):
      sitename = ctx.local.name
      data_with_pos = DataFrame.hstack([data, sample_pos])
      map_func = functools.partial(
          _update_sample_pos_on_local_nodes,
          cur_layer_node=cur_layer_nodes,
          node_map=node_map,
          sitename=sitename,
      )
  
      if local_update:
          updated_sample_pos = data_with_pos.apply_row(
              map_func, columns=["g_on_local", "node_idx"]
          )
          return updated_sample_pos["node_idx"]
      else:
          updated_sample_pos = data_with_pos.apply_row(
              map_func, columns=["g_on_local", "g_node_idx"]
          )
  
      # synchronize sample pos
      host_update_sample_pos = ctx.hosts.get("updated_data")
  
      merge_func = functools.partial(_merge_sample_pos)
      for host_data in host_update_sample_pos:
          updated_sample_pos = DataFrame.hstack(
              [updated_sample_pos, host_data]
          ).apply_row(merge_func, columns=["g_on_local", "g_node_idx"])
  
      new_sample_pos = updated_sample_pos.create_frame(
          columns=["g_node_idx"]
      )
      new_sample_pos.rename(columns={"g_node_idx": "node_idx"})
      ctx.hosts.put("new_sample_pos", new_sample_pos)
      self.sample_pos = new_sample_pos
  
      return new_sample_pos
  
imports: from fate.ml.ensemble.learner.decision_tree.tree_core.decision_tree import DecisionTree, Node, _update_sample_pos_on_local_nodes, _merge_sample_pos
  from fate.ml.ensemble.learner.decision_tree.tree_core.hist import SBTHistogramBuilder
  from fate.ml.ensemble.learner.decision_tree.tree_core.splitter import SBTSplitter
  from fate.ml.ensemble.learner.decision_tree.tree_core.loss import get_task_info
  from fate.ml.ensemble.learner.decision_tree.tree_core.decision_tree import ALL_FEAT, GUEST_FEAT_ONLY
  from fate.ml.utils.predict_tools import BINARY, MULTI, REGRESSION
  from fate.arch import Context
  from fate.arch.dataframe import DataFrame
  from typing import List
  import functools
  import logging
  import pandas
  import torch
  import math
label_desc: Use image node_id 5 for calling the HeteroDecisionTreeGuest obj's underlying member method code with example usage: obj._update_sample_pos(ctx, cur_layer_nodes, sample_pos, data, node_map, local_update) and returns: new_sample_pos, updated_sample_pos