code: def _accumulate_scores(
      acc_scores: DataFrame,
      new_scores: DataFrame,
      learning_rate: float,
      multi_class=False,
      class_num=None,
      dim=0,
  ):
      def _extend_score(s: pd.Series, class_num, dim):
          new_s = pd.Series()
          new_s["score"] = np.zeros(class_num)
          new_s["score"][dim] = s["score"]
          return new_s
  
      new_scores = new_scores.loc(
          acc_scores.get_indexer(target="sample_id"),
          preserve_order=True,
      )
      if not multi_class:
          acc_scores = acc_scores + new_scores * learning_rate
      else:
          extend_scores = new_scores.apply_row(
              lambda s: _extend_score(s, class_num, dim),
              columns=["score"],
          )
          acc_scores = acc_scores + extend_scores * learning_rate
      return acc_scores
  
imports: import numpy
  import pandas
  from typing import Optional, Union
  from fate.arch import Context
  from fate.arch.dataframe import DataFrame
  from fate.ml.ensemble.algo.secureboost.hetero._base import HeteroBoostingTree
  from fate.ml.ensemble.learner.decision_tree.hetero.guest import HeteroDecisionTreeGuest
  from fate.ml.ensemble.utils.binning import binning
  from fate.ml.ensemble.learner.decision_tree.tree_core.loss import OBJECTIVE, get_task_info, MULTI_CE, BINARY_BCE, REGRESSION_L2
  from fate.ml.ensemble.algo.secureboost.common.predict import predict_leaf_guest
  from fate.ml.utils.predict_tools import compute_predict_details, PREDICT_SCORE, BINARY, MULTI, REGRESSION
  from fate.ml.ensemble.learner.decision_tree.tree_core.decision_tree import GUEST_FEAT_ONLY, ALL_FEAT
  from fate.ml.ensemble.utils.sample import goss_sample
  import logging
label_desc: Use image node_id 4 for calling a global function with example usage: _accumulate_scores(acc_scores, new_scores, learning_rate, multi_class, class_num, dim) and returns: acc_scores, new_s