code: def majority_filter(img, N=3, out=None, output=None):
      """
      filtered = majority_filter(img, N=3, out={np.empty(img.shape, bool)})
  
      Majority filter
  
      filtered[y,x] is positive if the majority of pixels in the squared of size
      `N` centred on (y,x) are positive.
  
      Parameters
      ----------
      img : ndarray
          input img (currently only 2-D images accepted)
      N : int, optional
          size of filter (must be odd integer), defaults to 3.
      out : ndarray, optional
          Used for output. Must be Boolean ndarray of same size as `img`
      output : deprecated
          Do not use
  
      Returns
      -------
      filtered : ndarray
          boolean image of same size as img.
      """
      img = np.asanyarray(img, dtype=np.bool_)
      output = _get_output(
          img, out, "majority_filter", np.bool_, output=output
      )
      if N <= 1:
          raise ValueError(
              "mahotas.majority_filter: filter size must be positive"
          )
      if not N & 1:
          import warnings
  
          warnings.warn(
              "mahotas.majority_filter: size argument must be odd. Adding 1."
          )
          N += 1
      return _morph.majority_filter(img, N, output)
  
imports: from __future__ import division
  import numpy
  from .internal import _get_output, _verify_is_integer_type, _check_2
  from .None import _morph
label_desc: Use image node_id 12 for calling a global function with example usage: majority_filter(img, N, out, output) and returns: _morph