code: def local_maxima(data, mode=wrap):
      wsize = data.shape
      result = np.ones(data.shape, bool)
      for pos in np.ndindex(data.shape):
          myval = data[pos]
          for offset in np.ndindex(wsize):
              neighbor_idx = tuple(
                  mode(p, o - w // 2, w)
                  for (p, o, w) in zip(pos, offset, wsize)
              )
              result[pos] &= data[neighbor_idx] <= myval
      return result
  
imports: import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: local_maxima(data, mode) and returns: result