code: def remove_bordering(labeled, rsize=1, out=None, output=None):
      """
      slabeled = remove_bordering(labeled, rsize=1, out={np.empty_like(im)})
  
      Remove objects that are touching the border.
  
      Pass ``labeled`` as ``out`` to achieve in-place operation.
  
      Parameters
      ----------
      labeled : ndarray
          Labeled array
      rsize : int or tuple, optional
          Minimum distance to the border (in Manhatan distance) to allow an
          object to survive. May be int or tuple with len == labeled.ndim.
      out : ndarray, optional
          If ``im`` is passed as ``out``, then it operates inline.
  
      Returns
      -------
      slabeled : ndarray
          Subset of ``labeled``
      """
      im = labeled
      invalid = set()
      index = [slice(None, None, None) for _ in range(im.ndim)]
      if type(rsize) is not tuple:
          rsize = (rsize,) * im.ndim
      for dim in range(im.ndim):
          for bordering in (
              slice(rsize[dim]),
              slice(im.shape[dim] - rsize[dim], None),
          ):
              index[dim] = bordering
              for val in np.unique(im[tuple(index)].ravel()):
                  if val != 0:
                      invalid.add(val)
          index[dim] = slice(None, None, None)
      if out is None and output is not None:  # pragma: no cover
          import warnings
  
          warnings.warn(
              "Using deprecated `output` argument in function `%s`. Please use `out` in the future."
              % "remove_bordering",
              DeprecationWarning,
          )
          out = output
      if out is None:
          out = im.copy()
      elif out is not im:
          out[:] = im
      for val in invalid:
          out *= im != val
      return out
  
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 6 for calling a global function with example usage: remove_bordering(labeled, rsize, out, output) and returns: out