code: def sum_by_index(
      data_list: Union[SingleData], new_index: list, fill_value=0
  ) -> SingleData:
      """concat all SingleData by new index.
  
      Parameters
      ----------
      data_list : List[SingleData]
          the list of all SingleData to sum.
      new_index : list
          the new_index of new SingleData.
      fill_value : float
          fill the missing values or replace np.NaN.
  
      Returns
      -------
      SingleData
          the SingleData with new_index and values after sum.
      """
      data_list = [data.to_dict() for data in data_list]
      data_sum = {}
      for id in new_index:
          item_sum = 0
          for data in data_list:
              if id in data and not np.isnan(data[id]):
                  item_sum += data[id]
              else:
                  item_sum += fill_value
          data_sum[id] = item_sum
      return SingleData(data_sum)
  
imports: from __future__ import annotations
  from typing import Dict, Tuple, Union, Callable, List
  import bisect
  import numpy
  import pandas
label_desc: Use image node_id 2 for calling a global function with example usage: sum_by_index(data_list, new_index, fill_value) and returns: SingleData