code: def update(pattern, counter, x, y):
      if x and y:
          pattern = np.array(shapes[pattern])
          r, c = pattern.shape
          y, x = img.sheet2matrixidx(x, y)
          img.data[y : y + r, x : x + c] = pattern[::-1]
      else:
          img.data = step(img.data)
      return hv.Image(img)
  
file_path: holoviews/examples/gallery/apps/bokeh/game_of_life.py
imports: import numpy
  import holoviews
  import panel
  from holoviews import opts
  from holoviews.streams import Tap, Counter, DoubleTap
  from scipy.signal import convolve2d
label_desc: Use image node_id 2 for calling a global function with example usage: update(pattern, counter, x, y) and returns: hv