code: def smooth1d(x, window_len):
      # copied from https://scipy-cookbook.readthedocs.io/items/SignalSmooth.html
      s = np.r_[
          2 * x[0] - x[window_len:1:-1],
          x,
          2 * x[-1] - x[-1:-window_len:-1],
      ]
      w = np.hanning(window_len)
      y = np.convolve(w / w.sum(), s, mode="same")
      return y[window_len - 1 : -window_len + 1]
  
imports: import matplotlib.pyplot
  import numpy
  from matplotlib.artist import Artist
  import matplotlib.cm
  from matplotlib.colors import LightSource
  import matplotlib.transforms
label_desc: Use image node_id 1 for calling a global function with example usage: smooth1d(x, window_len) and returns: y