def local_maxima(data, wsize, mode=wrap):
  result = np.ones(shape=data.shape,dtype=bool)
  for pos in np.ndindex(data.shape):
    myval = data[pos]  
    for offset in np.ndindex(wsize):
      neighbor_idx = tuple(mode(p, w/2-o, w) for (p, o, w) in zip(pos, offset, wsize))
      result[pos] &= (data[neighbor_idx] <= myval)
  return result
dataset/ETHPy150Open iskandr/parakeet/benchmarks/nd_local_maxima.py/local_maxima/swapped operands of `-`