code: def build_history_callback(history_stream):
      """
      Build StreamCallback for History stream
  
      Args:
          history_stream: A History stream
  
      Returns:
          StreamCallback
      """
      history_id = id(history_stream)
      input_stream_id = id(history_stream.input_stream)
  
      def history_callback(prior_value, input_value):
          new_value = copy.deepcopy(prior_value)
          new_value["values"].append(input_value)
          return new_value
  
      return StreamCallback(
          input_ids=[history_id, input_stream_id],
          fn=history_callback,
          output_id=history_id,
      )
  
imports: import base64
  import copy
  import pickle
  import uuid
  from collections import namedtuple
  from dash.exceptions import PreventUpdate
  import holoviews
  from holoviews.core.decollate import expr_to_fn_of_stream_contents, initialize_dynamic, to_expr_extract_streams
  from holoviews.plotting.plotly import DynamicMap, PlotlyRenderer
  from holoviews.plotting.plotly.callbacks import BoundsXCallback, BoundsXYCallback, BoundsYCallback, RangeXCallback, RangeXYCallback, RangeYCallback, Selection1DCallback
  from holoviews.plotting.plotly.util import clean_internal_figure_properties
  from holoviews.streams import Derived, History
  import plotly.graph_objects
  from dash import callback_context
  from dash.dependencies import Input, Output, State
label_desc: Use image node_id 6 for calling a global function with example usage: build_history_callback(history_stream) and returns: StreamCallback, new_value