code: def make_grid(I, ncols=8):
      # I: N1HW or N3HW
      import numpy as np
  
      assert isinstance(
          I, np.ndarray
      ), "plugin error, should pass numpy array here"
      if I.shape[1] == 1:
          I = np.concatenate([I, I, I], 1)
      assert I.ndim == 4 and I.shape[1] == 3 or I.shape[1] == 4
      nimg = I.shape[0]
      H = I.shape[2]
      W = I.shape[3]
      ncols = min(nimg, ncols)
      nrows = int(np.ceil(float(nimg) / ncols))
      canvas = np.zeros(
          (I.shape[1], H * nrows, W * ncols), dtype=I.dtype
      )
      i = 0
      for y in range(nrows):
          for x in range(ncols):
              if i >= nimg:
                  break
              canvas[:, y * H : (y + 1) * H, x * W : (x + 1) * W] = I[i]
              i = i + 1
      return canvas
  
label_desc: Use image node_id 4 for calling a global function with example usage: make_grid(I, ncols) and returns: canvas