code: def stitch_histograms(
      mode=None,
      hists_basis=None,
      hists_delta=None,
      hists_list=None,
      time_axis=None,
      time_bin_idx=None,
  ):
      """Stitching histograms by first axis.
  
      Histograms in hists_delta are added to those in hists_basis. Bins are summed or replaced, set this with 'mode'.
      'time_axis' specifies the name of the first axis. If the time_axis is not found, it is created, and
      histograms get inserted the time_bin_idx values.
  
      :param str mode: options for histogram stitching: "add" or "replace" bins. default is "add".
      :param dict hists_basis: input dict of basis histograms.
      :param dict hists_delta: delta dict of histograms to add to hists_basis.
      :param list hists_list: alternative for [hists_basis, hists_delta, etc]. can have multiple deltas.
          first item in list is taken as hists_basis (optional)
      :param str time_axis: time-axis used for stitching (optional).
      :param time_bin_idx: (list of) time-value(s) at which to insert hist-deltas into hist-basis.
      :return: dict with stitched histograms. If stitching is not possible, returns hists_basis.
      """
      stitcher = HistStitcher()
      return stitcher.stitch_histograms(
          mode=mode,
          hists_basis=hists_basis,
          hists_delta=hists_delta,
          hists_list=hists_list,
          time_axis=time_axis,
          time_bin_idx=time_bin_idx,
      )
  
file_path: popmon/popmon/stitching/hist_stitcher.py
imports: import histogrammar
  import numpy
  from popmon.analysis.hist_numpy import assert_similar_hists
  from popmon.base import Module
label_desc: Use image node_id 1 for calling a global function with example usage: stitch_histograms(mode, hists_basis, hists_delta, hists_list, time_axis, time_bin_idx) and returns: stitcher