code: def pixel_indices(pool, kj, mt, pr, qs):
      C = pool.C
      J, T, R, S = pool.JTRS
      D, H, W = pool.DHW
      HW = H * W
      DHW = D * H * W
      idx = []
  
      for j in range(J):
          c = kj + j
          ci = c * DHW
          cb = c >= 0 and c < C
  
          for t in range(T):
              z = mt + t
              zi = ci + z * HW
              zb = cb and z >= 0 and z < D
  
              for r in range(R):
                  y = pr + r
                  yi = zi + y * W
                  yb = zb and y >= 0 and y < H
  
                  for s in range(S):
                      x = qs + s
                      if yb and x >= 0 and x < W:
                          xi = yi + x
                          idx.append(xi)
      return idx
  
file_path: neon/tests/test_backend_pool_layer.py
imports: import itertools
  import numpy
  import pytest
  from neon import logger
  from utils import allclose_with_out
label_desc: Use image node_id 2 for calling a global function with example usage: pixel_indices(pool, kj, mt, pr, qs) and returns: idx