code: def slow_majority(img, N):
      img = img > 0
      r, c = img.shape
      output = np.zeros_like(img)
      for y in range(r - N):
          for x in range(c - N):
              count = 0
              for dy in range(N):
                  for dx in range(N):
                      count += img[y + dy, x + dx]
              if count >= (N * N) // 2:
                  output[y + dy // 2, x + dx // 2] = 1
      return output
  
file_path: mahotas/mahotas/tests/test_majority.py
imports: import numpy
  import mahotas.morph
  from scipy import ndimage
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: slow_majority(img, N) and returns: output