code: def borders(labeled, Bc=None, out=None, output=None, mode="constant"):
      """
      border_img = borders(labeled, Bc={3x3 cross}, out={np.zeros(labeled.shape, bool)})
  
      Compute border pixels
  
      A pixel is on a border if it has value `i` and a pixel in its neighbourhood
      (defined by `Bc`) has value `j`, with ``i != j``.
  
      Parameters
      ----------
      labeled : ndarray of integer type
          input labeled array
      Bc : structure element, optional
      out : ndarray of same shape as `labeled`, dtype=bool, optional
          where to store the output. If ``None``, a new array is allocated
      mode : {'reflect', 'nearest', 'wrap', 'mirror', 'constant' [default], 'ignore'}
          How to handle borders
  
      Returns
      -------
      border_img : boolean ndarray
          Pixels are True exactly where there is a border in `labeled`
      """
      Bc = get_structuring_elem(labeled, Bc)
      output = _get_output(
          labeled, out, "labeled.borders", bool, output=output
      )
      output.fill(False)
      return _labeled.borders(
          labeled, Bc, output, _checked_mode2int(mode, 0.0, "borders")
      )
  
imports: from __future__ import division
  import numpy
  from .morph import get_structuring_elem
  from .None import _labeled
  from .internal import _get_output
  from ._filters import _checked_mode2int
  import mahotas
label_desc: Use image node_id 8 for calling a global function with example usage: borders(labeled, Bc, out, output, mode) and returns: _labeled