code: def restore_differenced_predictions(
      actuals,
      predicted,
      start_value,
      func=None,
      periods=1,
      diff_yes=True,
  ):
      try:
          restored = pd.Series(index=start_value.index)
          restored.ix[
              start_value.ix[:periods].index
          ] = start_value.values[:periods]
          rest = restored.ix[predicted.index]
          restored = pd.Series(
              np.r_[restored, rest],
              index=np.r_[start_value.index, rest.index],
          )
          restored.ix[predicted.index] = predicted.values
          restored = restored[(periods - 1) :].cumsum()
          if func:
              restored = eval("np." + func + "(restored)")
          return restored[periods:]
      except:
          restored = start_value.values + predicted
          if func:
              restored = eval("np." + func + "(restored)")
          return restored
  
imports: import numpy
  import pandas
  import itertools
  import operator
  from ..utils import print_static_rmse, print_dynamic_rmse
label_desc: Use image node_id 2 for calling a global function with example usage: restore_differenced_predictions(actuals, predicted, start_value, func, periods, diff_yes) and returns: restored, restored